MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Jon Olav Hauglid Date:March 15 2010 2:50pm
Subject:bzr commit into mysql-next-mr-bugfixing branch (jon.hauglid:3128) Bug#31293
View as plain text  
#At file:///export/home/z/mysql-next-mr-bugfixing-bug31110/ based on revid:jon.hauglid@stripped

 3128 Jon Olav Hauglid	2010-03-15
      Backport of:
          ------------------------------------------------------------
          revno: 2617.31.30
          committer: Jon Olav Hauglid <jon.hauglid@stripped>
          branch nick: mysql-6.0-runtime-bugged
          timestamp: Fri 2009-05-08 15:34:08 +0200
          message:
            Bug #31293 create logfile group/tablespace returns OK with warning 
            when engine=myisam
                  
            Bug title slightly misleading. The problem was that syntax 
            errors (1064) were mistakenly generated for the following statements:
            CREATE TABLESPACE
            ALTER TABLESPACE
            DROP TABLESPACE
            CREATE LOGFILE GROUP
            ALTER LOGFILE GROUP
            DROP LOGFILE GROUP
            
            These statments used without any extra clauses gave syntax errors. 
            Adding one or more clauses would remove the syntax error, even if 
            those clauses are all defined as optional. The fix changes the 
            grammar to accept statements without extra clauses so that the 
            above statments give the proper error message used with engine=myisam:
            ERROR 1478 (HY000): Table storage engine 'MyISAM' does not support the 
            create option 'TABLESPACE or LOGFILE GROUP'
            
            Note that the ENGINE clause was optional before this fix even if this
            does not match the current version of the reference manual where it
            is marked as required. The manual should therefore be updated marking
            the ENGINE clause as optional for all statements listed above.
            
            Parser.test appended with a test of various statements that should
            give error 1478 ER_ILLEGAL_HA_CREATE_OPTION, but before gave syntax error.

    modified:
      mysql-test/r/parser.result
      mysql-test/t/parser.test
      sql/sql_yacc.yy
=== modified file 'mysql-test/r/parser.result'
--- a/mysql-test/r/parser.result	2009-12-22 16:23:13 +0000
+++ b/mysql-test/r/parser.result	2010-03-15 14:50:52 +0000
@@ -618,3 +618,36 @@ DROP TABLE t1, t2, t3;
 #
 # End of 5.1 tests
 #
+# Should use myisam
+create logfile group ndb_lg1 add undofile 'ndb_undo1' initial_size=32M;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+create logfile group ndb_lg1 add undofile 'ndb_undo1' engine=myisam;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+create logfile group ndb_lg1 add undofile 'ndb_undo1';
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+create tablespace ndb_ts1 add datafile 'ndb_ts1.dat' use logfile group ndb_lg1 engine=myisam initial_size=32M;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+create tablespace ndb_ts1 add datafile 'ndb_ts1.dat' use logfile group ndb_lg1 engine=myisam;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+create tablespace ndb_ts1 add datafile 'ndb_ts1.dat' use logfile group ndb_lg1;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+alter logfile group ndb_lg1 add undofile 'ndb_undo1' wait;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+alter logfile group ndb_lg1 add undofile 'ndb_undo1' engine=myisam;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+alter logfile group ndb_lg1 add undofile 'ndb_undo1';
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+alter tablespace ndb_ts1 add datafile 'ndb_ts1.dat' initial_size=32M;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+alter tablespace ndb_ts1 add datafile 'ndb_ts1.dat' engine=myisam;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+alter tablespace ndb_ts1 add datafile 'ndb_ts1.dat';
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+drop logfile group ndb_lg1 engine=myisam;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+drop logfile group ndb_lg1;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+drop tablespace ndb_ts1 engine=myisam;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'
+drop tablespace ndb_ts1;
+ERROR HY000: Table storage engine 'MyISAM' does not support the create option 'TABLESPACE or LOGFILE GROUP'

=== modified file 'mysql-test/t/parser.test'
--- a/mysql-test/t/parser.test	2009-12-22 16:23:13 +0000
+++ b/mysql-test/t/parser.test	2010-03-15 14:50:52 +0000
@@ -732,3 +732,47 @@ DROP TABLE t1, t2, t3;
 --echo #
 --echo # End of 5.1 tests
 --echo #
