diff options
-rw-r--r-- | Docs/manual.texi | 6 | ||||
-rw-r--r-- | client/mysqldump.c | 10 | ||||
-rw-r--r-- | mysql-test/t/range.test | 62 | ||||
-rw-r--r-- | sql/lock.cc | 7 | ||||
-rw-r--r-- | sql/sql_base.cc | 1 | ||||
-rw-r--r-- | sql/sql_rename.cc | 10 |
6 files changed, 89 insertions, 7 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi index 4955de63ea8..9ec9af45262 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -46897,6 +46897,12 @@ not yet 100% confident in this code. @appendixsubsec Changes in release 3.23.50 @itemize @bullet @item +Fixed bug in @code{RENAME TABLE} when used with +@code{lower_case_table_names=1} (default on Windows). +@item +Fixed unlikely core-dump bug when using @code{DROP TABLE} on a table +that was in use by a thread that also used queries on only temporary tables. +@item Fixed problem with @code{SHOW CREATE TABLE} and @code{PRIMARY KEY} when using 32 indexes. @item diff --git a/client/mysqldump.c b/client/mysqldump.c index a133b2959f2..33f4181266e 100644 --- a/client/mysqldump.c +++ b/client/mysqldump.c @@ -35,7 +35,7 @@ ** and adapted to mysqldump 05/11/01 by Jani Tolonen */ -#define DUMP_VERSION "8.21" +#define DUMP_VERSION "8.22" #include <my_global.h> #include <my_sys.h> @@ -651,7 +651,7 @@ static uint getTableStructure(char *table, char* db) /* Make an sql-file, if path was given iow. option -T was given */ char buff[20+FN_REFLEN]; - sprintf(buff,"show create table %s",table_name); + sprintf(buff,"show create table `%s`",table_name); if (mysql_query(sock, buff)) { fprintf(stderr, "%s: Can't get CREATE TABLE for table '%s' (%s)\n", @@ -1074,6 +1074,9 @@ static void dumpTable(uint numFields, char *table) fputs(insert_pat,md_result_file); mysql_field_seek(res,0); + if (opt_xml) + fprintf(md_result_file, "\t<row>\n"); + for (i = 0; i < mysql_num_fields(res); i++) { if (!(field = mysql_fetch_field(res))) @@ -1163,6 +1166,9 @@ static void dumpTable(uint numFields, char *table) } } + if (opt_xml) + fprintf(md_result_file, "\t</row>\n"); + if (extended_insert) { ulong row_length; diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test index 5dfce3ddcc9..ccb66506efd 100644 --- a/mysql-test/t/range.test +++ b/mysql-test/t/range.test @@ -100,3 +100,65 @@ alter table t1 drop key aString; select * from t1 where aString < "believe in myself" order by aString; select * from t1 where aString > "believe in love" order by aString; drop table t1; + +# +# Problem with binary strings +# + +DROP TABLE IF EXISTS t1; +CREATE TABLE t1 ( + t1ID int(10) unsigned NOT NULL auto_increment, + art char(1) binary NOT NULL default '', + KNR char(5) NOT NULL default '', + RECHNR char(6) NOT NULL default '', + POSNR char(2) NOT NULL default '', + ARTNR char(10) NOT NULL default '', + TEX char(70) NOT NULL default '', + PRIMARY KEY (t1ID), + KEY IdxArt (art), + KEY IdxKnr (KNR), + KEY IdxArtnr (ARTNR) +) TYPE=MyISAM; + +INSERT INTO t1 (art) VALUES ('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'),('j'),('J'), +('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'), +('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'), +('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'), +('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'), +('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'), +('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'), +('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'), +('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'), +('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'), +('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'), +('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'),('j'); +select count(*) from t1 where upper(art) = 'J'; +select count(*) from t1 where art = 'J' or art = 'j'; +select count(*) from t1 where art = 'j' or art = 'J'; +drop table t1; diff --git a/sql/lock.cc b/sql/lock.cc index aa06822e03f..a9054b99186 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -108,6 +108,13 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd,TABLE **tables,uint count) thd->locked=0; break; } + else if (!thd->open_tables) + { + // Only using temporary tables, no need to unlock + thd->some_tables_deleted=0; + thd->locked=0; + break; + } /* some table was altered or deleted. reopen tables marked deleted */ mysql_unlock_tables(thd,sql_lock); diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 656758623bc..985118ee218 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -464,6 +464,7 @@ void close_thread_tables(THD *thd, bool locked) unused_tables=table->next=table->prev=table; } } + thd->some_tables_deleted=0; thd->open_tables=0; /* Free tables to hold down open files */ while (open_cache.records > table_cache_size && unused_tables) diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc index 0f6e2f9fbf3..a6614f3f3f6 100644 --- a/sql/sql_rename.cc +++ b/sql/sql_rename.cc @@ -129,7 +129,7 @@ rename_tables(THD *thd, TABLE_LIST *table_list, bool skip_error) new_table=ren_table->next; sprintf(name,"%s/%s/%s%s",mysql_data_home, - new_table->db,new_table->name, + new_table->db,new_table->real_name, reg_ext); if (!access(name,F_OK)) { @@ -137,7 +137,7 @@ rename_tables(THD *thd, TABLE_LIST *table_list, bool skip_error) return ren_table; // This can't be skipped } sprintf(name,"%s/%s/%s%s",mysql_data_home, - ren_table->db,ren_table->name, + ren_table->db,ren_table->real_name, reg_ext); if ((table_type=get_table_type(name)) == DB_TYPE_UNKNOWN) { @@ -146,11 +146,11 @@ rename_tables(THD *thd, TABLE_LIST *table_list, bool skip_error) return ren_table; } else if (mysql_rename_table(table_type, - ren_table->db, ren_table->name, - new_table->db, new_table->name)) + ren_table->db, ren_table->real_name, + new_table->db, new_table->real_name)) { if (!skip_error) - return ren_table; + DBUG_RETURN(ren_table); } } DBUG_RETURN(0); |