From 06ecf87e15d8e8d7ae24aa23ccead4a2c4bbc78e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Oct 2003 23:37:05 -0700 Subject: [PATCH] Many files: Fix after manual merge mysql-test/r/range.result: Fix after manual merge sql/handler.cc: Fix after manual merge sql/mysql_priv.h: Fix after manual merge sql/opt_range.cc: Fix after manual merge sql/set_var.cc: Fix after manual merge sql/sql_base.cc: Fix after manual merge sql/sql_parse.cc: Fix after manual merge --- mysql-test/r/range.result | 22 +++++++++++----------- sql/handler.cc | 3 ++- sql/mysql_priv.h | 3 +-- sql/opt_range.cc | 8 +++++++- sql/set_var.cc | 3 ++- sql/sql_base.cc | 2 +- sql/sql_parse.cc | 6 ++++-- 7 files changed, 28 insertions(+), 19 deletions(-) diff --git a/mysql-test/r/range.result b/mysql-test/r/range.result index 91b718f9121..db477fc662f 100644 --- a/mysql-test/r/range.result +++ b/mysql-test/r/range.result @@ -215,17 +215,6 @@ select count(*) from t1 where art = 'J'; count(*) 213 drop table t1; -create table t1 ( id1 int not null, id2 int not null, idnull int null, c char(20), primary key (id1,id2)); -insert into t1 values (0,1,NULL,"aaa"), (1,1,NULL,"aaa"), (2,1,NULL,"aaa"), -(3,1,NULL,"aaa"), (4,1,NULL,"aaa"), (5,1,NULL,"aaa"), -(6,1,NULL,"aaa"), (7,1,NULL,"aaa"), (8,1,NULL,"aaa"), -(9,1,NULL,"aaa"), (10,1,NULL,"aaa"), (11,1,NULL,"aaa"), -(12,1,NULL,"aaa"), (13,1,NULL,"aaa"), (14,1,NULL,"aaa"), -(15,1,NULL,"aaa"), (16,1,NULL,"aaa"), (17,1,NULL,"aaa"), -(18,1,NULL,"aaa"), (19,1,NULL,"aaa"), (20,1,NULL,"aaa"); -select a.id1, b.idnull from t1 as a, t1 as b where a.id2=1 and a.id1=1 and b.id1=a.idnull order by b.id2 desc limit 1; -id1 idnull -drop table t1; create table t1 (x int, y int, index(x), index(y)); insert into t1 (x) values (1),(2),(3),(4),(5),(6),(7),(8),(9); update t1 set y=x; @@ -286,6 +275,17 @@ id 5 9 drop table t1; +create table t1 ( id1 int not null, id2 int not null, idnull int null, c char(20), primary key (id1,id2)); +insert into t1 values (0,1,NULL,"aaa"), (1,1,NULL,"aaa"), (2,1,NULL,"aaa"), +(3,1,NULL,"aaa"), (4,1,NULL,"aaa"), (5,1,NULL,"aaa"), +(6,1,NULL,"aaa"), (7,1,NULL,"aaa"), (8,1,NULL,"aaa"), +(9,1,NULL,"aaa"), (10,1,NULL,"aaa"), (11,1,NULL,"aaa"), +(12,1,NULL,"aaa"), (13,1,NULL,"aaa"), (14,1,NULL,"aaa"), +(15,1,NULL,"aaa"), (16,1,NULL,"aaa"), (17,1,NULL,"aaa"), +(18,1,NULL,"aaa"), (19,1,NULL,"aaa"), (20,1,NULL,"aaa"); +select a.id1, b.idnull from t1 as a, t1 as b where a.id2=1 and a.id1=1 and b.id1=a.idnull order by b.id2 desc limit 1; +id1 idnull +drop table t1; create table t1 ( id int not null auto_increment, name char(1) not null, diff --git a/sql/handler.cc b/sql/handler.cc index 1d12171cbd0..1669bfa1f5e 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1135,7 +1135,8 @@ int ha_key_cache(KEY_CACHE_VAR *key_cache) return 0; } - +int ha_resize_key_cache(KEY_CACHE_VAR *key_cache) +{ if (key_cache->cache) { pthread_mutex_lock(&LOCK_global_system_variables); diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 4254d01f903..4bb86a8fac4 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -803,8 +803,7 @@ extern pthread_mutex_t LOCK_mysql_create_db,LOCK_Acl,LOCK_open, LOCK_error_log, LOCK_delayed_insert, LOCK_delayed_status, LOCK_delayed_create, LOCK_crypt, LOCK_timezone, LOCK_slave_list, LOCK_active_mi, LOCK_manager, - LOCK_global_system_variables, LOCK_user_conn; - LOCK_global_system_variables, LOCK_assign; + LOCK_global_system_variables, LOCK_user_conn, LOCK_assign; extern rw_lock_t LOCK_grant; extern pthread_cond_t COND_refresh, COND_thread_count, COND_manager; extern pthread_attr_t connection_attrib; diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 7376c2e24bb..d9a8c822c5f 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -895,6 +895,12 @@ get_mm_parts(PARAM *param, Field *field, Item_func::Functype type, if (field->table != param->table) DBUG_RETURN(0); + if (type == Item_func::NE_FUNC) + { + ne_func= TRUE; + type= Item_func::LT_FUNC; + } + KEY_PART *key_part = param->key_parts; KEY_PART *end = param->key_parts_end; SEL_TREE *tree=0; @@ -934,7 +940,7 @@ get_mm_parts(PARAM *param, Field *field, Item_func::Functype type, SEL_TREE *tree2= get_mm_parts(param, field, Item_func::GT_FUNC, value, cmp_type); if (tree2) - tree= tree=tree_or(param,tree,tree2); + tree= tree_or(param,tree,tree2); } DBUG_RETURN(tree); } diff --git a/sql/set_var.cc b/sql/set_var.cc index f5f0b400793..df2164258d8 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1597,7 +1597,8 @@ void sys_var_collation_server::set_default(THD *thd, enum_var_type type) static LEX_STRING default_key_cache_base= {(char *) DEFAULT_KEY_CACHE_NAME, 7}; -static KEY_CACHE_VAR zero_key_cache= { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +static KEY_CACHE_VAR zero_key_cache= + { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; static KEY_CACHE_VAR *get_key_cache(LEX_STRING *cache_name) { diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 537368943db..2a9262e2646 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -867,7 +867,7 @@ TABLE *open_table(THD *thd,const char *db,const char *table_name, } key_cache_asmt->key_length= key_length; key_cache_asmt->key_cache= &dflt_key_cache_var; - VOID(hash_insert(&assign_cache, (byte *) key_cache_asmt)); + VOID(my_hash_insert(&assign_cache, (byte *) key_cache_asmt)); key_cache_asmt->requests++; } key_cache_asmt->to_reassign= 0; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index b9e9077466b..500f6908b28 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1906,7 +1906,8 @@ mysql_execute_command(THD *thd) case SQLCOM_ASSIGN_TO_KEYCACHE: { if (check_db_used(thd, tables) || - check_access(thd, INDEX_ACL, tables->db, &tables->grant.privilege)) + check_access(thd, INDEX_ACL, tables->db, + &tables->grant.privilege, 0, 0)) goto error; res = mysql_assign_to_keycache(thd, tables); break; @@ -1914,7 +1915,8 @@ mysql_execute_command(THD *thd) case SQLCOM_PRELOAD_KEYS: { if (check_db_used(thd, tables) || - check_access(thd, INDEX_ACL, tables->db, &tables->grant.privilege,0,0)) + check_access(thd, INDEX_ACL, tables->db, + &tables->grant.privilege, 0, 0)) goto error; res = mysql_preload_keys(thd, tables); break;