3843 Raghav Kapoor 2012-03-23
BUG#13702397 - 64211: 'CREATE TABLE ... LIKE ...' FAILS TO KEEP CASE
BACKGROUND:
Regular Create Table Statements properly keep the case on
a case insensitive file system like Windows or Mac OS X when
lower_case_table_names= 2 whereas while creating tables LIKE
another (create table <tablename> LIKE <tablename>), the table
name case is ignored on a case insensitive file system when
lower_case_table_names= 2. This problem is mentioned as part
of this bug report. This behaviour was annoying and not
consistent with the documentation.
FIX:
This bug is fixed by populating the alias in local_create_info
structure in mysql_create_like_table function when create table
<tablename> LIKE <tablename> query is issued equal to alias
information that is stored in create_info structure.This
assignment was missing due to which this bug was happening.
Also a testcase has been written in lowercase_table2.test and
the corresponding result file has also been updated.
modified:
mysql-test/r/lowercase_table2.result
mysql-test/t/lowercase_table2.test
sql/sql_table.cc
3842 Tor Didriksen 2012-03-23
Bug#13595996 CREATE A CONSISTENT DEVELOPMENT CMAKE OPTION SET AND MAKE IT A DEFAULT
Add README.
Use 'make' rather than 'gmake' (which is not available on all platforms)
The -j option may be set in the environment anyways.
added:
BUILD/README
modified:
BUILD/compile-pentium
BUILD/compile-pentium-debug
BUILD/compile-pentium-debug-max
BUILD/compile-pentium-debug-max-no-ndb
BUILD/compile-pentium-gcov
BUILD/compile-pentium-gprof
BUILD/compile-pentium-valgrind-max
BUILD/compile-pentium-valgrind-max-no-ndb
BUILD/compile-pentium64
=== modified file 'mysql-test/r/lowercase_table2.result'
--- a/mysql-test/r/lowercase_table2.result 2011-11-28 07:13:03 +0000
+++ b/mysql-test/r/lowercase_table2.result 2012-03-23 09:56:55 +0000
@@ -277,3 +277,16 @@ ERROR HY000: Can't find file: 't_bug4473
flush tables;
create table t_bug44738_UPPERCASE (i int);
drop table t_bug44738_UPPERCASE;
+# BUG#13702397 - 64211: 'CREATE TABLE ... LIKE ...'
+# FAILS TO KEEP CASE
+#
+CREATE TABLE TestTable1 (a int);
+SHOW TABLES;
+Tables_in_test
+TestTable1
+CREATE TABLE TestTable2 LIKE TestTable1;
+SHOW TABLES;
+Tables_in_test
+TestTable1
+TestTable2
+DROP TABLE TestTable1, TestTable2;
=== modified file 'mysql-test/t/lowercase_table2.test'
--- a/mysql-test/t/lowercase_table2.test 2011-04-06 15:11:43 +0000
+++ b/mysql-test/t/lowercase_table2.test 2012-03-23 09:56:55 +0000
@@ -257,3 +257,13 @@ create table t_bug44738_UPPERCASE (i int
flush tables;
create table t_bug44738_UPPERCASE (i int);
drop table t_bug44738_UPPERCASE;
+
+--echo # BUG#13702397 - 64211: 'CREATE TABLE ... LIKE ...'
+--echo # FAILS TO KEEP CASE
+--echo #
+
+CREATE TABLE TestTable1 (a int);
+SHOW TABLES;
+CREATE TABLE TestTable2 LIKE TestTable1;
+SHOW TABLES;
+DROP TABLE TestTable1, TestTable2;
=== modified file 'sql/sql_table.cc'
--- a/sql/sql_table.cc 2012-03-21 14:27:34 +0000
+++ b/sql/sql_table.cc 2012-03-23 09:56:55 +0000
@@ -4934,6 +4934,7 @@ bool mysql_create_like_table(THD* thd, T
the original table. This is documented behavior.
*/
local_create_info.data_file_name= local_create_info.index_file_name= NULL;
+ local_create_info.alias= create_info->alias;
if ((res= mysql_create_table_no_lock(thd, table->db, table->table_name,
&local_create_info, &local_alter_info,
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (raghav.kapoor:3842 to 3843)Bug#13702397 | Raghav Kapoor | 26 Mar |