Commit 0f9d3835 authored by unknown's avatar unknown

Merge mhansson@bk-internal.mysql.com:/home/bk/mysql-5.0-opt

into  dl145s.mysql.com:/data0/mhansson/my50-bug30234


sql/sql_yacc.yy:
  Auto merged
mysql-test/r/delete.result:
  SCCS merged
mysql-test/t/delete.test:
  SCCS merged
parents 6a72267d b4a146a6
...@@ -234,43 +234,6 @@ ERROR 42S22: Unknown column 't2.x' in 'order clause' ...@@ -234,43 +234,6 @@ ERROR 42S22: Unknown column 't2.x' in 'order clause'
DELETE FROM t1 ORDER BY (SELECT x); DELETE FROM t1 ORDER BY (SELECT x);
ERROR 42S22: Unknown column 'x' in 'field list' ERROR 42S22: Unknown column 'x' in 'field list'
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (
a INT
);
CREATE TABLE t2 (
a INT
);
CREATE DATABASE db1;
CREATE TABLE db1.t1 (
a INT
);
INSERT INTO db1.t1 (a) SELECT * FROM t1;
CREATE DATABASE db2;
CREATE TABLE db2.t1 (
a INT
);
INSERT INTO db2.t1 (a) SELECT * FROM t2;
DELETE FROM t1 alias USING t1, t2 alias WHERE t1.a = alias.a;
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 'alias USING t1, t2 alias WHERE t1.a = alias.a' at line 1
DELETE FROM alias USING t1, t2 alias WHERE t1.a = alias.a;
DELETE FROM t1, alias USING t1, t2 alias WHERE t1.a = alias.a;
DELETE FROM t1, t2 USING t1, t2 alias WHERE t1.a = alias.a;
ERROR 42S02: Unknown table 't2' in MULTI DELETE
DELETE FROM db1.t1 alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a;
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 'alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a' at line 1
DELETE FROM alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a;
ERROR 42S02: Unknown table 'alias' in MULTI DELETE
DELETE FROM db2.alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a;
DELETE FROM t1 USING t1 WHERE a = 1;
SELECT * FROM t1;
a
DELETE FROM t1 alias USING t1 alias WHERE a = 2;
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 'alias USING t1 alias WHERE a = 2' at line 1
SELECT * FROM t1;
a
DROP TABLE t1, t2;
DROP DATABASE db1;
DROP DATABASE db2;
CREATE FUNCTION f1() RETURNS INT RETURN 1; CREATE FUNCTION f1() RETURNS INT RETURN 1;
CREATE TABLE t1 (a INT); CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (0); INSERT INTO t1 VALUES (0);
......
...@@ -234,50 +234,6 @@ DELETE FROM t1 ORDER BY (SELECT x); ...@@ -234,50 +234,6 @@ DELETE FROM t1 ORDER BY (SELECT x);
DROP TABLE t1; DROP TABLE t1;
#
# Bug #30234: Unexpected behavior using DELETE with AS and USING
# '
CREATE TABLE t1 (
a INT
);
CREATE TABLE t2 (
a INT
);
CREATE DATABASE db1;
CREATE TABLE db1.t1 (
a INT
);
INSERT INTO db1.t1 (a) SELECT * FROM t1;
CREATE DATABASE db2;
CREATE TABLE db2.t1 (
a INT
);
INSERT INTO db2.t1 (a) SELECT * FROM t2;
--error ER_PARSE_ERROR
DELETE FROM t1 alias USING t1, t2 alias WHERE t1.a = alias.a;
DELETE FROM alias USING t1, t2 alias WHERE t1.a = alias.a;
DELETE FROM t1, alias USING t1, t2 alias WHERE t1.a = alias.a;
--error ER_UNKNOWN_TABLE
DELETE FROM t1, t2 USING t1, t2 alias WHERE t1.a = alias.a;
--error ER_PARSE_ERROR
DELETE FROM db1.t1 alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a;
--error ER_UNKNOWN_TABLE
DELETE FROM alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a;
DELETE FROM db2.alias USING db1.t1, db2.t1 alias WHERE db1.t1.a = alias.a;
DELETE FROM t1 USING t1 WHERE a = 1;
SELECT * FROM t1;
--error ER_PARSE_ERROR
DELETE FROM t1 alias USING t1 alias WHERE a = 2;
SELECT * FROM t1;
DROP TABLE t1, t2;
DROP DATABASE db1;
DROP DATABASE db2;
# #
# Bug 31742: delete from ... order by function call that causes an error, # Bug 31742: delete from ... order by function call that causes an error,
# asserts server # asserts server
......
...@@ -1160,8 +1160,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); ...@@ -1160,8 +1160,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
field_opt_list opt_binary table_lock_list table_lock field_opt_list opt_binary table_lock_list table_lock
ref_list opt_on_delete opt_on_delete_list opt_on_delete_item use ref_list opt_on_delete opt_on_delete_list opt_on_delete_item use
opt_delete_options opt_delete_option varchar nchar nvarchar opt_delete_options opt_delete_option varchar nchar nvarchar
opt_outer table_list table_name table_alias_ref_list table_alias_ref opt_outer table_list table_name opt_option opt_place
opt_option opt_place
opt_attribute opt_attribute_list attribute column_list column_list_id opt_attribute opt_attribute_list attribute column_list column_list_id
opt_column_list grant_privileges grant_ident grant_list grant_option opt_column_list grant_privileges grant_ident grant_list grant_option
object_privilege object_privilege_list user_list rename_list object_privilege object_privilege_list user_list rename_list
...@@ -6483,20 +6482,6 @@ table_name: ...@@ -6483,20 +6482,6 @@ table_name:
} }
; ;
table_alias_ref_list:
table_alias_ref
| table_alias_ref_list ',' table_alias_ref;
table_alias_ref:
table_ident
{
if (!Select->add_table_to_list(YYTHD, $1, NULL,
TL_OPTION_UPDATING | TL_OPTION_ALIAS,
Lex->lock_option ))
MYSQL_YYABORT;
}
;
if_exists: if_exists:
/* empty */ { $$= 0; } /* empty */ { $$= 0; }
| IF EXISTS { $$= 1; } | IF EXISTS { $$= 1; }
...@@ -6767,7 +6752,7 @@ single_multi: ...@@ -6767,7 +6752,7 @@ single_multi:
if (multi_delete_set_locks_and_link_aux_tables(Lex)) if (multi_delete_set_locks_and_link_aux_tables(Lex))
MYSQL_YYABORT; MYSQL_YYABORT;
} }
| FROM table_alias_ref_list | FROM table_wild_list
{ mysql_init_multi_delete(Lex); } { mysql_init_multi_delete(Lex); }
USING join_table_list where_clause USING join_table_list where_clause
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment