From 8484e6f7598251c50c2439e6b2d26afe6729435a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Jun 2003 11:34:00 +0500 Subject: [PATCH 1/3] mysqldump.c: SET NAMES is not produced in compatibility modes client/mysqldump.c: SET NAMES is not produced in compatibility modes --- client/mysqldump.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/mysqldump.c b/client/mysqldump.c index 18705b9e375..180ac41f87f 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -34,6 +34,7 @@ ** XML by Gary Huntress 10/10/01, cleaned up ** and adapted to mysqldump 05/11/01 by Jani Tolonen ** Added --single-transaction option 06/06/2002 by Peter Zaitsev +** 10 Jun 2003: SET NAMES and --no-set-names by Alexander Barkov */ #define DUMP_VERSION "10.2" @@ -434,6 +435,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), char buff[255]; opt_quoted= 1; + opt_set_names= 1; opt_compatible_mode_str= argument; opt_compatible_mode= find_set(&compatible_mode_typelib, argument, strlen(argument), From 47e0ca90d3c7e76dceae296f03e3701f5619fd2f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Jun 2003 12:07:02 +0500 Subject: [PATCH 2/3] mysqldump.c: SET NAMES is not sent to server when SET NAMES is not dumped Server decides which character set to use in this case client/mysqldump.c: SET NAMES is not sent to server when SET NAMES is not dumped Server decides which character set to use in this case --- client/mysqldump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/mysqldump.c b/client/mysqldump.c index 180ac41f87f..67e83d58768 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -565,7 +565,8 @@ static int dbConnect(char *host, char *user,char *passwd) if (shared_memory_base_name) mysql_options(&mysql_connection,MYSQL_SHARED_MEMORY_BASE_NAME,shared_memory_base_name); #endif - mysql_options(&mysql_connection, MYSQL_SET_CHARSET_NAME, default_charset); + if (!opt_set_names) + mysql_options(&mysql_connection, MYSQL_SET_CHARSET_NAME, default_charset); if (!(sock= mysql_real_connect(&mysql_connection,host,user,passwd, NULL,opt_mysql_port,opt_mysql_unix_port, 0))) From 85be6a0ac822dd0469eb1da9834b477ffa74ae68 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Jun 2003 12:19:28 +0500 Subject: [PATCH 3/3] Bugfix for HEAP table rb-index scan. --- heap/hp_rkey.c | 4 ++-- mysql-test/r/heap_btree.result | 4 ++-- mysql-test/t/heap_btree.test | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/heap/hp_rkey.c b/heap/hp_rkey.c index 91d762ab4db..2c23d9d721e 100644 --- a/heap/hp_rkey.c +++ b/heap/hp_rkey.c @@ -38,7 +38,7 @@ int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key, custom_arg.keyseg= info->s->keydef[inx].seg; custom_arg.key_length= info->lastkey_len= - hp_rb_pack_key(keyinfo, (uchar*) info->recbuf, + hp_rb_pack_key(keyinfo, (uchar*) info->lastkey, (uchar*) key, key_len); custom_arg.search_flag= SEARCH_FIND | SEARCH_SAME; /* for next rkey() after deletion */ @@ -48,7 +48,7 @@ int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key, info->last_find_flag= HA_READ_KEY_OR_PREV; else info->last_find_flag= find_flag; - if (!(pos= tree_search_key(&keyinfo->rb_tree, info->recbuf, info->parents, + if (!(pos= tree_search_key(&keyinfo->rb_tree, info->lastkey, info->parents, &info->last_pos, find_flag, &custom_arg))) { info->update= 0; diff --git a/mysql-test/r/heap_btree.result b/mysql-test/r/heap_btree.result index 6ae00c89a3a..1ba8d429fc4 100644 --- a/mysql-test/r/heap_btree.result +++ b/mysql-test/r/heap_btree.result @@ -24,8 +24,8 @@ a b alter table t1 add c int not null, add key using BTREE (c,a); drop table t1; create table t1 (a int not null,b int not null, primary key using BTREE (a)) type=heap comment="testing heaps"; -insert into t1 values(1,1),(2,2),(3,3),(4,4); -delete from t1 where a > 0; +insert into t1 values(-2,-2),(-1,-1),(0,0),(1,1),(2,2),(3,3),(4,4); +delete from t1 where a > -3; select * from t1; a b drop table t1; diff --git a/mysql-test/t/heap_btree.test b/mysql-test/t/heap_btree.test index 3c2ff249415..80a7753d4b1 100644 --- a/mysql-test/t/heap_btree.test +++ b/mysql-test/t/heap_btree.test @@ -21,8 +21,8 @@ alter table t1 add c int not null, add key using BTREE (c,a); drop table t1; create table t1 (a int not null,b int not null, primary key using BTREE (a)) type=heap comment="testing heaps"; -insert into t1 values(1,1),(2,2),(3,3),(4,4); -delete from t1 where a > 0; +insert into t1 values(-2,-2),(-1,-1),(0,0),(1,1),(2,2),(3,3),(4,4); +delete from t1 where a > -3; select * from t1; drop table t1;