Commit 39b8f92f authored by Alexander Nozdrin's avatar Alexander Nozdrin

Auto-merge from mysql-5.5-merge.

parents f0fe6e4d da9c598a
...@@ -499,4 +499,13 @@ INDEX(a), INDEX(b), INDEX(c)); ...@@ -499,4 +499,13 @@ INDEX(a), INDEX(b), INDEX(c));
INSERT INTO t1 VALUES (1,2,3), (4,5,6), (7,8,9); 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; DELETE FROM t1 WHERE a = 10 OR b = 20 ORDER BY c LIMIT 1;
DROP TABLE t1; 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 End of 5.1 tests
...@@ -4,12 +4,8 @@ reset master; ...@@ -4,12 +4,8 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
# Make sure the 'master_log.err-old' file does not
# exist before execute 'flush error logs' statement.
# Test if support 'flush error logs' statement. # Test if support 'flush error logs' statement.
flush error logs; flush error logs;
# Check the 'master_log.err-old' file is created
# after executed 'flush error logs' statement.
# Make sure binary logs was not be flushed # Make sure binary logs was not be flushed
# after execute 'flush error logs' statement. # after execute 'flush error logs' statement.
# Make sure relay logs was not be flushed # Make sure relay logs was not be flushed
...@@ -42,12 +38,8 @@ flush binary logs; ...@@ -42,12 +38,8 @@ flush binary logs;
# after executed 'flush binary logs' statement. # after executed 'flush binary logs' statement.
# Make sure the 'slave-relay-bin.000007' file does not exist # Make sure the 'slave-relay-bin.000007' file does not exist
# exist before execute 'flush error logs, relay logs' statement. # exist before execute 'flush error logs, relay logs' statement.
# Make sure the 'master_log.err-old' file does not exist
# before execute 'flush error logs, relay logs' statement.
# Test if support to combine all kinds of logs into one statement. # Test if support to combine all kinds of logs into one statement.
flush error logs, relay logs; flush error logs, relay logs;
# Check the 'master_log.err-old' file is created
# after executed 'flush error logs, relay logs' statement.
# Make sure binary logs was not be flushed # Make sure binary logs was not be flushed
# after execute 'flush error logs, relay logs' statement. # after execute 'flush error logs, relay logs' statement.
# Check the 'slave-relay-bin.000007' file is created after # Check the 'slave-relay-bin.000007' file is created after
...@@ -55,12 +47,8 @@ flush error logs, relay logs; ...@@ -55,12 +47,8 @@ flush error logs, relay logs;
# Make sure the 'slave-relay-bin.000008' and 'slave-relay-bin.000009' # Make sure the 'slave-relay-bin.000008' and 'slave-relay-bin.000009'
# files do not exist before execute 'flush error logs, relay logs' # files do not exist before execute 'flush error logs, relay logs'
# statement. # statement.
# Make sure the 'master_log.err-old' file does not exist
# before execute 'flush logs' statement.
# Test if 'flush logs' statement works fine and flush all the logs. # Test if 'flush logs' statement works fine and flush all the logs.
flush logs; flush logs;
# Check the 'master_log.err-old' file is created
# after executed 'flush logs' statement.
# Check 'master-bin.000003' is created # Check 'master-bin.000003' is created
# after execute 'flush logs' statement. # after execute 'flush logs' statement.
# Check the 'slave-relay-bin.000008' and 'slave-relay-bin.000009' # Check the 'slave-relay-bin.000008' and 'slave-relay-bin.000009'
......
...@@ -9,17 +9,10 @@ ...@@ -9,17 +9,10 @@
connection master; connection master;
# Test 'flush error logs' statement. # Test 'flush error logs' statement.
--echo # Make sure the 'master_log.err-old' file does not
--echo # exist before execute 'flush error logs' statement.
--error 1
file_exists $MYSQLTEST_VARDIR/tmp/master_log.err-old;
--echo # Test if support 'flush error logs' statement. --echo # Test if support 'flush error logs' statement.
flush error logs; flush error logs;
--echo # Check the 'master_log.err-old' file is created
--echo # after executed 'flush error logs' statement.
file_exists $MYSQLTEST_VARDIR/tmp/master_log.err-old;
file_exists $MYSQLTEST_VARDIR/tmp/master_log.err; file_exists $MYSQLTEST_VARDIR/tmp/master_log.err;
--echo # Make sure binary logs was not be flushed --echo # Make sure binary logs was not be flushed
...@@ -109,19 +102,10 @@ sync_slave_with_master; ...@@ -109,19 +102,10 @@ sync_slave_with_master;
file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000007; file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000007;
connection master; connection master;
remove_file $MYSQLTEST_VARDIR/tmp/master_log.err-old;
--echo # Make sure the 'master_log.err-old' file does not exist
--echo # before execute 'flush error logs, relay logs' statement.
--error 1
file_exists $MYSQLTEST_VARDIR/tmp/master_log.err-old;
--echo # Test if support to combine all kinds of logs into one statement. --echo # Test if support to combine all kinds of logs into one statement.
flush error logs, relay logs; flush error logs, relay logs;
--echo # Check the 'master_log.err-old' file is created
--echo # after executed 'flush error logs, relay logs' statement.
file_exists $MYSQLTEST_VARDIR/tmp/master_log.err-old;
file_exists $MYSQLTEST_VARDIR/tmp/master_log.err; file_exists $MYSQLTEST_VARDIR/tmp/master_log.err;
--echo # Make sure binary logs was not be flushed --echo # Make sure binary logs was not be flushed
...@@ -145,19 +129,10 @@ file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000008; ...@@ -145,19 +129,10 @@ file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000008;
file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000009; file_exists $MYSQLTEST_VARDIR/mysqld.2/data/slave-relay-bin.000009;
connection master; connection master;
remove_file $MYSQLTEST_VARDIR/tmp/master_log.err-old;
--echo # Make sure the 'master_log.err-old' file does not exist
--echo # before execute 'flush logs' statement.
--error 1
file_exists $MYSQLTEST_VARDIR/tmp/master_log.err-old;
--echo # Test if 'flush logs' statement works fine and flush all the logs. --echo # Test if 'flush logs' statement works fine and flush all the logs.
flush logs; flush logs;
--echo # Check the 'master_log.err-old' file is created
--echo # after executed 'flush logs' statement.
file_exists $MYSQLTEST_VARDIR/tmp/master_log.err-old;
file_exists $MYSQLTEST_VARDIR/tmp/master_log.err; file_exists $MYSQLTEST_VARDIR/tmp/master_log.err;
--echo # Check 'master-bin.000003' is created --echo # Check 'master-bin.000003' is created
......
...@@ -540,4 +540,17 @@ DELETE FROM t1 WHERE a = 10 OR b = 20 ORDER BY c LIMIT 1; ...@@ -540,4 +540,17 @@ DELETE FROM t1 WHERE a = 10 OR b = 20 ORDER BY c LIMIT 1;
DROP TABLE t1; 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 --echo End of 5.1 tests
...@@ -1425,6 +1425,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize); ...@@ -1425,6 +1425,7 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
%type <table> %type <table>
table_ident table_ident_nodb references xid table_ident table_ident_nodb references xid
table_ident_opt_wild
%type <simple_string> %type <simple_string>
remember_name remember_end opt_db text_or_password remember_name remember_end opt_db text_or_password
...@@ -10371,7 +10372,7 @@ table_alias_ref_list: ...@@ -10371,7 +10372,7 @@ table_alias_ref_list:
; ;
table_alias_ref: table_alias_ref:
table_ident table_ident_opt_wild
{ {
if (!Select->add_table_to_list(YYTHD, $1, NULL, if (!Select->add_table_to_list(YYTHD, $1, NULL,
TL_OPTION_UPDATING | TL_OPTION_ALIAS, TL_OPTION_UPDATING | TL_OPTION_ALIAS,
...@@ -12161,6 +12162,21 @@ table_ident: ...@@ -12161,6 +12162,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: table_ident_nodb:
ident ident
{ {
......
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