Commit b5ebc211 authored by Sergei Golubchik's avatar Sergei Golubchik

sanity

mysql-test/mysql-test-run.pl:
  fix the message
parent 935309be
...@@ -18,26 +18,14 @@ source include/have_innodb.inc; ...@@ -18,26 +18,14 @@ source include/have_innodb.inc;
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
--enable_query_log --enable_query_log
# MTR is not case-sensitive.
let $lower_stmt_head= load data;
let $UPPER_STMT_HEAD= LOAD DATA;
if ($lock_option)
{
#if $lock_option is null, an extra blank is added into the statement,
#this will change the result of rpl_loaddata test case. so $lock_option
#is set only when it is not null.
let $lower_stmt_head= load data $lock_option;
let $UPPER_STMT_HEAD= LOAD DATA $lock_option;
}
select last_insert_id(); select last_insert_id();
create table t1(a int not null auto_increment, b int, primary key(a) ); create table t1(a int not null auto_increment, b int, primary key(a) );
eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1; eval load data $lock_option infile '../../std_data/rpl_loaddata.dat' into table t1;
# verify that LAST_INSERT_ID() is set by LOAD DATA INFILE # verify that LAST_INSERT_ID() is set by LOAD DATA INFILE
select last_insert_id(); select last_insert_id();
create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60)); create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60));
eval $lower_stmt_head infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines; eval load data $lock_option infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60)); create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60));
--disable_warnings --disable_warnings
...@@ -63,7 +51,7 @@ sync_slave_with_master; ...@@ -63,7 +51,7 @@ sync_slave_with_master;
insert into t1 values(1,10); insert into t1 values(1,10);
connection master; connection master;
eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1; eval load data $lock_option infile '../../std_data/rpl_loaddata.dat' into table t1;
save_master_pos; save_master_pos;
connection slave; connection slave;
...@@ -86,7 +74,7 @@ connection master; ...@@ -86,7 +74,7 @@ connection master;
set sql_log_bin=0; set sql_log_bin=0;
delete from t1; delete from t1;
set sql_log_bin=1; set sql_log_bin=1;
eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1; eval load data $lock_option infile '../../std_data/rpl_loaddata.dat' into table t1;
save_master_pos; save_master_pos;
connection slave; connection slave;
# The SQL slave thread should be stopped now. # The SQL slave thread should be stopped now.
...@@ -111,7 +99,7 @@ connection master; ...@@ -111,7 +99,7 @@ connection master;
set sql_log_bin=0; set sql_log_bin=0;
delete from t1; delete from t1;
set sql_log_bin=1; set sql_log_bin=1;
eval $lower_stmt_head infile '../../std_data/rpl_loaddata.dat' into table t1; eval load data $lock_option infile '../../std_data/rpl_loaddata.dat' into table t1;
save_master_pos; save_master_pos;
connection slave; connection slave;
# The SQL slave thread should be stopped now. # The SQL slave thread should be stopped now.
...@@ -131,7 +119,7 @@ reset master; ...@@ -131,7 +119,7 @@ reset master;
eval create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60), eval create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day)) engine=$engine_type; # no transactions unique(day)) engine=$engine_type; # no transactions
--error ER_DUP_ENTRY --error ER_DUP_ENTRY
eval $lower_stmt_head infile '../../std_data/rpl_loaddata2.dat' into table t2 fields eval load data $lock_option infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines; '\n##\n' starting by '>' ignore 1 lines;
select * from t2; select * from t2;
...@@ -147,7 +135,7 @@ alter table t2 drop key day; ...@@ -147,7 +135,7 @@ alter table t2 drop key day;
connection master; connection master;
delete from t2; delete from t2;
--error ER_DUP_ENTRY --error ER_DUP_ENTRY
eval $lower_stmt_head infile '../../std_data/rpl_loaddata2.dat' into table t2 fields eval load data $lock_option infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines; '\n##\n' starting by '>' ignore 1 lines;
connection slave; connection slave;
...@@ -167,7 +155,7 @@ drop table t1, t2; ...@@ -167,7 +155,7 @@ drop table t1, t2;
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB; CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
--error ER_DUP_ENTRY --error ER_DUP_ENTRY
eval $UPPER_STMT_HEAD INFILE "../../std_data/words.dat" INTO TABLE t1; eval LOAD DATA $lock_option INFILE "../../std_data/words.dat" INTO TABLE t1;
DROP TABLE t1; DROP TABLE t1;
...@@ -196,17 +184,17 @@ DROP TABLE t1; ...@@ -196,17 +184,17 @@ DROP TABLE t1;
-- echo ### assertion: works with cross-referenced database -- echo ### assertion: works with cross-referenced database
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- eval $UPPER_STMT_HEAD LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1 -- eval LOAD DATA $lock_option LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
-- eval use $db1 -- eval use $db1
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- echo ### assertion: works with fully qualified name on current database -- echo ### assertion: works with fully qualified name on current database
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- eval $UPPER_STMT_HEAD LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1 -- eval LOAD DATA $lock_option LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
-- echo ### assertion: works without fully qualified name on current database -- echo ### assertion: works without fully qualified name on current database
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- eval $UPPER_STMT_HEAD LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE t1 -- eval LOAD DATA $lock_option LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE t1
-- echo ### create connection without default database -- echo ### create connection without default database
-- echo ### connect (conn2,localhost,root,,*NO-ONE*); -- echo ### connect (conn2,localhost,root,,*NO-ONE*);
...@@ -214,7 +202,7 @@ connect (conn2,localhost,root,,*NO-ONE*); ...@@ -214,7 +202,7 @@ connect (conn2,localhost,root,,*NO-ONE*);
-- connection conn2 -- connection conn2
-- echo ### assertion: works without stating the default database -- echo ### assertion: works without stating the default database
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR -- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- eval $UPPER_STMT_HEAD LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1 -- eval LOAD DATA $lock_option LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE $db1.t1
# We cannot disconnect right away because when inserting # We cannot disconnect right away because when inserting
# concurrently in a MyISAM table, the server is sending an OK # concurrently in a MyISAM table, the server is sending an OK
......
...@@ -5712,7 +5712,7 @@ sub get_extra_opts { ...@@ -5712,7 +5712,7 @@ sub get_extra_opts {
sub stop_servers($$) { sub stop_servers($$) {
my (@servers)= @_; my (@servers)= @_;
mtr_report("Restarting ", started(@servers)); mtr_report("Stopping ", started(@servers));
My::SafeProcess::shutdown($opt_shutdown_timeout, My::SafeProcess::shutdown($opt_shutdown_timeout,
started(@servers)); started(@servers));
......
...@@ -4,12 +4,12 @@ select last_insert_id(); ...@@ -4,12 +4,12 @@ select last_insert_id();
last_insert_id() last_insert_id()
0 0
create table t1(a int not null auto_increment, b int, primary key(a) ); create table t1(a int not null auto_increment, b int, primary key(a) );
load data infile '../../std_data/rpl_loaddata.dat' into table t1; load data infile '../../std_data/rpl_loaddata.dat' into table t1;
select last_insert_id(); select last_insert_id();
last_insert_id() last_insert_id()
1 1
create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60)); create temporary table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60));
load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines; load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by '\n##\n' starting by '>' ignore 1 lines;
create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60)); create table t3 (day date,id int(9),category enum('a','b','c'),name varchar(60));
insert into t3 select * from t2; insert into t3 select * from t2;
select * from t1; select * from t1;
...@@ -26,7 +26,7 @@ drop table t2; ...@@ -26,7 +26,7 @@ drop table t2;
drop table t3; drop table t3;
create table t1(a int, b int, unique(b)); create table t1(a int, b int, unique(b));
insert into t1 values(1,10); insert into t1 values(1,10);
load data infile '../../std_data/rpl_loaddata.dat' into table t1; load data infile '../../std_data/rpl_loaddata.dat' into table t1;
call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* error.* 1062"); call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* error.* 1062");
call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*error.* 0"); call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*error.* 0");
include/wait_for_slave_sql_error_and_skip.inc [errno=1062] include/wait_for_slave_sql_error_and_skip.inc [errno=1062]
...@@ -34,7 +34,7 @@ include/check_slave_no_error.inc ...@@ -34,7 +34,7 @@ include/check_slave_no_error.inc
set sql_log_bin=0; set sql_log_bin=0;
delete from t1; delete from t1;
set sql_log_bin=1; set sql_log_bin=1;
load data infile '../../std_data/rpl_loaddata.dat' into table t1; load data infile '../../std_data/rpl_loaddata.dat' into table t1;
include/wait_for_slave_sql_error.inc [errno=1062] include/wait_for_slave_sql_error.inc [errno=1062]
include/stop_slave_io.inc include/stop_slave_io.inc
change master to master_user='test'; change master to master_user='test';
...@@ -45,7 +45,7 @@ start slave; ...@@ -45,7 +45,7 @@ start slave;
set sql_log_bin=0; set sql_log_bin=0;
delete from t1; delete from t1;
set sql_log_bin=1; set sql_log_bin=1;
load data infile '../../std_data/rpl_loaddata.dat' into table t1; load data infile '../../std_data/rpl_loaddata.dat' into table t1;
include/wait_for_slave_sql_error.inc [errno=1062] include/wait_for_slave_sql_error.inc [errno=1062]
stop slave; stop slave;
reset slave; reset slave;
...@@ -53,7 +53,7 @@ include/check_slave_no_error.inc ...@@ -53,7 +53,7 @@ include/check_slave_no_error.inc
reset master; reset master;
create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60), create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day)) engine=MyISAM; unique(day)) engine=MyISAM;
load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines; '\n##\n' starting by '>' ignore 1 lines;
ERROR 23000: Duplicate entry '2003-03-22' for key 'day' ERROR 23000: Duplicate entry '2003-03-22' for key 'day'
...@@ -68,7 +68,7 @@ day id category name ...@@ -68,7 +68,7 @@ day id category name
2003-03-22 2161 c asdf 2003-03-22 2161 c asdf
alter table t2 drop key day; alter table t2 drop key day;
delete from t2; delete from t2;
load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields load data infile '../../std_data/rpl_loaddata2.dat' into table t2 fields
terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by terminated by ',' optionally enclosed by '%' escaped by '@' lines terminated by
'\n##\n' starting by '>' ignore 1 lines; '\n##\n' starting by '>' ignore 1 lines;
ERROR 23000: Duplicate entry '2003-03-22' for key 'day' ERROR 23000: Duplicate entry '2003-03-22' for key 'day'
...@@ -76,7 +76,7 @@ include/wait_for_slave_sql_error.inc [errno=0] ...@@ -76,7 +76,7 @@ include/wait_for_slave_sql_error.inc [errno=0]
drop table t1, t2; drop table t1, t2;
drop table t1, t2; drop table t1, t2;
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB; CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
LOAD DATA INFILE "../../std_data/words.dat" INTO TABLE t1; LOAD DATA INFILE "../../std_data/words.dat" INTO TABLE t1;
ERROR 23000: Duplicate entry 'Aarhus' for key 'PRIMARY' ERROR 23000: Duplicate entry 'Aarhus' for key 'PRIMARY'
DROP TABLE t1; DROP TABLE t1;
include/rpl_reset.inc include/rpl_reset.inc
...@@ -88,16 +88,16 @@ use b48297_db1; ...@@ -88,16 +88,16 @@ use b48297_db1;
CREATE TABLE t1 (c1 VARCHAR(256)) engine=MyISAM;; CREATE TABLE t1 (c1 VARCHAR(256)) engine=MyISAM;;
use b42897_db2; use b42897_db2;
### assertion: works with cross-referenced database ### assertion: works with cross-referenced database
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE b48297_db1.t1; LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE b48297_db1.t1;
use b48297_db1; use b48297_db1;
### assertion: works with fully qualified name on current database ### assertion: works with fully qualified name on current database
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE b48297_db1.t1; LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE b48297_db1.t1;
### assertion: works without fully qualified name on current database ### assertion: works without fully qualified name on current database
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE t1; LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE t1;
### create connection without default database ### create connection without default database
### connect (conn2,localhost,root,,*NO-ONE*); ### connect (conn2,localhost,root,,*NO-ONE*);
### assertion: works without stating the default database ### assertion: works without stating the default database
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE b48297_db1.t1; LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE b48297_db1.t1;
### disconnect and switch back to master connection ### disconnect and switch back to master connection
use b48297_db1; use b48297_db1;
include/diff_tables.inc [master:b48297_db1.t1, slave:b48297_db1.t1] include/diff_tables.inc [master:b48297_db1.t1, slave:b48297_db1.t1]
......
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