List:Commits« Previous MessageNext Message »
From:Luis Soares Date:November 2 2010 11:48am
Subject:bzr commit into mysql-5.5-bugteam branch (luis.soares:3108) Bug#57899
View as plain text  
#At file:///home/lsoares/Workspace/bzr/work/bugfixing/57899/mysql-5.5-bugteam/ based on revid:tor.didriksen@stripped

 3108 Luis Soares	2010-11-02
      BUG#57899: Certain reserved words should not be reserved
      
      In MySQL 5.5 the new reserved words include:
      SLOW                    as in FLUSH SLOW LOGS
      GENERAL                 as in FLUSH GENERAL LOGS
      IGNORE_SERVER_IDS       as in CHANGE MASTER ... IGNORE_SERVER_IDS
      MASTER_HEARTBEAT_PERIOD as in CHANGE MASTER ... MASTER_HEARTBEAT_PERIOD
      
      These are not reserved words in standard SQL, or in Oracle 11g,
      and as such, may affect existing applications.
      
      We fix this by adding the new words to the list of 
      keywords that we allow for labels in SPs.
     @ mysql-test/t/keywords.test
        Test case that checks that the target words can be used
        for naming fields in a table or as local routine variable
        names.

    modified:
      mysql-test/r/keywords.result
      mysql-test/t/keywords.test
      sql/sql_yacc.yy
=== modified file 'mysql-test/r/keywords.result'
--- a/mysql-test/r/keywords.result	2007-02-23 11:13:55 +0000
+++ b/mysql-test/r/keywords.result	2010-11-02 11:48:29 +0000
@@ -45,3 +45,22 @@ p1
 max=1
 drop procedure p1;
 drop table t1;
+CREATE TABLE t1 (slow INT, general INT, ignore_server_ids INT, master_heartbeat_period INT);
+INSERT INTO t1 VALUES (1,2,3,4);
+CREATE PROCEDURE p1()
+BEGIN
+DECLARE slow INT;
+DECLARE general INT;
+DECLARE ignore_server_ids INT;
+DECLARE master_heartbeat_period INT;
+SELECT max(t1.slow) INTO slow FROM t1;
+SELECT max(t1.general) INTO general FROM t1;
+SELECT max(t1.ignore_server_ids) INTO ignore_server_ids FROM t1;
+SELECT max(t1.master_heartbeat_period) INTO master_heartbeat_period FROM t1;
+SELECT slow, general, ignore_server_ids, master_heartbeat_period;
+END|
+CALL p1();
+slow	general	ignore_server_ids	master_heartbeat_period
+1	2	3	4
+DROP PROCEDURE p1;
+DROP TABLE t1;

=== modified file 'mysql-test/t/keywords.test'
--- a/mysql-test/t/keywords.test	2007-02-23 11:13:55 +0000
+++ b/mysql-test/t/keywords.test	2010-11-02 11:48:29 +0000
@@ -62,5 +62,31 @@ call p1();
 drop procedure p1;
 drop table t1;
 
-
 # End of 5.0 tests
+
+#
+# BUG#57899: Certain reserved words should not be reserved
+#
+
+CREATE TABLE t1 (slow INT, general INT, ignore_server_ids INT, master_heartbeat_period INT);
+INSERT INTO t1 VALUES (1,2,3,4);
+DELIMITER |;
+CREATE PROCEDURE p1()
+BEGIN
+  DECLARE slow INT;
+  DECLARE general INT;
+  DECLARE ignore_server_ids INT;
+  DECLARE master_heartbeat_period INT;
+
+  SELECT max(t1.slow) INTO slow FROM t1;
+  SELECT max(t1.general) INTO general FROM t1;
+  SELECT max(t1.ignore_server_ids) INTO ignore_server_ids FROM t1;
+  SELECT max(t1.master_heartbeat_period) INTO master_heartbeat_period FROM t1;
+
+  SELECT slow, general, ignore_server_ids, master_heartbeat_period;
+
+END|
+DELIMITER ;|
+CALL p1();
+DROP PROCEDURE p1;
+DROP TABLE t1;

=== modified file 'sql/sql_yacc.yy'
--- a/sql/sql_yacc.yy	2010-10-13 06:27:03 +0000
+++ b/sql/sql_yacc.yy	2010-11-02 11:48:29 +0000
@@ -12497,6 +12497,7 @@ keyword_sp:
         | FILE_SYM                 {}
         | FIRST_SYM                {}
         | FIXED_SYM                {}
+        | GENERAL                  {}
         | GEOMETRY_SYM             {}
         | GEOMETRYCOLLECTION       {}
         | GET_FORMAT               {}
@@ -12506,6 +12507,7 @@ keyword_sp:
         | HOSTS_SYM                {}
         | HOUR_SYM                 {}
         | IDENTIFIED_SYM           {}
+        | IGNORE_SERVER_IDS_SYM    {}
         | INVOKER_SYM              {}
         | IMPORT                   {}
         | INDEXES                  {}
@@ -12528,6 +12530,7 @@ keyword_sp:
         | LOGS_SYM                 {}
         | MAX_ROWS                 {}
         | MASTER_SYM               {}
+        | MASTER_HEARTBEAT_PERIOD_SYM {}
         | MASTER_HOST_SYM          {}
         | MASTER_PORT_SYM          {}
         | MASTER_LOG_FILE_SYM      {}
@@ -12633,6 +12636,7 @@ keyword_sp:
         | SIMPLE_SYM               {}
         | SHARE_SYM                {}
         | SHUTDOWN                 {}
+        | SLOW                     {}
         | SNAPSHOT_SYM             {}
         | SOUNDS_SYM               {}
         | SOURCE_SYM               {}


Attachment: [text/bzr-bundle] bzr/luis.soares@oracle.com-20101102114829-g5c31j7h33hb3k04.bundle
Thread
bzr commit into mysql-5.5-bugteam branch (luis.soares:3108) Bug#57899Luis Soares2 Nov