+
+#
+# Bug#31293 - Incorrect parser errors for create/alter/drop logfile group/tablespace
+#
+
+--echo # Should use myisam
+
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+create logfile group ndb_lg1 add undofile 'ndb_undo1' initial_size=32M; 
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+create logfile group ndb_lg1 add undofile 'ndb_undo1' engine=myisam;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+create logfile group ndb_lg1 add undofile 'ndb_undo1';
+
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+create tablespace ndb_ts1 add datafile 'ndb_ts1.dat' use logfile group ndb_lg1 engine=myisam initial_size=32M;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+create tablespace ndb_ts1 add datafile 'ndb_ts1.dat' use logfile group ndb_lg1 engine=myisam;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+create tablespace ndb_ts1 add datafile 'ndb_ts1.dat' use logfile group ndb_lg1;
+
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+alter logfile group ndb_lg1 add undofile 'ndb_undo1' wait;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+alter logfile group ndb_lg1 add undofile 'ndb_undo1' engine=myisam;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+alter logfile group ndb_lg1 add undofile 'ndb_undo1';
+
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+alter tablespace ndb_ts1 add datafile 'ndb_ts1.dat' initial_size=32M;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+alter tablespace ndb_ts1 add datafile 'ndb_ts1.dat' engine=myisam;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+alter tablespace ndb_ts1 add datafile 'ndb_ts1.dat';
+
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+drop logfile group ndb_lg1 engine=myisam;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+drop logfile group ndb_lg1;
+
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+drop tablespace ndb_ts1 engine=myisam;
+-- error ER_ILLEGAL_HA_CREATE_OPTION
+drop tablespace ndb_ts1;

=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy	2010-03-02 14:34:50 +0000
+++ b/sql/sql_yacc.yy	2010-03-15 14:50:52 +0000
@@ -3888,7 +3888,8 @@ change_ts_option:
         ;
 
 tablespace_option_list:
-        tablespace_options
+          /* empty */ 
+        | tablespace_options
         ;
 
 tablespace_options:
@@ -3909,7 +3910,8 @@ tablespace_option:
         ;
 
 alter_tablespace_option_list:
-        alter_tablespace_options
+          /* empty */
+        | alter_tablespace_options
         ;
 
 alter_tablespace_options:
@@ -3927,7 +3929,8 @@ alter_tablespace_option:
         ;
 
 logfile_group_option_list:
-        logfile_group_options
+          /* empty */ 
+        | logfile_group_options
         ;
 
 logfile_group_options:
@@ -3947,7 +3950,8 @@ logfile_group_option:
         ;
 
 alter_logfile_group_option_list:
-          alter_logfile_group_options
+          /* empty */ 
+        | alter_logfile_group_options
         ;
 
 alter_logfile_group_options:
@@ -4117,11 +4121,6 @@ opt_ts_engine:
           }
         ;
 
-opt_ts_wait:
-          /* empty */
-        | ts_wait
-        ;
-
 ts_wait:
           WAIT_SYM
           {
@@ -10196,12 +10195,12 @@ drop:
             lex->drop_if_exists= $3;
             lex->spname= $4;
           }
-        | DROP TABLESPACE tablespace_name opt_ts_engine opt_ts_wait
+        | DROP TABLESPACE tablespace_name drop_ts_options_list
           {
             LEX *lex= Lex;
             lex->alter_tablespace_info->ts_cmd_type= DROP_TABLESPACE;
           }
-        | DROP LOGFILE_SYM GROUP_SYM logfile_group_name opt_ts_engine opt_ts_wait
+        | DROP LOGFILE_SYM GROUP_SYM logfile_group_name drop_ts_options_list
           {
             LEX *lex= Lex;
             lex->alter_tablespace_info->ts_cmd_type= DROP_LOGFILE_GROUP;
@@ -10252,6 +10251,21 @@ opt_temporary:
           /* empty */ { $$= 0; }
         | TEMPORARY { $$= 1; }
         ;
+
+drop_ts_options_list:
+          /* empty */
+        | drop_ts_options
+
+drop_ts_options:
+          drop_ts_option
+        | drop_ts_options drop_ts_option
+        | drop_ts_options_list ',' drop_ts_option
+        ;
+
+drop_ts_option:
+          opt_ts_engine
+      	| ts_wait
+
 /*
 ** Insert : add new data to table
 */


Attachment: [text/bzr-bundle] bzr/jon.hauglid@sun.com-20100315145052-090kbz1blgv16mha.bundle
Thread
bzr commit into mysql-next-mr-bugfixing branch (jon.hauglid:3128) Bug#31293Jon Olav Hauglid15 Mar