List:Commits« Previous MessageNext Message »
From:Marc Alff Date:March 8 2012 9:48am
Subject:bzr push into mysql-trunk branch (marc.alff:3730)
View as plain text  
 3730 Marc Alff	2012-03-08 [merge]
      Local merge

    modified:
      sql/mysqld.cc
      sql/rpl_slave.cc
      sql/sql_locale.h
      storage/innobase/srv/srv0srv.cc
=== modified file 'mysql-test/r/parser.result'
--- a/mysql-test/r/parser.result	2011-11-01 11:52:24 +0000
+++ b/mysql-test/r/parser.result	2012-03-08 09:46:41 +0000
@@ -655,3 +655,12 @@ CREATE TABLE t (id INT PRIMARY KEY);
 ALTER TABLE t RENAME TO `t1';;
 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`t1'' at line 1
 DROP TABLE t;
+#
+# Bug#13819100 BROKEN SYNTAX ACCEPTED FOR START SLAVE, STOP SLAVE
+#
+STOP SLAVE ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,' at line 1
+STOP SLAVE ,,,,,,,,,,,,, sql_thread, ,,,,,,,,,,,,,,,,,,, ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ',,,,,,,,,,,, sql_thread, ,,,,,,,,,,,,,,,,,,,' at line 1
+STOP SLAVE ,,,,,,,,,,,,, io_thread, ,,,,,,,,,,,,,,,,,,, ;
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ',,,,,,,,,,,, io_thread, ,,,,,,,,,,,,,,,,,,,' at line 1

=== modified file 'mysql-test/t/parser.test'
--- a/mysql-test/t/parser.test	2011-07-25 10:54:06 +0000
+++ b/mysql-test/t/parser.test	2012-03-08 09:46:41 +0000
@@ -785,3 +785,15 @@ CREATE TABLE t (id INT PRIMARY KEY);
 --error ER_PARSE_ERROR
 --query ALTER TABLE t RENAME TO `t1';
 DROP TABLE t;
+
+--echo #
+--echo # Bug#13819100 BROKEN SYNTAX ACCEPTED FOR START SLAVE, STOP SLAVE
+--echo #
+
+--error ER_PARSE_ERROR
+STOP SLAVE ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ;
+--error ER_PARSE_ERROR
+STOP SLAVE ,,,,,,,,,,,,, sql_thread, ,,,,,,,,,,,,,,,,,,, ;
+--error ER_PARSE_ERROR
+STOP SLAVE ,,,,,,,,,,,,, io_thread, ,,,,,,,,,,,,,,,,,,, ;
+

=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy	2012-03-06 13:05:22 +0000
+++ b/sql/sql_yacc.yy	2012-03-07 16:15:16 +0000
@@ -1861,6 +1861,14 @@ END_OF_INPUT
         '-' '+' '*' '/' '%' '(' ')'
         ',' '!' '{' '}' '&' '|' AND_SYM OR_SYM OR_OR_SYM BETWEEN_SYM CASE_SYM
         THEN_SYM WHEN_SYM DIV_SYM MOD_SYM OR2_SYM AND_AND_SYM DELETE_SYM
+
+/*
+  A bit field of SLAVE_IO, SLAVE_SQL flags.
+*/
+%type <num> opt_slave_thread_option_list
+%type <num> slave_thread_option_list
+%type <num> slave_thread_option
+
 %%
 
 /*
@@ -7339,17 +7347,16 @@ opt_to:
         ;
 
 slave:
-          START_SYM SLAVE slave_thread_opts
+          START_SYM SLAVE opt_slave_thread_option_list
           {
             LEX *lex=Lex;
             lex->sql_command = SQLCOM_SLAVE_START;
             lex->type = 0;
             /* We'll use mi structure for UNTIL options */
             lex->mi.set_unspecified();
-            /* If you change this code don't forget to update SLAVE START too */
+            lex->slave_thd_opt= $3;
           }
           slave_until
-          {}
           slave_connection_opts
           {
             /*
@@ -7367,12 +7374,12 @@ slave:
               MYSQL_YYABORT;
             }
           }
-        | STOP_SYM SLAVE slave_thread_opts
+        | STOP_SYM SLAVE opt_slave_thread_option_list
           {
             LEX *lex=Lex;
             lex->sql_command = SQLCOM_SLAVE_STOP;
             lex->type = 0;
-            /* If you change this code don't forget to update SLAVE STOP too */
+            lex->slave_thd_opt= $3;
           }
         ;
 
@@ -7459,21 +7466,37 @@ slave_plugin_dir_opt:
           }
         ;
 
-slave_thread_opts:
-          { Lex->slave_thd_opt= 0; }
-          slave_thread_opt_list
-          {}
+opt_slave_thread_option_list:
+          /* empty */
+          {
+            $$= 0;
+          }
+        | slave_thread_option_list
+          {
+            $$= $1;
+          }
         ;
 
-slave_thread_opt_list:
-          slave_thread_opt
-        | slave_thread_opt_list ',' slave_thread_opt
+slave_thread_option_list:
+          slave_thread_option
+          {
+            $$= $1;
+          }
+        | slave_thread_option_list ',' slave_thread_option
+          {
+            $$= $1 | $3;
+          }
         ;
 
-slave_thread_opt:
-          /*empty*/ {}
-        | SQL_THREAD   { Lex->slave_thd_opt|=SLAVE_SQL; }
-        | RELAY_THREAD { Lex->slave_thd_opt|=SLAVE_IO; }
+slave_thread_option:
+          SQL_THREAD
+          {
+            $$= SLAVE_SQL;
+          }
+        | RELAY_THREAD
+          {
+            $$= SLAVE_IO;
+          }
         ;
 
 slave_until:

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (marc.alff:3730) Marc Alff8 Mar