Below is the list of changes that have just been committed into a local
6.0 repository of malff. When malff does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2008-03-05 13:45:25-07:00, malff@stripped. +3 -0
Bug#31765 (BACKUP DATABASE broken syntax)
Removed un necessary reduces in the middle of the 'backup' rule.
Removed un necessary reduces in the middle of the 'restore' rule.
Simplifying the grammar improves the code, and performances by making the
parser state automaton smaller.
Fixed the 'database_list' rule to:
- either expand to a '*',
- or expand to a list of database names.
but not mix both, which caused the reported bug.
mysql-test/r/parser.result@stripped, 2008-03-05 13:45:18-07:00, malff@stripped. +4 -0
Bug#31765 (BACKUP DATABASE broken syntax)
mysql-test/t/parser.test@stripped, 2008-03-05 13:45:18-07:00, malff@stripped. +11 -0
Bug#31765 (BACKUP DATABASE broken syntax)
sql/sql_yacc.yy@stripped, 2008-03-05 13:45:18-07:00, malff@stripped. +31 -27
Bug#31765 (BACKUP DATABASE broken syntax)
diff -Nrup a/mysql-test/r/parser.result b/mysql-test/r/parser.result
--- a/mysql-test/r/parser.result 2007-12-19 20:28:04 -07:00
+++ b/mysql-test/r/parser.result 2008-03-05 13:45:18 -07:00
@@ -547,3 +547,7 @@ UPDATE t3 SET a4={d '1789-07-14'} WHERE
SELECT a1, a4 FROM t2 WHERE a4 LIKE {fn UCASE('1789-07-14')};
a1 a4
DROP TABLE t1, t2, t3;
+BACKUP DATABASE *, test to 'broken.bak';
+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 ' test to 'broken.bak'' at line 1
+BACKUP DATABASE *, db1, db2, db3 to 'broken.bak';
+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 ' db1, db2, db3 to 'broken.bak'' at line 1
diff -Nrup a/mysql-test/t/parser.test b/mysql-test/t/parser.test
--- a/mysql-test/t/parser.test 2007-12-19 20:28:04 -07:00
+++ b/mysql-test/t/parser.test 2008-03-05 13:45:18 -07:00
@@ -681,3 +681,14 @@ SELECT {fn CONCAT(a1,a2)} FROM t1;
UPDATE t3 SET a4={d '1789-07-14'} WHERE a1=0;
SELECT a1, a4 FROM t2 WHERE a4 LIKE {fn UCASE('1789-07-14')};
DROP TABLE t1, t2, t3;
+
+#
+# Bug#31765 (BACKUP DATABASE broken syntax)
+#
+
+--error ER_PARSE_ERROR
+BACKUP DATABASE *, test to 'broken.bak';
+
+--error ER_PARSE_ERROR
+BACKUP DATABASE *, db1, db2, db3 to 'broken.bak';
+
diff -Nrup a/sql/sql_yacc.yy b/sql/sql_yacc.yy
--- a/sql/sql_yacc.yy 2008-03-03 04:18:35 -07:00
+++ b/sql/sql_yacc.yy 2008-03-05 13:45:18 -07:00
@@ -6188,61 +6188,65 @@ slave_until_opts:
;
restore:
- RESTORE_SYM
+ RESTORE_SYM
+ FROM
+ TEXT_STRING_sys
{
- if (Lex->sphead)
+ LEX *lex= Lex;
+ if (lex->sphead)
{
my_error(ER_SP_BADSTATEMENT, MYF(0), "RESTORE");
MYSQL_YYABORT;
}
- Lex->sql_command = SQLCOM_RESTORE;
- Lex->db_list.empty();
- }
- FROM TEXT_STRING_sys
- {
- Lex->backup_dir = $4;
+ lex->sql_command = SQLCOM_RESTORE;
+ lex->db_list.empty();
+ lex->backup_dir = $3;
}
;
backup:
- BACKUP_SYM
+ BACKUP_SYM
+ DATABASE
+ database_list
+ TO_SYM
+ TEXT_STRING_sys
{
- if (Lex->sphead)
+ LEX *lex= Lex;
+ if (lex->sphead)
{
my_error(ER_SP_BADSTATEMENT, MYF(0), "BACKUP");
MYSQL_YYABORT;
}
+ lex->sql_command = SQLCOM_BACKUP;
+ lex->backup_dir = $5;
}
- DATABASE
- {
- Lex->sql_command = SQLCOM_BACKUP;
- Lex->db_list.empty();
- }
- database_list TO_SYM TEXT_STRING_sys
- {
- Lex->backup_dir = $7;
- }
- | BACKUP_TEST_SYM
+ | BACKUP_TEST_SYM
+ database_list
{
#ifdef BACKUP_TEST
Lex->sql_command = SQLCOM_BACKUP_TEST;
- Lex->db_list.empty();
#endif
}
- database_list
- { }
;
database_list:
'*'
- {}
- | ident
{
- if (Lex->db_list.push_back((LEX_STRING*)
+ Lex->db_list.empty();
+ }
+ | database_ident_list
+ ;
+
+database_ident_list:
+ ident
+ {
+ LEX *lex= Lex;
+ lex->db_list.empty();
+ if (lex->db_list.push_back((LEX_STRING*)
sql_memdup(&$1, sizeof(LEX_STRING))))
YYABORT;
}
- | database_list ',' ident
+ | database_ident_list ',' ident
{
if (Lex->db_list.push_back((LEX_STRING*)
sql_memdup(&$3, sizeof(LEX_STRING))))