summaryrefslogtreecommitdiff
path: root/mysql-test/t/delete.test
diff options
context:
space:
mode:
authorunknown <gkodinov/kgeorge@macbook.gmz>2006-09-04 18:40:30 +0300
committerunknown <gkodinov/kgeorge@macbook.gmz>2006-09-04 18:40:30 +0300
commit1431966d029ffd710c678080bee9e1d884205127 (patch)
tree7791cbe549cd4f2437153138cbf3487b0e3257ef /mysql-test/t/delete.test
parent85c064f6b19ee5e596540f7a0d0937b0abb9b3ba (diff)
downloadmariadb-git-1431966d029ffd710c678080bee9e1d884205127.tar.gz
Bug #21392: multi-table delete with alias table name fails with
1003: Incorrect table name in multi-table DELETE the set of tables to delete from actually references then tables in the other list, e.g: DELETE alias_of_t1 FROM t1 alias_of_t1 WHERE .... is a valid statement. So we must turn off table name syntactical validity check for alias_of_t1 because it's not a table name (even if it looks like one). In order to do that we add a special flag (TL_OPTION_ALIAS) to disable the name checking for the aliases in multi-table DELETE. mysql-test/r/delete.result: Bug #21392: multi-table delete with alias table name fails with 1003: Incorrect table name - test case mysql-test/t/delete.test: Bug #21392: multi-table delete with alias table name fails with 1003: Incorrect table name - test case sql/mysql_priv.h: Bug #21392: multi-table delete with alias table name fails with 1003: Incorrect table name - add a special flag to disable the name checking for the aliases in multi-table DELETE sql/sql_parse.cc: Bug #21392: multi-table delete with alias table name fails with 1003: Incorrect table name - add a special flag to disable the name checking for the aliases in multi-table DELETE sql/sql_yacc.yy: Bug #21392: multi-table delete with alias table name fails with 1003: Incorrect table name - add a special flag to disable the name checking for the aliases in multi-table DELETE
Diffstat (limited to 'mysql-test/t/delete.test')
-rw-r--r--mysql-test/t/delete.test10
1 files changed, 10 insertions, 0 deletions
diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test
index 98e4c4e35fa..d4eb01cab23 100644
--- a/mysql-test/t/delete.test
+++ b/mysql-test/t/delete.test
@@ -153,4 +153,14 @@ DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a LIMIT 1;
SELECT * FROM t1;
DROP TABLE t1;
+#
+# Bug #21392: multi-table delete with alias table name fails with
+# 1003: Incorrect table name
+#
+
+create table t1 (a int);
+delete `4.t1` from t1 as `4.t1` where `4.t1`.a = 5;
+delete FROM `4.t1` USING t1 as `4.t1` where `4.t1`.a = 5;
+drop table t1;
+
# End of 4.1 tests