Commit 8ef37457 authored by unknown's avatar unknown

key_cache.result, sql_lex.h, sql_yacc.yy, set_var.cc, sql_lex.cc:

  After merge fix


sql/sql_lex.cc:
  After merge fix
sql/set_var.cc:
  After merge fix
sql/sql_yacc.yy:
  After merge fix
sql/sql_lex.h:
  After merge fix
mysql-test/r/key_cache.result:
  After merge fix
parent f84aefc3
...@@ -77,7 +77,7 @@ select @@keycache1.key_cache_block_size; ...@@ -77,7 +77,7 @@ select @@keycache1.key_cache_block_size;
0 0
select @@key_buffer_size; select @@key_buffer_size;
@@key_buffer_size @@key_buffer_size
16777216 2097152
select @@key_cache_block_size; select @@key_cache_block_size;
@@key_cache_block_size @@key_cache_block_size
1024 1024
...@@ -121,7 +121,7 @@ i ...@@ -121,7 +121,7 @@ i
explain select count(*) from t1, t2 where t1.p = t2.i; explain select count(*) from t1, t2 where t1.p = t2.i;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 2 Using index 1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 2 Using index
1 SIMPLE t2 index k1 k1 5 NULL 4 Using where; Using index 1 SIMPLE t2 ref k1 k1 5 test.t1.p 2 Using where; Using index
select count(*) from t1, t2 where t1.p = t2.i; select count(*) from t1, t2 where t1.p = t2.i;
count(*) count(*)
3 3
......
...@@ -1507,7 +1507,8 @@ static KEY_CACHE_VAR *get_key_cache(LEX_STRING *cache_name) ...@@ -1507,7 +1507,8 @@ static KEY_CACHE_VAR *get_key_cache(LEX_STRING *cache_name)
default_key_cache_base.length))) default_key_cache_base.length)))
cache_name= &default_key_cache_base; cache_name= &default_key_cache_base;
return ((KEY_CACHE_VAR*) find_named(&key_caches, return ((KEY_CACHE_VAR*) find_named(&key_caches,
cache_name->str, cache_name->length)); cache_name->str, cache_name->length,
0));
} }
byte *sys_var_key_cache_param::value_ptr(THD *thd, enum_var_type type, byte *sys_var_key_cache_param::value_ptr(THD *thd, enum_var_type type,
...@@ -1519,23 +1520,20 @@ byte *sys_var_key_cache_param::value_ptr(THD *thd, enum_var_type type, ...@@ -1519,23 +1520,20 @@ byte *sys_var_key_cache_param::value_ptr(THD *thd, enum_var_type type,
return (byte*) key_cache + offset ; return (byte*) key_cache + offset ;
} }
bool sys_var_key_buffer_size::update(THD *thd, set_var *var bool sys_var_key_buffer_size::update(THD *thd, set_var *var)
{
ulonglong tmp= var->value->val_int(); ulonglong tmp= var->value->val_int();
base_name= &default_key_cache_base; LEX_STRING *base_name= &var->base;
if (!base_name->length)
base_name= &default_key_cache_base;
KEY_CACHE_VAR *key_cache= get_key_cache(base_name); KEY_CACHE_VAR *key_cache= get_key_cache(base_name);
}
KEY_CACHE *key_cache= (KEY_CACHE*) find_named(&key_caches, base_name.str,
base_name.length);
if (!key_cache) if (!key_cache)
{ {
if (!tmp) // Tried to delete cache if (!tmp) // Tried to delete cache
return 0; // Ok, nothing to do return 0; // Ok, nothing to do
if (!(key_cache= create_key_cache(base_name->str, if (!(key_cache= create_key_cache(base_name->str,
base_name->length) base_name->length)))
return 1; return 1;
} }
if (!tmp) // Zero size means delete if (!tmp) // Zero size means delete
...@@ -1549,8 +1547,15 @@ bool sys_var_key_buffer_size::update(THD *thd, set_var *var ...@@ -1549,8 +1547,15 @@ bool sys_var_key_buffer_size::update(THD *thd, set_var *var
Move tables using this key cache to the default key cache Move tables using this key cache to the default key cache
and remove this key cache if no tables are assigned to it and remove this key cache if no tables are assigned to it
*/ */
return (reassign_keycache_tables(thd, key_cache, NAMED_LIST *list;
default_key_cache_base.str, 1)); key_cache= (KEY_CACHE_VAR *) find_named(&key_caches, base_name->str,
base_name->length, &list);
delete list;
int rc= reassign_keycache_tables(thd, key_cache,
default_key_cache_base.str, 1);
my_free((char*) key_cache, MYF(0));
return rc;
} }
return 0; return 0;
} }
...@@ -1566,8 +1571,8 @@ bool sys_var_key_buffer_size::update(THD *thd, set_var *var ...@@ -1566,8 +1571,8 @@ bool sys_var_key_buffer_size::update(THD *thd, set_var *var
bool sys_var_key_cache_block_size::update(THD *thd, set_var *var) bool sys_var_key_cache_block_size::update(THD *thd, set_var *var)
{ {
ulong tmp= var->value->val_int(); ulong tmp= var->value->val_int();
LEX_STRING *base_name= &var->base;
if (!base_name.length) if (!base_name->length)
base_name= &default_key_cache_base; base_name= &default_key_cache_base;
KEY_CACHE_VAR *key_cache= get_key_cache(base_name); KEY_CACHE_VAR *key_cache= get_key_cache(base_name);
...@@ -1586,8 +1591,8 @@ bool sys_var_key_cache_block_size::update(THD *thd, set_var *var) ...@@ -1586,8 +1591,8 @@ bool sys_var_key_cache_block_size::update(THD *thd, set_var *var)
bool sys_var_key_cache_division_limit::update(THD *thd, set_var *var) bool sys_var_key_cache_division_limit::update(THD *thd, set_var *var)
{ {
ulong tmp= var->value->val_int(); ulong tmp= var->value->val_int();
LEX_STRING *base_name= &var->base;
if (!base_name.length) if (!base_name->length)
base_name= &default_key_cache_base; base_name= &default_key_cache_base;
KEY_CACHE_VAR *key_cache= get_key_cache(base_name); KEY_CACHE_VAR *key_cache= get_key_cache(base_name);
...@@ -1604,11 +1609,11 @@ bool sys_var_key_cache_division_limit::update(THD *thd, set_var *var) ...@@ -1604,11 +1609,11 @@ bool sys_var_key_cache_division_limit::update(THD *thd, set_var *var)
return 0; return 0;
} }
bool sys_var_key_age_threshold::update(THD *thd, set_var *var) bool sys_var_key_cache_age_threshold::update(THD *thd, set_var *var)
{ {
ulong tmp= var->value->val_int(); ulong tmp= var->value->val_int();
LEX_STRING *base_name= &var->base;
if (!base_name.length) if (!base_name->length)
base_name= &default_key_cache_base; base_name= &default_key_cache_base;
KEY_CACHE_VAR *key_cache= get_key_cache(base_name); KEY_CACHE_VAR *key_cache= get_key_cache(base_name);
...@@ -2195,7 +2200,8 @@ gptr find_named(I_List<NAMED_LIST> *list, const char *name, uint length, ...@@ -2195,7 +2200,8 @@ gptr find_named(I_List<NAMED_LIST> *list, const char *name, uint length,
{ {
if (element->cmp(name, length)) if (element->cmp(name, length))
{ {
*found= element; if (found)
*found= element;
return element->data; return element->data;
} }
} }
......
...@@ -1174,6 +1174,9 @@ TABLE_LIST *st_select_lex_node::add_table_to_list(THD *thd, Table_ident *table, ...@@ -1174,6 +1174,9 @@ TABLE_LIST *st_select_lex_node::add_table_to_list(THD *thd, Table_ident *table,
List<String> *use_index, List<String> *use_index,
List<String> *ignore_index, List<String> *ignore_index,
LEX_STRING *option) LEX_STRING *option)
{
return 0;
}
ulong st_select_lex_node::get_table_join_options() ulong st_select_lex_node::get_table_join_options()
{ {
return 0; return 0;
......
...@@ -437,8 +437,8 @@ class st_select_lex: public st_select_lex_node ...@@ -437,8 +437,8 @@ class st_select_lex: public st_select_lex_node
ulong table_options, ulong table_options,
thr_lock_type flags= TL_UNLOCK, thr_lock_type flags= TL_UNLOCK,
List<String> *use_index= 0, List<String> *use_index= 0,
List<String> *ignore_index= 0); List<String> *ignore_index= 0,
LEX_STRING *option= 0);
TABLE_LIST* get_table_list(); TABLE_LIST* get_table_list();
List<Item>* get_item_list(); List<Item>* get_item_list();
List<String>* get_use_index(); List<String>* get_use_index();
......
...@@ -1946,16 +1946,16 @@ preload_keys: ...@@ -1946,16 +1946,16 @@ preload_keys:
} }
; ;
preload_keys_spec: cache_keys_spec:
keys_or_index { Select->interval_list.empty(); } keys_or_index { Select->interval_list.empty(); }
cache_key_list_or_empty cache_key_list_or_empty
{ {
LEX *lex=Lex; LEX *lex=Lex;
SELECT_LEX *sel= &lex->select_lex; SELECT_LEX *sel= &lex->select_lex;
sel->use_index= sel->interval_list; sel->use_index= sel->interval_list;
sel->use_index_ptr= &sel->use_index; sel->use_index_ptr= &sel->use_index;
} }
; ;
cache_key_list_or_empty: cache_key_list_or_empty:
/* empty */ /* empty */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment