List:Commits« Previous MessageNext Message »
From:Raghav Kapoor Date:October 18 2011 8:59am
Subject:bzr push into mysql-trunk branch (raghav.kapoor:3503 to 3504) Bug#11757503
View as plain text  
 3504 Raghav Kapoor	2011-10-18
      BUG#11757503 - 49556: ERROR 1005 (HY000): CAN'T CREATE TABLE '#SQL-B7C_3' (ERRNO: -1) 
      
      BACKGROUND:
      When altering some tables it is found in the error log of mysqld:
      Found wrong key definition in #sql-1c54_7; Please do
      "ALTER TABLE '#sql-1c54_7' FORCE " to fix it! 
      mysql> ALTER TABLE '#sql-1c54_7' FORCE ;
      ERROR 1064 (42000): You have an error in your SQL syntax; 
      check the manual that corresponds
      Here There should be backticks around the table name.
      mysql>  ALTER TABLE `#sql-1c54_7` FORCE;
      ERROR 1146 (42S02): Table 'test.#sql-1c54_7' doesn't exist
       
      FIX:
      This bug is fixed by putting backticks around %s in the line
      "Please do \"ALTER TABLE '%s' FORCE\" to fix it!",in file 
      sql/table.cc.Also a test case has been added in file
      archive.test and the corresponding result file
      has also been updated.

    modified:
      mysql-test/r/archive.result
      mysql-test/t/archive.test
      sql/table.cc
 3503 kevin.lewis@stripped	2011-10-17
      Cleanup some comments

    modified:
      storage/innobase/include/db0err.h
=== modified file 'mysql-test/r/archive.result'
--- a/mysql-test/r/archive.result	2011-10-06 13:51:28 +0000
+++ b/mysql-test/r/archive.result	2011-10-18 08:57:54 +0000
@@ -12881,3 +12881,18 @@ CHECK TABLE t1;
 Table	Op	Msg_type	Msg_text
 test.t1	check	status	OK
 DROP TABLE t1;
+#
+# BUG 11757503 - 49556: ERROR 1005 (HY000): CAN'T CREATE TABLE '#SQL-B7C_3' (ERRNO: -1)
+#
+DROP TABLE IF EXISTS t1;
+CREATE TABLE t1 (c1 decimal(19,14) NOT NULL) ENGINE=ARCHIVE;
+CALL mtr.add_suppression("Found wrong key definition in #sql.* Please do \"ALTER TABLE `#sql.*` FORCE \" to fix it!");
+CREATE INDEX i1 ON t1(c1);
+ERROR HY000: Can't create table 'test.#sql-temporary' (errno: -1)
+SHOW WARNINGS;
+Level	Code	Message
+Warning	1071	Specified key was too long; max key length is 8 bytes
+Warning	1071	Specified key was too long; max key length is 8 bytes
+Warning	1194	Found wrong key definition in #sql-temporary; Please do "ALTER TABLE `#sql-temporary` FORCE" to fix it!
+Error	1005	Can't create table 'test.#sql-temporary' (errno: -1)
+DROP TABLE t1;

=== modified file 'mysql-test/t/archive.test'
--- a/mysql-test/t/archive.test	2011-10-06 13:51:28 +0000
+++ b/mysql-test/t/archive.test	2011-10-18 08:57:54 +0000
@@ -1771,3 +1771,20 @@ SELECT * FROM t1;
 # Test check table after upgrade
 CHECK TABLE t1;
 DROP TABLE t1;
+
+--echo #
+--echo # BUG 11757503 - 49556: ERROR 1005 (HY000): CAN'T CREATE TABLE '#SQL-B7C_3' (ERRNO: -1)
+--echo #
+
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+CREATE TABLE t1 (c1 decimal(19,14) NOT NULL) ENGINE=ARCHIVE; 
+#Suppressing error message in server error log.
+CALL mtr.add_suppression("Found wrong key definition in #sql.* Please do \"ALTER TABLE `#sql.*` FORCE \" to fix it!");
+--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
+--error ER_CANT_CREATE_TABLE
+CREATE INDEX i1 ON t1(c1);
+--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
+SHOW WARNINGS; 
+DROP TABLE t1;

=== modified file 'sql/table.cc'
--- a/sql/table.cc	2011-10-13 07:54:52 +0000
+++ b/sql/table.cc	2011-10-18 08:57:54 +0000
@@ -1525,13 +1525,13 @@ static int open_binary_frm(THD *thd, TAB
                                                    decimals,
                                                    f_is_dec(pack_flag) == 0);
       sql_print_error("Found incompatible DECIMAL field '%s' in %s; "
-                      "Please do \"ALTER TABLE '%s' FORCE\" to fix it!",
+                      "Please do \"ALTER TABLE `%s` FORCE\" to fix it!",
                       share->fieldnames.type_names[i], share->table_name.str,
                       share->table_name.str);
       push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
                           ER_CRASHED_ON_USAGE,
                           "Found incompatible DECIMAL field '%s' in %s; "
-                          "Please do \"ALTER TABLE '%s' FORCE\" to fix it!",
+                          "Please do \"ALTER TABLE `%s` FORCE\" to fix it!",
                           share->fieldnames.type_names[i],
                           share->table_name.str,
                           share->table_name.str);
@@ -1732,13 +1732,13 @@ static int open_binary_frm(THD *thd, TAB
                                               field->key_length());
             key_part->length= (uint16)field->key_length();
             sql_print_error("Found wrong key definition in %s; "
-                            "Please do \"ALTER TABLE '%s' FORCE \" to fix it!",
+                            "Please do \"ALTER TABLE `%s` FORCE \" to fix it!",
                             share->table_name.str,
                             share->table_name.str);
             push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
                                 ER_CRASHED_ON_USAGE,
                                 "Found wrong key definition in %s; "
-                                "Please do \"ALTER TABLE '%s' FORCE\" to fix "
+                                "Please do \"ALTER TABLE `%s` FORCE\" to fix "
                                 "it!",
                                 share->table_name.str,
                                 share->table_name.str);

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (raghav.kapoor:3503 to 3504) Bug#11757503Raghav Kapoor18 Oct