Skip to content

Commit

Permalink
MDEV-7635: Update tests to adapt to the new default sql_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Nirbhay Choubey committed Feb 5, 2017
1 parent 5c94735 commit e2d94b6
Show file tree
Hide file tree
Showing 520 changed files with 4,415 additions and 3,659 deletions.
2 changes: 1 addition & 1 deletion mysql-test/extra/binlog_tests/binlog.test
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ create table if not exists t3 like tt1;

--disable_warnings
USE mysql;
INSERT INTO user SET host='localhost', user='@#@', password=password('Just a test');
INSERT IGNORE INTO user SET host='localhost', user='@#@', password=password('Just a test');
UPDATE user SET password=password('Another password') WHERE host='localhost' AND user='@#@';
DELETE FROM user WHERE host='localhost' AND user='@#@';
--enable_warnings
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/extra/binlog_tests/ctype_cp932.test
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,9 @@ drop table t2;
#
create table t1 (col1 varchar(1)) character set cp932;
insert into t1 values ('a');
insert into t1 values ('ab');
insert ignore into t1 values ('ab');
select * from t1;
insert into t1 values ('abc');
insert ignore into t1 values ('abc');
select * from t1;
drop table t1;

Expand Down
10 changes: 10 additions & 0 deletions mysql-test/extra/rpl_tests/rpl_binlog_errors.inc
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ RESET MASTER;
### is written to the current binary log.

SET GLOBAL debug_dbug="+d,error_unique_log_filename";

# Disable logging Annotate_rows events to preserve events count.
let $binlog_annotate_row_events_saved= `SELECT @@binlog_annotate_row_events`;
SET @@binlog_annotate_row_events= 0;

SELECT count(*) FROM t4;
-- replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
-- error ER_NO_UNIQUE_LOGFILE
Expand All @@ -210,6 +215,11 @@ if (!$binlog_limit)

# clean up and move to next test
DELETE FROM t4;

--disable_query_log
eval SET @@binlog_annotate_row_events= $binlog_annotate_row_events_saved;
--enable_query_log

RESET MASTER;

-- echo ###################### TEST #8
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/extra/rpl_tests/rpl_checksum_cache.inc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
-- source include/master-slave.inc

--disable_warnings
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement: insert into t2 set data=repeat.*'a', @act_size.*");
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement: insert into t1 values.* NAME_CONST.*'n',.*, @data .*");
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. .*Statement: insert into t2 set data=repeat.*'a', @act_size.*");
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. .*Statement: insert into t1 values.* NAME_CONST.*'n',.*, @data .*");
--enable_warnings

