Below is the list of changes that have just been committed into a local
5.0 repository of kgeorge. When kgeorge 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, 2006-09-04 18:45:48+03:00, gkodinov@stripped +5 -0
Merge macbook.gmz:/Users/kgeorge/mysql/work/B21392-4.1-opt
into macbook.gmz:/Users/kgeorge/mysql/work/B21392-5.0-opt
MERGE: 1.1616.2144.182
mysql-test/r/delete.result@stripped, 2006-09-04 18:45:40+03:00, gkodinov@stripped +0 -0
merge 4.1->5.0
MERGE: 1.21.1.1
mysql-test/t/delete.test@stripped, 2006-09-04 18:41:35+03:00, gkodinov@stripped +0 -0
Auto merged
MERGE: 1.19.1.2
sql/mysql_priv.h@stripped, 2006-09-04 18:41:35+03:00, gkodinov@stripped +0 -0
Auto merged
MERGE: 1.186.91.54
sql/sql_parse.cc@stripped, 2006-09-04 18:45:40+03:00, gkodinov@stripped +2 -3
merge 4.1->5.0
MERGE: 1.271.1.215
sql/sql_yacc.yy@stripped, 2006-09-04 18:41:37+03:00, gkodinov@stripped +0 -0
Auto merged
MERGE: 1.203.1.196
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: gkodinov
# Host: macbook.gmz
# Root: /Users/kgeorge/mysql/work/B21392-5.0-opt/RESYNC
--- 1.406/sql/mysql_priv.h 2006-09-04 18:46:05 +03:00
+++ 1.407/sql/mysql_priv.h 2006-09-04 18:46:05 +03:00
@@ -425,6 +425,7 @@ void view_store_options(THD *thd, st_tab
#define TL_OPTION_UPDATING 1
#define TL_OPTION_FORCE_INDEX 2
#define TL_OPTION_IGNORE_LEAVES 4
+#define TL_OPTION_ALIAS 8
/* Some portable defines */
--- 1.564/sql/sql_parse.cc 2006-09-04 18:46:05 +03:00
+++ 1.565/sql/sql_parse.cc 2006-09-04 18:46:05 +03:00
@@ -6085,6 +6085,7 @@ bool add_to_list(THD *thd, SQL_LIST &lis
table_options A set of the following bits:
TL_OPTION_UPDATING Table will be updated
TL_OPTION_FORCE_INDEX Force usage of index
+ TL_OPTION_ALIAS an alias in multi table DELETE
lock_type How table should be locked
use_index List of indexed used in USE INDEX
ignore_index List of indexed used in IGNORE INDEX
@@ -6113,7 +6114,8 @@ TABLE_LIST *st_select_lex::add_table_to_
if (!table)
DBUG_RETURN(0); // End of memory
alias_str= alias ? alias->str : table->table.str;
- if (check_table_name(table->table.str, table->table.length))
+ if (!test(table_options & TL_OPTION_ALIAS) &&
+ check_table_name(table->table.str, table->table.length))
{
my_error(ER_WRONG_TABLE_NAME, MYF(0), table->table.str);
DBUG_RETURN(0);
--- 1.481/sql/sql_yacc.yy 2006-09-04 18:46:05 +03:00
+++ 1.482/sql/sql_yacc.yy 2006-09-04 18:46:05 +03:00
@@ -6319,14 +6319,17 @@ table_wild_one:
ident opt_wild opt_table_alias
{
if (!Select->add_table_to_list(YYTHD, new Table_ident($1), $3,
- TL_OPTION_UPDATING, Lex->lock_option))
+ TL_OPTION_UPDATING |
+ TL_OPTION_ALIAS, Lex->lock_option))
YYABORT;
}
| ident '.' ident opt_wild opt_table_alias
{
if (!Select->add_table_to_list(YYTHD,
new Table_ident(YYTHD, $1, $3, 0),
- $5, TL_OPTION_UPDATING,
+ $5,
+ TL_OPTION_UPDATING |
+ TL_OPTION_ALIAS,
Lex->lock_option))
YYABORT;
}
--- 1.22/mysql-test/t/delete.test 2006-09-04 18:46:05 +03:00
+++ 1.23/mysql-test/t/delete.test 2006-09-04 18:46:05 +03:00
@@ -153,6 +153,16 @@ DELETE FROM t1 WHERE t1.a > 0 ORDER BY t
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
#
--- 1.24/mysql-test/r/delete.result 2006-09-04 18:46:06 +03:00
+++ 1.25/mysql-test/r/delete.result 2006-09-04 18:46:06 +03:00
@@ -172,6 +172,10 @@ a
0
2
DROP TABLE t1;
+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;
CREATE TABLE t1 (a int not null,b int not null);
CREATE TABLE t2 (a int not null, b int not null, primary key (a,b));
CREATE TABLE t3 (a int not null, b int not null, primary key (a,b));
| Thread |
|---|
| • bk commit into 5.0 tree (gkodinov:1.2255) | kgeorge | 4 Sep |