summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Shchepa <gshchepa@mysql.com>2010-08-31 02:32:03 +0400
committerGleb Shchepa <gshchepa@mysql.com>2010-08-31 02:32:03 +0400
commit7a343e0c8200b0a230f36b343e4797163c4d03a2 (patch)
treec2185f6e2647cbacedc546b85ff3b70e00c2da65
parent03d0aedd8eef28cae6828dcebd63779f1ecb5d52 (diff)
parent9554b7ac6ef48ea68ce5c8eed34e5dcb21031791 (diff)
downloadmariadb-git-7a343e0c8200b0a230f36b343e4797163c4d03a2.tar.gz
automerge local --> 5.1-bugteam (bug 53034)
-rw-r--r--mysql-test/r/delete.result9
-rw-r--r--mysql-test/t/delete.test13
-rw-r--r--sql/sql_yacc.yy18
3 files changed, 39 insertions, 1 deletions
diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result
index 36025cbfb35..7d6fc30be67 100644
--- a/mysql-test/r/delete.result
+++ b/mysql-test/r/delete.result
@@ -358,4 +358,13 @@ INDEX(a), INDEX(b), INDEX(c));
INSERT INTO t1 VALUES (1,2,3), (4,5,6), (7,8,9);
DELETE FROM t1 WHERE a = 10 OR b = 20 ORDER BY c LIMIT 1;
DROP TABLE t1;
+#
+# Bug #53034: Multiple-table DELETE statements not accepting
+# "Access compatibility" syntax
+#
+CREATE TABLE t1 (id INT);
+CREATE TABLE t2 LIKE t1;
+CREATE TABLE t3 LIKE t1;
+DELETE FROM t1.*, test.t2.*, a.* USING t1, t2, t3 AS a;
+DROP TABLE t1, t2, t3;
End of 5.1 tests
diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test
index 5a0e86568f3..ea5c87babbb 100644
--- a/mysql-test/t/delete.test
+++ b/mysql-test/t/delete.test
@@ -387,4 +387,17 @@ DELETE FROM t1 WHERE a = 10 OR b = 20 ORDER BY c LIMIT 1;
DROP TABLE t1;
+--echo #
+--echo # Bug #53034: Multiple-table DELETE statements not accepting
+--echo # "Access compatibility" syntax
+--echo #
+
+CREATE TABLE t1 (id INT);
+CREATE TABLE t2 LIKE t1;
+CREATE TABLE t3 LIKE t1;
+
+DELETE FROM t1.*, test.t2.*, a.* USING t1, t2, t3 AS a;
+
+DROP TABLE t1, t2, t3;
+
--echo End of 5.1 tests
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index ed367582ba5..aa41a408e5b 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -1297,6 +1297,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%type <table>
table_ident table_ident_nodb references xid
+ table_ident_opt_wild
%type <simple_string>
remember_name remember_end opt_ident opt_db text_or_password
@@ -9622,7 +9623,7 @@ table_alias_ref_list:
;
table_alias_ref:
- table_ident
+ table_ident_opt_wild
{
if (!Select->add_table_to_list(YYTHD, $1, NULL,
TL_OPTION_UPDATING | TL_OPTION_ALIAS,
@@ -11405,6 +11406,21 @@ table_ident:
}
;
+table_ident_opt_wild:
+ ident opt_wild
+ {
+ $$= new Table_ident($1);
+ if ($$ == NULL)
+ MYSQL_YYABORT;
+ }
+ | ident '.' ident opt_wild
+ {
+ $$= new Table_ident(YYTHD, $1,$3,0);
+ if ($$ == NULL)
+ MYSQL_YYABORT;
+ }
+ ;
+
table_ident_nodb:
ident
{