connection master;
Expand Down
8 changes: 4 additions & 4 deletions mysql-test/extra/rpl_tests/rpl_extra_col_master.test
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ some var char';
INSERT into t4 set f1=1, f2=1, f3=1, f4='first', f7='f7: medium size blob', f10='f10:
binary data';
INSERT into t31 set f1=1, f2=1, f3=1, f4='first';
INSERT into t31 set f1=1, f2=1, f3=2, f4='second',
insert ignore into t31 set f1=1, f2=1, f3=2, f4='second',
f9=2.2, f10='seven samurai', f28=222.222, f35='222';
INSERT into t31 values (1, 1, 3, 'third',
insert ignore into t31 values (1, 1, 3, 'third',
/* f5 BIGINT, */ 333333333333333333333333,
/* f6 BLOB, */ '3333333333333333333333',
/* f7 DATE, */ '2007-07-18',
Expand Down Expand Up @@ -289,7 +289,7 @@ binary data';
/*f35 VARCHAR(257),*/ 'three times three'
);

INSERT into t31 values (1, 1, 4, 'fourth',
insert ignore into t31 values (1, 1, 4, 'fourth',
/* f5 BIGINT, */ 333333333333333333333333,
/* f6 BLOB, */ '3333333333333333333333',
/* f7 DATE, */ '2007-07-18',
Expand Down Expand Up @@ -408,7 +408,7 @@ connection master;
update t31 set f5=555555555555555 where f3=6;
update t31 set f2=2 where f3=2;
update t31 set f1=NULL where f3=1;
update t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;
update ignore t31 set f3=NULL, f27=NULL, f35='f35 new value' where f3=3;

--echo
--echo ** Delete from Master **
Expand Down
4 changes: 4 additions & 0 deletions mysql-test/extra/rpl_tests/rpl_gtid_basic.inc
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,13 @@ SELECT IF(LOCATE("2-1-1022", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! ex
--connection server_1
SET gtid_domain_id=2;
SET gtid_seq_no=1030;
# Disable logging Annotate_rows events to preserve events count.
let $binlog_annotate_row_events_saved= `SELECT @@binlog_annotate_row_events`;
SET @@binlog_annotate_row_events= 0;
INSERT INTO t1 VALUES (17);
INSERT INTO t1 VALUES (18);
INSERT INTO t1 VALUES (19);
eval SET @@binlog_annotate_row_events= $binlog_annotate_row_events_saved;
--save_master_pos

--connection server_2
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/extra/rpl_tests/rpl_record_compare.test
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
-- disable_warnings
UPDATE t1 SET c5 = 'a';
UPDATE IGNORE t1 SET c5 = 'a';
-- enable_warnings
-- sync_slave_with_master

Expand All @@ -33,7 +33,7 @@ DROP TABLE t1;
INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
-- disable_warnings
UPDATE t1 SET c5 = 'a';
UPDATE IGNORE t1 SET c5 = 'a';
-- enable_warnings
-- sync_slave_with_master

Expand Down
30 changes: 15 additions & 15 deletions mysql-test/extra/rpl_tests/rpl_row_basic.test
Original file line number Diff line number Diff line change
Expand Up @@ -623,33 +623,33 @@ eval CREATE TABLE t1 (a bit) ENGINE=$type;
INSERT IGNORE INTO t1 VALUES (NULL);
INSERT INTO t1 ( a ) VALUES ( 0 );
UPDATE t1 SET a = 0 WHERE a = 1 LIMIT 3;
INSERT INTO t1 ( a ) VALUES ( 5 );
INSERT IGNORE INTO t1 ( a ) VALUES ( 5 );
DELETE FROM t1 WHERE a < 2 LIMIT 4;
DELETE FROM t1 WHERE a < 9 LIMIT 4;
INSERT INTO t1 ( a ) VALUES ( 9 );
INSERT IGNORE INTO t1 ( a ) VALUES ( 9 );
UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
INSERT INTO t1 ( a ) VALUES ( 8 );
INSERT IGNORE INTO t1 ( a ) VALUES ( 8 );
UPDATE t1 SET a = 0 WHERE a < 6 LIMIT 0;
INSERT INTO t1 ( a ) VALUES ( 4 );
INSERT INTO t1 ( a ) VALUES ( 3 );
INSERT IGNORE INTO t1 ( a ) VALUES ( 4 );
INSERT IGNORE INTO t1 ( a ) VALUES ( 3 );
UPDATE t1 SET a = 0 WHERE a = 7 LIMIT 6;
DELETE FROM t1 WHERE a = 4 LIMIT 7;
UPDATE t1 SET a = 9 WHERE a < 2 LIMIT 9;
UPDATE IGNORE t1 SET a = 9 WHERE a < 2 LIMIT 9;
UPDATE t1 SET a = 0 WHERE a < 9 LIMIT 2;
DELETE FROM t1 WHERE a < 0 LIMIT 5;
INSERT INTO t1 ( a ) VALUES ( 5 );
UPDATE t1 SET a = 4 WHERE a < 6 LIMIT 4;
INSERT INTO t1 ( a ) VALUES ( 5 );
UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 8;
INSERT IGNORE INTO t1 ( a ) VALUES ( 5 );
UPDATE IGNORE t1 SET a = 4 WHERE a < 6 LIMIT 4;
INSERT IGNORE INTO t1 ( a ) VALUES ( 5 );
UPDATE IGNORE t1 SET a = 9 WHERE a < 5 LIMIT 8;
DELETE FROM t1 WHERE a < 8 LIMIT 8;
INSERT INTO t1 ( a ) VALUES ( 6 );
INSERT IGNORE INTO t1 ( a ) VALUES ( 6 );
DELETE FROM t1 WHERE a < 6 LIMIT 7;
UPDATE t1 SET a = 7 WHERE a = 3 LIMIT 7;
UPDATE t1 SET a = 8 WHERE a = 0 LIMIT 6;
INSERT INTO t1 ( a ) VALUES ( 7 );
INSERT IGNORE INTO t1 ( a ) VALUES ( 7 );
DELETE FROM t1 WHERE a < 9 LIMIT 4;
INSERT INTO t1 ( a ) VALUES ( 7 );
INSERT INTO t1 ( a ) VALUES ( 6 );
INSERT IGNORE INTO t1 ( a ) VALUES ( 7 );
INSERT IGNORE INTO t1 ( a ) VALUES ( 6 );
UPDATE t1 SET a = 8 WHERE a = 3 LIMIT 4;
DELETE FROM t1 WHERE a = 2 LIMIT 9;
DELETE FROM t1 WHERE a = 1 LIMIT 4;
Expand All @@ -658,7 +658,7 @@ INSERT INTO t1 ( a ) VALUES ( 0 );
DELETE FROM t1 WHERE a < 3 LIMIT 0;
UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2;
INSERT INTO t1 ( a ) VALUES ( 1 );
UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
UPDATE IGNORE t1 SET a = 9 WHERE a < 5 LIMIT 3;
--enable_warnings

sync_slave_with_master;
Expand Down
4 changes: 3 additions & 1 deletion mysql-test/extra/rpl_tests/rpl_switch_stm_row_mixed.inc
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,14 @@ insert into t1 select "yesterday_24_";
create table t2 ENGINE=MyISAM select rpad(UUID(),100,' ');
create table t3 select 1 union select UUID();
--disable_warnings
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
create table t4 select * from t1 where 3 in (select 1 union select 2 union select UUID() union select 3);
--enable_warnings
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
create table t5 select * from t1 where 3 in (select 1 union select 2 union select curdate() union select 3);
# what if UUID() is first:
--disable_warnings
insert into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
insert ignore into t5 select UUID() from t1 where 3 in (select 1 union select 2 union select 3 union select * from t4);
--enable_warnings

# inside a stored procedure
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/include/add_anonymous_users.inc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Allow anonymous users to connect
disable_warnings;
disable_query_log;
INSERT INTO mysql.user (host, user) VALUES ('localhost','');
INSERT IGNORE INTO mysql.user (host, user) VALUES ('localhost','');
FLUSH PRIVILEGES;
enable_query_log;
enable_warnings;
2 changes: 1 addition & 1 deletion mysql-test/include/commit.inc
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ select * from t2;
insert into t2 (a) values (1026);
--replace_result $MYSQLTEST_VARDIR ..
--error ER_DUP_ENTRY
eval load data infile "../../std_data/words.dat" into table t1 (a) set a:=f2(26);
eval load data infile "../../std_data/words.dat" ignore into table t1 (a) set a:=f2(26);
select * from t2;
rollback;
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/include/ctype_common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ DROP TABLE t1;
# Bug #32726: crash with cast in order by clause and cp932 charset
#
create table t1 (a set('a') not null);
insert into t1 values (),();
insert ignore into t1 values (),();
select cast(a as char(1)) from t1;
select a sounds like a from t1;
select 1 from t1 order by cast(a as char(1));
Expand Down
1 change: 1 addition & 0 deletions mysql-test/include/ctype_numconv.inc
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,7 @@ show create table t1;
drop table t1;

select hex(concat(period_diff(200902, 200802)));
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
create table t1 as select concat(period_add(200902, 200802)) as c1;
show create table t1;
drop table t1;
Expand Down
3 changes: 3 additions & 0 deletions mysql-test/include/ctype_unescape.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
--echo # Start of ctype_unescape.inc

SET sql_mode = '';

#
# Testing how string literals with backslash and quote-quote are unescaped.
# The tests assume that single quote (') is used as a delimiter.
Expand Down Expand Up @@ -323,5 +325,6 @@ DROP FUNCTION wellformedness;
DROP FUNCTION mysql_real_escape_string_generated;
DROP FUNCTION iswellformed;
DROP TABLE allbytes;
SET sql_mode = DEFAULT;

--echo # End of ctype_backslash.inc
Loading

0 comments on commit e2d94b6

Please sign in to comment.