mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
5.3 merge
This commit is contained in:
@ -68,6 +68,38 @@ RPAD(_ucs2 X'0420',10,_ucs2 X'0421') r;
|
||||
SHOW CREATE TABLE t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Bug #51876 : crash/memory underrun when loading data with ucs2
|
||||
--echo # and reverse() function
|
||||
--echo #
|
||||
|
||||
--echo # Problem # 1 (original report): wrong parsing of ucs2 data
|
||||
SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp.txt';
|
||||
CREATE TABLE t1(a INT);
|
||||
LOAD DATA INFILE 'tmpp.txt' INTO TABLE t1 CHARACTER SET ucs2
|
||||
(@b) SET a=REVERSE(@b);
|
||||
--echo # should return 2 zeroes (as the value is truncated)
|
||||
SELECT * FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
remove_file $MYSQLD_DATADIR/test/tmpp.txt;
|
||||
|
||||
|
||||
--echo # Problem # 2 : if you write and read ucs2 data to a file they're lost
|
||||
SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp2.txt' CHARACTER SET ucs2;
|
||||
CREATE TABLE t1(a INT);
|
||||
LOAD DATA INFILE 'tmpp2.txt' INTO TABLE t1 CHARACTER SET ucs2
|
||||
(@b) SET a=REVERSE(@b);
|
||||
--echo # should return 0 and 1 (10 reversed)
|
||||
SELECT * FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
remove_file $MYSQLD_DATADIR/test/tmpp2.txt;
|
||||
|
||||
|
||||
|
||||
#
|
||||
# BUG3946
|
||||
#
|
||||
|
@ -1450,6 +1450,67 @@ INSERT INTO t1 SELECT * FROM ( SELECT * FROM t1 ) AS alias UNION SELECT * FROM t
|
||||
select * from t1;
|
||||
drop table t1,t2;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-3873: Wrong result (extra rows) with NOT IN and
|
||||
--echo # a subquery from a MERGE view
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a INT NOT NULL) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES (4),(7),(0);
|
||||
|
||||
CREATE TABLE t2 (b INT NOT NULL) ENGINE=MyISAM;
|
||||
INSERT INTO t2 VALUES (1),(2);
|
||||
|
||||
CREATE TABLE t3 (c INT NOT NULL) ENGINE=MyISAM;
|
||||
INSERT INTO t3 VALUES (4),(6),(3);
|
||||
|
||||
CREATE TABLE t4 (d INT NOT NULL) ENGINE=MyISAM;
|
||||
INSERT INTO t4 VALUES (4),(5),(3);
|
||||
|
||||
CREATE TABLE tv (e INT NOT NULL) ENGINE=MyISAM;
|
||||
INSERT INTO tv VALUES (1),(3);
|
||||
|
||||
CREATE ALGORITHM=TEMPTABLE VIEW v_temptable AS SELECT * FROM tv;
|
||||
CREATE ALGORITHM=MERGE VIEW v_merge AS SELECT * FROM tv;
|
||||
|
||||
SELECT * FROM t1, t2
|
||||
WHERE a NOT IN ( SELECT e FROM t3 LEFT JOIN v_temptable ON (c = e) WHERE c <> b ) AND a < b;
|
||||
|
||||
SELECT * FROM t1, t2
|
||||
WHERE a NOT IN ( SELECT e FROM t3 LEFT JOIN v_merge ON (c = e) WHERE c <> b ) AND a < b;
|
||||
|
||||
SELECT * FROM t1, t2
|
||||
WHERE a NOT IN ( SELECT e FROM t3 LEFT JOIN (SELECT * FROM tv) as derived ON (c = e) WHERE c <> b ) AND a < b;
|
||||
|
||||
drop view v_temptable, v_merge;
|
||||
drop table t1,t2,t3,t4,tv;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-3912: Wrong result (extra rows) with FROM subquery inside
|
||||
--echo # ALL subquery, LEFT JOIN, derived_merge.
|
||||
--echo # (duplicate of MDEV-3873 (above))
|
||||
--echo #
|
||||
|
||||
SET @save3912_optimizer_switch=@@optimizer_switch;
|
||||
SET optimizer_switch = 'derived_merge=on,in_to_exists=on';
|
||||
|
||||
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES (4),(8);
|
||||
|
||||
CREATE TABLE t2 (b INT) ENGINE=MyISAM;
|
||||
INSERT INTO t2 VALUES (7),(0);
|
||||
|
||||
CREATE TABLE t3 (c INT, d INT NOT NULL) ENGINE=MyISAM;
|
||||
INSERT INTO t3 VALUES (0,4),(8,6);
|
||||
|
||||
SELECT * FROM t1
|
||||
WHERE a >= ALL (
|
||||
SELECT d FROM t2 LEFT JOIN ( SELECT * FROM t3 ) AS alias ON ( c = b )
|
||||
WHERE b >= a
|
||||
);
|
||||
set optimizer_switch=@save3912_optimizer_switch;
|
||||
drop table t1, t2, t3;
|
||||
|
||||
--echo #
|
||||
--echo # end of 5.3 tests
|
||||
--echo #
|
||||
|
1
mysql-test/t/grant_lowercase.opt
Normal file
1
mysql-test/t/grant_lowercase.opt
Normal file
@ -0,0 +1 @@
|
||||
--lower-case-table-names=1
|
31
mysql-test/t/grant_lowercase.test
Normal file
31
mysql-test/t/grant_lowercase.test
Normal file
@ -0,0 +1,31 @@
|
||||
# test cases for strmov(tmp_db, db) -> strnmov replacement in sql_acl.cc
|
||||
--source include/not_embedded.inc
|
||||
|
||||
#
|
||||
# http://seclists.org/fulldisclosure/2012/Dec/4
|
||||
#
|
||||
|
||||
# in acl_get(), check_grant_db(), mysql_grant()
|
||||
grant file on *.* to user1@localhost with grant option;
|
||||
grant select on `a%`.* to user1@localhost with grant option;
|
||||
connect (conn1,localhost,user1,,);
|
||||
connection conn1;
|
||||
--error ER_WRONG_DB_NAME
|
||||
grant file on aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.* to 'user'@'%' identified by 'secret';
|
||||
connection default;
|
||||
disconnect conn1;
|
||||
drop user user1@localhost;
|
||||
|
||||
# in acl_load()
|
||||
call mtr.add_suppression("Incorrect database name");
|
||||
alter table mysql.host modify Db varchar(200);
|
||||
alter table mysql.db modify Db varchar(200);
|
||||
insert mysql.host set db=concat('=>', repeat(_utf8 'й', 200));
|
||||
insert mysql.db set db=concat('=>', repeat(_utf8 'й', 200));
|
||||
flush privileges; # shouldn't crash here
|
||||
delete from mysql.host where db like '=>%';
|
||||
delete from mysql.db where db like '=>%';
|
||||
alter table mysql.host modify Db char(64);
|
||||
alter table mysql.db modify Db char(64);
|
||||
flush privileges;
|
||||
|
@ -1484,6 +1484,41 @@ DROP TABLE t1;
|
||||
--echo the value below *must* be 1
|
||||
show status like 'Created_tmp_disk_tables';
|
||||
|
||||
--echo #
|
||||
--echo # Bug #1002146: Unneeded filesort if usage of join buffer is not allowed
|
||||
--echo # (bug mdev-645)
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (pk int PRIMARY KEY, a int, INDEX idx(a));
|
||||
INSERT INTO t1 VALUES (3,2), (2,3), (5,3), (6,4);
|
||||
|
||||
CREATE TABLE t2 (pk int PRIMARY KEY, a int, INDEX idx(a));
|
||||
INSERT INTO t2 VALUES (9,0), (10,3), (6,4), (1,6), (3,100), (5,200);
|
||||
|
||||
set join_cache_level=0;
|
||||
|
||||
EXPLAIN
|
||||
SELECT t2.a FROM t2 STRAIGHT_JOIN t1 ON t2.a <> 0 WHERE t2.a <> 6
|
||||
GROUP BY t2.a;
|
||||
SELECT t2.a FROM t2 STRAIGHT_JOIN t1 ON t2.a <> 0 WHERE t2.a <> 6
|
||||
GROUP BY t2.a;
|
||||
|
||||
set join_cache_level=default;
|
||||
|
||||
set @save_optimizer_switch=@@optimizer_switch;
|
||||
set optimizer_switch='outer_join_with_cache=off';
|
||||
|
||||
EXPLAIN
|
||||
SELECT t2.a FROM t2 LEFT JOIN t1 ON t2.a <> 0 WHERE t2.a <> 6
|
||||
GROUP BY t2.a;
|
||||
SELECT t2.a FROM t2 LEFT JOIN t1 ON t2.a <> 0 WHERE t2.a <> 6
|
||||
GROUP BY t2.a;
|
||||
|
||||
set optimizer_switch=@save_optimizer_switch;
|
||||
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
--echo # End of 5.3 tests
|
||||
|
||||
--echo #
|
||||
|
@ -572,36 +572,40 @@ DROP TABLE t1;
|
||||
connection default;
|
||||
disconnect con1;
|
||||
|
||||
#############################################################################
|
||||
# The below protion is moved to ctype_ucs.test #
|
||||
#############################################################################
|
||||
#--echo #
|
||||
#--echo # Bug #51876 : crash/memory underrun when loading data with ucs2
|
||||
#--echo # and reverse() function
|
||||
#--echo #
|
||||
|
||||
--echo #
|
||||
--echo # Bug #51876 : crash/memory underrun when loading data with ucs2
|
||||
--echo # and reverse() function
|
||||
--echo #
|
||||
#--echo # Problem # 1 (original report): wrong parsing of ucs2 data
|
||||
#SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp.txt';
|
||||
#CREATE TABLE t1(a INT);
|
||||
#LOAD DATA INFILE 'tmpp.txt' INTO TABLE t1 CHARACTER SET ucs2
|
||||
#(@b) SET a=REVERSE(@b);
|
||||
#--echo # should return 2 zeroes (as the value is truncated)
|
||||
#SELECT * FROM t1;
|
||||
|
||||
--echo # Problem # 1 (original report): wrong parsing of ucs2 data
|
||||
SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp.txt';
|
||||
CREATE TABLE t1(a INT);
|
||||
LOAD DATA INFILE 'tmpp.txt' INTO TABLE t1 CHARACTER SET ucs2
|
||||
(@b) SET a=REVERSE(@b);
|
||||
--echo # should return 2 zeroes (as the value is truncated)
|
||||
SELECT * FROM t1;
|
||||
|
||||
DROP TABLE t1;
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
remove_file $MYSQLD_DATADIR/test/tmpp.txt;
|
||||
#DROP TABLE t1;
|
||||
#let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
#remove_file $MYSQLD_DATADIR/test/tmpp.txt;
|
||||
|
||||
|
||||
--echo # Problem # 2 : if you write and read ucs2 data to a file they're lost
|
||||
SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp2.txt' CHARACTER SET ucs2;
|
||||
CREATE TABLE t1(a INT);
|
||||
LOAD DATA INFILE 'tmpp2.txt' INTO TABLE t1 CHARACTER SET ucs2
|
||||
(@b) SET a=REVERSE(@b);
|
||||
--echo # should return 0 and 1 (10 reversed)
|
||||
SELECT * FROM t1;
|
||||
#--echo # Problem # 2 : if you write and read ucs2 data to a file they're lost
|
||||
#SELECT '00' UNION SELECT '10' INTO OUTFILE 'tmpp2.txt' CHARACTER SET ucs2;
|
||||
#CREATE TABLE t1(a INT);
|
||||
#LOAD DATA INFILE 'tmpp2.txt' INTO TABLE t1 CHARACTER SET ucs2
|
||||
#(@b) SET a=REVERSE(@b);
|
||||
#--echo # should return 0 and 1 (10 reversed)
|
||||
#SELECT * FROM t1;
|
||||
|
||||
#DROP TABLE t1;
|
||||
#let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
#remove_file $MYSQLD_DATADIR/test/tmpp2.txt;
|
||||
######################################################################################
|
||||
|
||||
DROP TABLE t1;
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
remove_file $MYSQLD_DATADIR/test/tmpp2.txt;
|
||||
|
||||
--echo #
|
||||
--echo # Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS AND WRITES WITH U
|
||||
|
@ -582,5 +582,17 @@ DROP DATABASE connected_db;
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/one_db_1.sql
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/one_db_2.sql
|
||||
|
||||
#
|
||||
# USE and names with backticks
|
||||
#
|
||||
--write_file $MYSQLTEST_VARDIR/tmp/backticks.sql
|
||||
USE aa`bb``cc
|
||||
SELECT DATABASE();
|
||||
EOF
|
||||
create database `aa``bb````cc`;
|
||||
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/backticks.sql
|
||||
drop database `aa``bb````cc`;
|
||||
|
||||
|
||||
--echo
|
||||
--echo End of tests
|
||||
|
@ -1 +0,0 @@
|
||||
--max-binlog-size=8192
|
@ -1,26 +0,0 @@
|
||||
# disabled in embedded until tools running is fixed with embedded
|
||||
--source include/not_embedded.inc
|
||||
|
||||
-- source include/have_binlog_format_mixed_or_statement.inc
|
||||
-- source include/have_cp932.inc
|
||||
-- source include/have_log_bin.inc
|
||||
|
||||
RESET MASTER;
|
||||
|
||||
# Bug#16217 (mysql client did not know how not switch its internal charset)
|
||||
create table t3 (f text character set utf8);
|
||||
create table t4 (f text character set cp932);
|
||||
--exec $MYSQL --default-character-set=utf8 test -e "insert into t3 values(_utf8'ソ')"
|
||||
--exec $MYSQL --default-character-set=cp932 test -e "insert into t4 values(_cp932'<27>\');"
|
||||
flush logs;
|
||||
rename table t3 to t03, t4 to t04;
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000001 | $MYSQL --default-character-set=utf8
|
||||
# original and recovered data must be equal
|
||||
select HEX(f) from t03;
|
||||
select HEX(f) from t3;
|
||||
select HEX(f) from t04;
|
||||
select HEX(f) from t4;
|
||||
|
||||
drop table t3, t4, t03, t04;
|
||||
--echo End of 5.0 tests
|
@ -1 +0,0 @@
|
||||
--timezone=GMT-3
|
@ -1,187 +0,0 @@
|
||||
# Test for the new options --start-datetime, stop-datetime,
|
||||
# and a few others.
|
||||
|
||||
# TODO: Need to look at making row based version once new binlog client is complete.
|
||||
-- source include/have_binlog_format_mixed_or_statement.inc
|
||||
-- source include/binlog_start_pos.inc
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t1;
|
||||
--enable_warnings
|
||||
reset master;
|
||||
|
||||
# We need this for getting fixed timestamps inside of this test.
|
||||
# I use a date in the future to keep a growing timestamp along the
|
||||
# binlog (including the Start_log_event). This test will work
|
||||
# unchanged everywhere, because mysql-test-run has fixed TZ, which it
|
||||
# exports (so mysqlbinlog has same fixed TZ).
|
||||
set @a=UNIX_TIMESTAMP("2020-01-21 15:32:22");
|
||||
set timestamp=@a;
|
||||
create table t1 (a int auto_increment not null primary key, b char(3));
|
||||
insert into t1 values(null, "a");
|
||||
insert into t1 values(null, "b");
|
||||
set timestamp=@a+2;
|
||||
--let $binlog_pos_760=query_get_value(SHOW MASTER STATUS, Position, 1)
|
||||
insert into t1 values(null, "c");
|
||||
--let $binlog_pos_951=query_get_value(SHOW BINLOG EVENTS in 'master-bin.000001' from $binlog_pos_760, Pos, 4)
|
||||
set timestamp=@a+4;
|
||||
insert into t1 values(null, "d");
|
||||
insert into t1 values(null, "e");
|
||||
|
||||
flush logs;
|
||||
set timestamp=@a+1; # this could happen on a slave
|
||||
insert into t1 values(null, "f");
|
||||
--let $binlog_pos_135=query_get_value(SHOW BINLOG EVENTS in 'master-bin.000002', Pos, 3)
|
||||
--let $binlog_pos_203=query_get_value(SHOW BINLOG EVENTS in 'master-bin.000002', Pos, 4)
|
||||
|
||||
# delimiters are for easier debugging in future
|
||||
|
||||
--disable_query_log
|
||||
select "--- Local --" as "";
|
||||
--enable_query_log
|
||||
|
||||
#
|
||||
# We should use --short-form everywhere because in other case output will
|
||||
# be time dependent (the Start events). Better than nothing.
|
||||
#
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--exec $MYSQL_BINLOG --short-form --base64-output=never $MYSQLD_DATADIR/master-bin.000001
|
||||
|
||||
--disable_query_log
|
||||
select "--- offset --" as "";
|
||||
--enable_query_log
|
||||
--exec $MYSQL_BINLOG --short-form --offset=2 $MYSQLD_DATADIR/master-bin.000001
|
||||
--disable_query_log
|
||||
select "--- start-position --" as "";
|
||||
--enable_query_log
|
||||
let $start_pos= `select @binlog_start_pos + 653`;
|
||||
--exec $MYSQL_BINLOG --short-form --start-position=$start_pos $MYSQLD_DATADIR/master-bin.000001
|
||||
--disable_query_log
|
||||
select "--- stop-position --" as "";
|
||||
--enable_query_log
|
||||
let $stop_pos= `select @binlog_start_pos + 653`;
|
||||
--exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos $MYSQLD_DATADIR/master-bin.000001
|
||||
--disable_query_log
|
||||
select "--- start and stop positions ---" as "";
|
||||
--enable_query_log
|
||||
let $start_pos= `select @binlog_start_pos + 653`;
|
||||
let $stop_pos= `select @binlog_start_pos + 770`;
|
||||
--exec $MYSQL_BINLOG --short-form --start-position=$start_pos --stop-position=$stop_pos $MYSQLD_DATADIR/master-bin.000001
|
||||
--disable_query_log
|
||||
select "--- start-datetime --" as "";
|
||||
--enable_query_log
|
||||
--exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQLD_DATADIR/master-bin.000001
|
||||
--disable_query_log
|
||||
select "--- stop-datetime --" as "";
|
||||
--enable_query_log
|
||||
--exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQLD_DATADIR/master-bin.000001
|
||||
|
||||
--disable_query_log
|
||||
select "--- Local with 2 binlogs on command line --" as "";
|
||||
--enable_query_log
|
||||
|
||||
# This is to verify that some options apply only to first, or last binlog
|
||||
|
||||
flush logs;
|
||||
--exec $MYSQL_BINLOG --short-form $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
|
||||
|
||||
--disable_query_log
|
||||
select "--- offset --" as "";
|
||||
--enable_query_log
|
||||
--exec $MYSQL_BINLOG --short-form --offset=2 $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
|
||||
--disable_query_log
|
||||
select "--- start-position --" as "";
|
||||
--enable_query_log
|
||||
let $start_pos= `select @binlog_start_pos + 653`;
|
||||
--exec $MYSQL_BINLOG --short-form --start-position=$start_pos $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
|
||||
--disable_query_log
|
||||
select "--- stop-position --" as "";
|
||||
--enable_query_log
|
||||
let $stop_pos= `select @binlog_start_pos + 69`;
|
||||
--exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
|
||||
--disable_query_log
|
||||
select "--- start-datetime --" as "";
|
||||
--enable_query_log
|
||||
--exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
|
||||
--disable_query_log
|
||||
select "--- stop-datetime --" as "";
|
||||
--enable_query_log
|
||||
--exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" $MYSQLD_DATADIR/master-bin.000001 $MYSQLD_DATADIR/master-bin.000002
|
||||
|
||||
--disable_query_log
|
||||
select "--- Remote --" as "";
|
||||
--enable_query_log
|
||||
|
||||
--exec $MYSQL_BINLOG --short-form --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
|
||||
|
||||
--disable_query_log
|
||||
select "--- offset --" as "";
|
||||
--enable_query_log
|
||||
--exec $MYSQL_BINLOG --short-form --offset=2 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
|
||||
--disable_query_log
|
||||
select "--- start-position --" as "";
|
||||
--enable_query_log
|
||||
let $start_pos= `select @binlog_start_pos + 653`;
|
||||
--exec $MYSQL_BINLOG --short-form --start-position=$start_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
|
||||
--disable_query_log
|
||||
select "--- stop-position --" as "";
|
||||
--enable_query_log
|
||||
let $stop_pos= `select @binlog_start_pos + 653`;
|
||||
--exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
|
||||
--disable_query_log
|
||||
select "--- start and stop positions ---" as "";
|
||||
--enable_query_log
|
||||
let $start_pos= `select @binlog_start_pos + 653`;
|
||||
let $stop_pos= `select @binlog_start_pos + 770`;
|
||||
--exec $MYSQL_BINLOG --short-form --start-position=$start_pos --stop-position $stop_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
|
||||
--disable_query_log
|
||||
select "--- start-datetime --" as "";
|
||||
--enable_query_log
|
||||
--exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
|
||||
--disable_query_log
|
||||
select "--- stop-datetime --" as "";
|
||||
--enable_query_log
|
||||
--exec $MYSQL_BINLOG --short-form "--stop-datetime=2020-01-21 15:32:24" --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
|
||||
|
||||
--disable_query_log
|
||||
select "--- Remote with 2 binlogs on command line --" as "";
|
||||
--enable_query_log
|
||||
|
||||
--exec $MYSQL_BINLOG --short-form --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
|
||||
|
||||
--disable_query_log
|
||||
select "--- offset --" as "";
|
||||
--enable_query_log
|
||||
--exec $MYSQL_BINLOG --short-form --offset=2 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
|
||||
--disable_query_log
|
||||
select "--- start-position --" as "";
|
||||
--enable_query_log
|
||||
let $start_pos= `select @binlog_start_pos + 653`;
|
||||
--exec $MYSQL_BINLOG --short-form --start-position=$start_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
|
||||
--disable_query_log
|
||||
select "--- stop-position --" as "";
|
||||
--enable_query_log
|
||||
let $stop_pos= `select @binlog_start_pos + 28`;
|
||||
--exec $MYSQL_BINLOG --short-form --stop-position=$stop_pos --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
|
||||
--disable_query_log
|
||||
select "--- start-datetime --" as "";
|
||||
--enable_query_log
|
||||
--exec $MYSQL_BINLOG --short-form "--start-datetime=20200121153224" --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
|
||||
--disable_query_log
|
||||
select "--- stop-datetime --" as "";
|
||||
--enable_query_log
|
||||
--exec $MYSQL_BINLOG --short-form "--stop-datetime=2020/01/21 15@32@24" --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 master-bin.000002
|
||||
|
||||
--disable_query_log
|
||||
select "--- to-last-log --" as "";
|
||||
--enable_query_log
|
||||
|
||||
--exec $MYSQL_BINLOG --short-form --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT --to-last-log master-bin.000001
|
||||
|
||||
# clean up
|
||||
--disable_query_log
|
||||
select "--- end of test --" as "";
|
||||
--enable_query_log
|
||||
drop table t1;
|
||||
|
||||
# End of 4.1 tests
|
@ -1,102 +0,0 @@
|
||||
-- source include/have_binlog_format_row.inc
|
||||
#
|
||||
# Reset master to cleanup binlog
|
||||
#
|
||||
reset master;
|
||||
|
||||
#
|
||||
# Write different events to binlog
|
||||
#
|
||||
create table t1 (a int);
|
||||
insert into t1 values (1);
|
||||
insert into t1 values (2);
|
||||
insert into t1 values (3);
|
||||
update t1 set a=a+2 where a=2;
|
||||
update t1 set a=a+2 where a=3;
|
||||
|
||||
create table t2 (word varchar(20));
|
||||
load data infile '../../std_data/words.dat' into table t2;
|
||||
|
||||
#
|
||||
# Save binlog
|
||||
#
|
||||
let $MYSQLD_DATADIR=`select @@datadir`;
|
||||
flush logs;
|
||||
--exec $MYSQL_BINLOG --hexdump $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
|
||||
|
||||
#
|
||||
# Clear database and restore from binlog
|
||||
#
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
|
||||
|
||||
#
|
||||
# Verify that all binlog events have been executed
|
||||
#
|
||||
select * from t1;
|
||||
select * from t2;
|
||||
|
||||
#
|
||||
# Verify that events larger than the default IO_CACHE buffer
|
||||
# are handled correctly (BUG#25628).
|
||||
#
|
||||
flush logs;
|
||||
drop table t2;
|
||||
create table t2 (word varchar(20));
|
||||
load data infile '../../std_data/words.dat' into table t2;
|
||||
insert into t2 select * from t2;
|
||||
insert into t2 select * from t2;
|
||||
insert into t2 select * from t2;
|
||||
insert into t2 select * from t2;
|
||||
insert into t2 select * from t2;
|
||||
insert into t2 select * from t2;
|
||||
insert into t2 select * from t2;
|
||||
insert into t2 select * from t2;
|
||||
insert into t2 select * from t2;
|
||||
select count(*) from t2;
|
||||
|
||||
flush logs;
|
||||
--exec $MYSQL_BINLOG --hexdump $MYSQLD_DATADIR/master-bin.000003 > $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
|
||||
--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
|
||||
|
||||
#
|
||||
# Verify that all binlog events have been executed
|
||||
#
|
||||
select count(*) from t2;
|
||||
|
||||
#
|
||||
# Test cleanup
|
||||
#
|
||||
--remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog_base64.sql
|
||||
drop table t1;
|
||||
drop table t2;
|
||||
|
||||
#
|
||||
# BUG#12354268
|
||||
#
|
||||
# This test verifies that using --start-position with DECODE-ROWS
|
||||
# does not make mysqlbinlog to output an error stating that it
|
||||
# does not contain any FD event.
|
||||
#
|
||||
|
||||
RESET MASTER;
|
||||
USE test;
|
||||
SET @old_binlog_format= @@binlog_format;
|
||||
SET SESSION binlog_format=ROW;
|
||||
CREATE TABLE t1(c1 INT);
|
||||
--let $master_binlog= query_get_value(SHOW MASTER STATUS, File, 1)
|
||||
--let $master_pos= query_get_value(SHOW MASTER STATUS, Position, 1)
|
||||
--let $MYSQLD_DATADIR= `SELECT @@datadir`
|
||||
|
||||
INSERT INTO t1 VALUES (1);
|
||||
|
||||
FLUSH LOGS;
|
||||
|
||||
--disable_result_log
|
||||
--exec $MYSQL_BINLOG --base64-output=DECODE-ROWS --start-position=$master_pos -v $MYSQLD_DATADIR/$master_binlog
|
||||
--enable_result_log
|
||||
|
||||
DROP TABLE t1;
|
||||
SET SESSION binlog_format= @old_binlog_format;
|
||||
RESET MASTER;
|
@ -1 +0,0 @@
|
||||
--timezone=GMT-3
|
@ -1,446 +0,0 @@
|
||||
--source include/have_log_bin.inc
|
||||
--source include/have_binlog_format_row.inc
|
||||
--source include/have_ucs2.inc
|
||||
|
||||
--echo #
|
||||
--echo # Preparatory cleanup.
|
||||
--echo #
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
--echo #
|
||||
--echo # We need a fixed timestamp to avoid varying results.
|
||||
--echo #
|
||||
SET timestamp=1000000000;
|
||||
|
||||
--echo #
|
||||
--echo # Delete all existing binary logs.
|
||||
--echo #
|
||||
RESET MASTER;
|
||||
|
||||
|
||||
CREATE TABLE t1 (c01 BIT);
|
||||
INSERT INTO t1 VALUES (0);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c01 BIT(7));
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 VALUES (2);
|
||||
INSERT INTO t1 VALUES (4);
|
||||
INSERT INTO t1 VALUES (8);
|
||||
INSERT INTO t1 VALUES (16);
|
||||
INSERT INTO t1 VALUES (32);
|
||||
INSERT INTO t1 VALUES (64);
|
||||
INSERT INTO t1 VALUES (127);
|
||||
DELETE FROM t1 WHERE c01=127;
|
||||
UPDATE t1 SET c01=15 WHERE c01=16;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (a BIT(20), b CHAR(2));
|
||||
INSERT INTO t1 VALUES (b'00010010010010001001', 'ab');
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c02 BIT(64));
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t1 VALUES (2);
|
||||
INSERT INTO t1 VALUES (128);
|
||||
INSERT INTO t1 VALUES (b'1111111111111111111111111111111111111111111111111111111111111111');
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
CREATE TABLE t1 (c03 TINYINT);
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
INSERT INTO t1 VALUES (-128);
|
||||
UPDATE t1 SET c03=2 WHERE c03=1;
|
||||
DELETE FROM t1 WHERE c03=-128;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c04 TINYINT UNSIGNED);
|
||||
INSERT INTO t1 VALUES (128), (255);
|
||||
UPDATE t1 SET c04=2 WHERE c04=1;
|
||||
DELETE FROM t1 WHERE c04=255;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c06 BOOL);
|
||||
INSERT INTO t1 VALUES (TRUE);
|
||||
DELETE FROM t1 WHERE c06=TRUE;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c07 SMALLINT);
|
||||
INSERT INTO t1 VALUES (1234);
|
||||
DELETE FROM t1 WHERE c07=1234;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c08 SMALLINT UNSIGNED);
|
||||
INSERT INTO t1 VALUES (32768), (65535);
|
||||
UPDATE t1 SET c08=2 WHERE c08=32768;
|
||||
DELETE FROM t1 WHERE c08=65535;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c10 MEDIUMINT);
|
||||
INSERT INTO t1 VALUES (12345);
|
||||
DELETE FROM t1 WHERE c10=12345;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c11 MEDIUMINT UNSIGNED);
|
||||
INSERT INTO t1 VALUES (8388608), (16777215);
|
||||
UPDATE t1 SET c11=2 WHERE c11=8388608;
|
||||
DELETE FROM t1 WHERE c11=16777215;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c13 INT);
|
||||
INSERT INTO t1 VALUES (123456);
|
||||
DELETE FROM t1 WHERE c13=123456;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c14 INT UNSIGNED);
|
||||
INSERT INTO t1 VALUES (2147483648), (4294967295);
|
||||
UPDATE t1 SET c14=2 WHERE c14=2147483648;
|
||||
DELETE FROM t1 WHERE c14=4294967295;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c16 BIGINT);
|
||||
INSERT INTO t1 VALUES (1234567890);
|
||||
DELETE FROM t1 WHERE c16=1234567890;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c17 BIGINT UNSIGNED);
|
||||
INSERT INTO t1 VALUES (9223372036854775808), (18446744073709551615);
|
||||
UPDATE t1 SET c17=2 WHERE c17=9223372036854775808;
|
||||
DELETE FROM t1 WHERE c17=18446744073709551615;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c19 FLOAT);
|
||||
INSERT INTO t1 VALUES (123.2234);
|
||||
DELETE FROM t1 WHERE c19>123;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c22 DOUBLE);
|
||||
INSERT INTO t1 VALUES (123434.22344545);
|
||||
DELETE FROM t1 WHERE c22>123434;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (c25 DECIMAL(10,5));
|
||||
INSERT INTO t1 VALUES (124.45);
|
||||
INSERT INTO t1 VALUES (-543.21);
|
||||
DELETE FROM t1 WHERE c25=124.45;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (c28 DATE);
|
||||
INSERT INTO t1 VALUES ('2001-02-03');
|
||||
DELETE FROM t1 WHERE c28='2001-02-03';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c29 DATETIME);
|
||||
INSERT INTO t1 VALUES ('2001-02-03 10:20:30');
|
||||
DELETE FROM t1 WHERE c29='2001-02-03 10:20:30';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c30 TIMESTAMP);
|
||||
INSERT INTO t1 VALUES ('2001-02-03 10:20:30');
|
||||
DELETE FROM t1 WHERE c30='2001-02-03 10:20:30';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c31 TIME);
|
||||
INSERT INTO t1 VALUES ('11:22:33');
|
||||
DELETE FROM t1 WHERE c31='11:22:33';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c32 YEAR);
|
||||
INSERT INTO t1 VALUES ('2001');
|
||||
DELETE FROM t1 WHERE c32=2001;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (c33 CHAR);
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
DELETE FROM t1 WHERE c33='a';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c34 CHAR(0));
|
||||
INSERT INTO t1 VALUES ('');
|
||||
DELETE FROM t1 WHERE c34='';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c35 CHAR(1));
|
||||
INSERT INTO t1 VALUES ('b');
|
||||
DELETE FROM t1 WHERE c35='b';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c36 CHAR(255));
|
||||
INSERT INTO t1 VALUES (repeat('c',255));
|
||||
DELETE FROM t1 WHERE c36>'c';
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (c37 NATIONAL CHAR);
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
DELETE FROM t1 WHERE c37='a';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c38 NATIONAL CHAR(0));
|
||||
INSERT INTO t1 VALUES ('');
|
||||
DELETE FROM t1 WHERE c38='';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c39 NATIONAL CHAR(1));
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
DELETE FROM t1 WHERE c39='a';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c40 NATIONAL CHAR(255));
|
||||
INSERT INTO t1 VALUES (repeat('a', 255));
|
||||
INSERT INTO t1 VALUES (repeat(_latin1 0xDF, 255));
|
||||
DELETE FROM t1 WHERE c40>'a';
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (c41 CHAR CHARACTER SET UCS2);
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
DELETE FROM t1 WHERE c41='a';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c42 CHAR(0) CHARACTER SET UCS2);
|
||||
INSERT INTO t1 VALUES ('');
|
||||
DELETE FROM t1 WHERE c42='';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c43 CHAR(1) CHARACTER SET UCS2);
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
DELETE FROM t1 WHERE c43='a';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c44 CHAR(255) CHARACTER SET UCS2);
|
||||
INSERT INTO t1 VALUES (repeat('a', 255));
|
||||
INSERT INTO t1 VALUES (repeat(_latin1 0xDF, 255));
|
||||
DELETE FROM t1 WHERE c44>'a';
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (c45 VARCHAR(0));
|
||||
INSERT INTO t1 VALUES ('');
|
||||
DELETE FROM t1 WHERE c45='';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c46 VARCHAR(1));
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
DELETE FROM t1 WHERE c46='a';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c47 VARCHAR(255));
|
||||
INSERT INTO t1 VALUES (repeat('a',255));
|
||||
DELETE FROM t1 WHERE c47>'a';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c48 VARCHAR(261));
|
||||
INSERT INTO t1 VALUES (repeat('a',261));
|
||||
DELETE FROM t1 WHERE c48>'a';
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (c49 NATIONAL VARCHAR(0));
|
||||
INSERT INTO t1 VALUES ('');
|
||||
DELETE FROM t1 WHERE c49='';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c50 NATIONAL VARCHAR(1));
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
DELETE FROM t1 WHERE c50='a';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c51 NATIONAL VARCHAR(255));
|
||||
INSERT INTO t1 VALUES (repeat('a',255));
|
||||
INSERT INTO t1 VALUES (repeat(_latin1 0xDF, 255));
|
||||
DELETE FROM t1 WHERE c51>'a';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c52 NATIONAL VARCHAR(261));
|
||||
INSERT INTO t1 VALUES (repeat('a',261));
|
||||
INSERT INTO t1 VALUES (repeat(_latin1 0xDF, 261));
|
||||
DELETE FROM t1 WHERE c52>'a';
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (c53 VARCHAR(0) CHARACTER SET ucs2);
|
||||
INSERT INTO t1 VALUES ('');
|
||||
DELETE FROM t1 WHERE c53='';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c54 VARCHAR(1) CHARACTER SET ucs2);
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
DELETE FROM t1 WHERE c54='a';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c55 VARCHAR(255) CHARACTER SET ucs2);
|
||||
INSERT INTO t1 VALUES (repeat('ab', 127));
|
||||
DELETE FROM t1 WHERE c55>'a';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c56 VARCHAR(261) CHARACTER SET ucs2);
|
||||
INSERT INTO t1 VALUES (repeat('ab', 130));
|
||||
DELETE FROM t1 WHERE c56>'a';
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (c57 BINARY);
|
||||
INSERT INTO t1 VALUES (0x00);
|
||||
INSERT INTO t1 VALUES (0x02);
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
DELETE FROM t1 WHERE c57='a';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c58 BINARY(0));
|
||||
INSERT INTO t1 VALUES ('');
|
||||
DELETE FROM t1 WHERE c58='';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c59 BINARY(1));
|
||||
INSERT INTO t1 VALUES (0x00);
|
||||
INSERT INTO t1 VALUES (0x02);
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
DELETE FROM t1 WHERE c59='a';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c60 BINARY(255));
|
||||
INSERT INTO t1 VALUES (0x00);
|
||||
INSERT INTO t1 VALUES (0x02);
|
||||
INSERT INTO t1 VALUES (repeat('a\0',120));
|
||||
DELETE FROM t1 WHERE c60<0x02;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (c61 VARBINARY(0));
|
||||
INSERT INTO t1 VALUES ('');
|
||||
DELETE FROM t1 WHERE c61='';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c62 VARBINARY(1));
|
||||
INSERT INTO t1 VALUES (0x00);
|
||||
INSERT INTO t1 VALUES (0x02);
|
||||
INSERT INTO t1 VALUES ('a');
|
||||
DELETE FROM t1 WHERE c62=0x02;
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c63 VARBINARY(255));
|
||||
INSERT INTO t1 VALUES (0x00);
|
||||
INSERT INTO t1 VALUES (0x02);
|
||||
INSERT INTO t1 VALUES (repeat('a\0',120));
|
||||
DELETE FROM t1 WHERE c63=0x02;
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (c65 TINYBLOB);
|
||||
INSERT INTO t1 VALUES ('tinyblob1');
|
||||
DELETE FROM t1 WHERE c65='tinyblob1';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c68 BLOB);
|
||||
INSERT INTO t1 VALUES ('blob1');
|
||||
DELETE FROM t1 WHERE c68='blob1';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c71 MEDIUMBLOB);
|
||||
INSERT INTO t1 VALUES ('mediumblob1');
|
||||
DELETE FROM t1 WHERE c71='mediumblob1';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c74 LONGBLOB);
|
||||
INSERT INTO t1 VALUES ('longblob1');
|
||||
DELETE FROM t1 WHERE c74='longblob1';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c66 TINYTEXT);
|
||||
INSERT INTO t1 VALUES ('tinytext1');
|
||||
DELETE FROM t1 WHERE c66='tinytext1';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c69 TEXT);
|
||||
INSERT INTO t1 VALUES ('text1');
|
||||
DELETE FROM t1 WHERE c69='text1';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c72 MEDIUMTEXT);
|
||||
INSERT INTO t1 VALUES ('mediumtext1');
|
||||
DELETE FROM t1 WHERE c72='mediumtext1';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c75 LONGTEXT);
|
||||
INSERT INTO t1 VALUES ('longtext1');
|
||||
DELETE FROM t1 WHERE c75='longtext1';
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (c67 TINYTEXT CHARACTER SET UCS2);
|
||||
INSERT INTO t1 VALUES ('tinytext1');
|
||||
DELETE FROM t1 WHERE c67='tinytext1';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c70 TEXT CHARACTER SET UCS2);
|
||||
INSERT INTO t1 VALUES ('text1');
|
||||
DELETE FROM t1 WHERE c70='text1';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c73 MEDIUMTEXT CHARACTER SET UCS2);
|
||||
INSERT INTO t1 VALUES ('mediumtext1');
|
||||
DELETE FROM t1 WHERE c73='mediumtext1';
|
||||
DROP TABLE t1;
|
||||
|
||||
CREATE TABLE t1 (c76 LONGTEXT CHARACTER SET UCS2);
|
||||
INSERT INTO t1 VALUES ('longtext1');
|
||||
DELETE FROM t1 WHERE c76='longtext1';
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (c77 ENUM('a','b','c'));
|
||||
INSERT INTO t1 VALUES ('b');
|
||||
DELETE FROM t1 WHERE c77='b';
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
|
||||
CREATE TABLE t1 (c78 SET('a','b','c','d','e','f'));
|
||||
INSERT INTO t1 VALUES ('a,b');
|
||||
INSERT INTO t1 VALUES ('a,c');
|
||||
INSERT INTO t1 VALUES ('b,c');
|
||||
INSERT INTO t1 VALUES ('a,b,c');
|
||||
INSERT INTO t1 VALUES ('a,b,c,d');
|
||||
INSERT INTO t1 VALUES ('a,b,c,d,e');
|
||||
INSERT INTO t1 VALUES ('a,b,c,d,e,f');
|
||||
DELETE FROM t1 WHERE c78='a,b';
|
||||
DROP TABLE t1;
|
||||
|
||||
#
|
||||
# Check multi-table update
|
||||
#
|
||||
CREATE TABLE t1 (a int NOT NULL DEFAULT 0, b int NOT NULL DEFAULT 0);
|
||||
CREATE TABLE t2 (a int NOT NULL DEFAULT 0, b int NOT NULL DEFAULT 0);
|
||||
INSERT INTO t1 SET a=1;
|
||||
INSERT INTO t1 SET b=1;
|
||||
INSERT INTO t2 SET a=1;
|
||||
INSERT INTO t2 SET b=1;
|
||||
UPDATE t1, t2 SET t1.a=10, t2.a=20;
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
flush logs;
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9]*[.][0-9]{1,3})[0-9e+-]*[^ ]*(.*(FLOAT|DOUBLE).*[*].)/\1...\2/
|
||||
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
|
@ -1 +0,0 @@
|
||||
--timezone=GMT-3
|
@ -1,24 +0,0 @@
|
||||
# mysqlbinlog_row_innodb.test
|
||||
#
|
||||
# Show that mysqlbinlog displays human readable comments to
|
||||
# row-based log events.
|
||||
#
|
||||
# Main module for the InnoDB storage engine.
|
||||
#
|
||||
# Calls include/mysqlbinlog_row.inc
|
||||
# See there for more informaton.
|
||||
#
|
||||
|
||||
--source include/have_innodb.inc
|
||||
let $engine_type=InnoDB;
|
||||
|
||||
#
|
||||
# The test case would also work with statement based or mixed mode logging.
|
||||
# But this would require different result files. To handle this with the
|
||||
# current test suite, new main test cases are required.
|
||||
#
|
||||
--source include/have_binlog_format_row.inc
|
||||
--source include/have_ucs2.inc
|
||||
|
||||
--source include/mysqlbinlog_row_engine.inc
|
||||
|
@ -1 +0,0 @@
|
||||
--timezone=GMT-3
|
@ -1,23 +0,0 @@
|
||||
# mysqlbinlog_row.test
|
||||
#
|
||||
# Show that mysqlbinlog displays human readable comments to
|
||||
# row-based log events.
|
||||
#
|
||||
# Main module for the MyISAM storage engine.
|
||||
#
|
||||
# Calls include/mysqlbinlog_row.inc
|
||||
# See there for more informaton.
|
||||
#
|
||||
|
||||
#--source include/have_myisam.inc
|
||||
let $engine_type=MyISAM;
|
||||
|
||||
#
|
||||
# The test case would also work with statement based or mixed mode logging.
|
||||
# But this would require different result files. To handle this with the
|
||||
# current test suite, new main test cases are required.
|
||||
#
|
||||
--source include/have_binlog_format_row.inc
|
||||
--source include/have_ucs2.inc
|
||||
|
||||
--source include/mysqlbinlog_row_engine.inc
|
@ -1 +0,0 @@
|
||||
--timezone=GMT-3
|
@ -1,161 +0,0 @@
|
||||
# mysqlbinlog_trans.test
|
||||
#
|
||||
# Show that mysqlbinlog work correctly with transactions.
|
||||
#
|
||||
|
||||
#--source include/have_myisam.inc
|
||||
--let $engine_type_nontrans= MyISAM
|
||||
--source include/have_innodb.inc
|
||||
--let $engine_type= InnoDB
|
||||
|
||||
#
|
||||
# The test case would also work with statement based or mixed mode logging.
|
||||
# But this would require different result files. To handle this with the
|
||||
# current test suite, new main test cases are required.
|
||||
#
|
||||
--source include/have_binlog_format_row.inc
|
||||
|
||||
--source include/have_log_bin.inc
|
||||
|
||||
--echo #
|
||||
--echo # Preparatory cleanup.
|
||||
--echo #
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1, t2;
|
||||
--enable_warnings
|
||||
|
||||
--echo #
|
||||
--echo # We need a fixed timestamp to avoid varying results.
|
||||
--echo #
|
||||
SET timestamp=1000000000;
|
||||
|
||||
--echo #
|
||||
--echo # Delete all existing binary logs.
|
||||
--echo #
|
||||
RESET MASTER;
|
||||
|
||||
--echo #
|
||||
--echo # Create test tables.
|
||||
--echo #
|
||||
eval CREATE TABLE t1 (
|
||||
c1 INT,
|
||||
c2 VARCHAR(20)
|
||||
) ENGINE=$engine_type DEFAULT CHARSET latin1;
|
||||
eval CREATE TABLE t2 (
|
||||
c1 INT,
|
||||
c2 VARCHAR(20)
|
||||
) ENGINE=$engine_type_nontrans DEFAULT CHARSET latin1;
|
||||
|
||||
--echo #
|
||||
--echo # Start transaction #1, transactional table only, commit.
|
||||
--echo #
|
||||
START TRANSACTION;
|
||||
|
||||
--echo #
|
||||
--echo # Do some statements.
|
||||
--echo #
|
||||
INSERT INTO t1 VALUES (1,'varchar-1'), (2,'varchar-2'), (3,'varchar-3');
|
||||
UPDATE t1 SET c1 = c1 + 10;
|
||||
DELETE FROM t1 WHERE c1 = 12;
|
||||
|
||||
--echo #
|
||||
--echo # Commit transaction.
|
||||
--echo #
|
||||
COMMIT;
|
||||
SELECT * FROM t1;
|
||||
TRUNCATE TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Start transaction #2, transactional table only, rollback.
|
||||
--echo #
|
||||
START TRANSACTION;
|
||||
|
||||
--echo #
|
||||
--echo # Do some statements.
|
||||
--echo #
|
||||
INSERT INTO t1 VALUES (1,'varchar-1'), (2,'varchar-2'), (3,'varchar-3');
|
||||
UPDATE t1 SET c1 = c1 + 10;
|
||||
DELETE FROM t1 WHERE c1 = 12;
|
||||
|
||||
--echo #
|
||||
--echo # Rollback transaction.
|
||||
--echo #
|
||||
ROLLBACK;
|
||||
SELECT * FROM t1;
|
||||
TRUNCATE TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Start transaction #3, both tables, commit.
|
||||
--echo #
|
||||
START TRANSACTION;
|
||||
|
||||
--echo #
|
||||
--echo # Do some statements on the transactional table.
|
||||
--echo #
|
||||
INSERT INTO t1 VALUES (1,'varchar-1'), (2,'varchar-2'), (3,'varchar-3');
|
||||
UPDATE t1 SET c1 = c1 + 10;
|
||||
DELETE FROM t1 WHERE c1 = 12;
|
||||
|
||||
--echo #
|
||||
--echo # Do some statements on the non-transactional table.
|
||||
--echo #
|
||||
INSERT INTO t2 VALUES (1,'varchar-1'), (2,'varchar-2'), (3,'varchar-3');
|
||||
UPDATE t2 SET c1 = c1 + 10;
|
||||
DELETE FROM t2 WHERE c1 = 12;
|
||||
|
||||
--echo #
|
||||
--echo # Commit transaction.
|
||||
--echo #
|
||||
COMMIT;
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
TRUNCATE TABLE t1;
|
||||
TRUNCATE TABLE t2;
|
||||
|
||||
--echo #
|
||||
--echo # Start transaction #4, both tables, rollback.
|
||||
--echo #
|
||||
START TRANSACTION;
|
||||
|
||||
--echo #
|
||||
--echo # Do some statements on the transactional table.
|
||||
--echo #
|
||||
INSERT INTO t1 VALUES (1,'varchar-1'), (2,'varchar-2'), (3,'varchar-3');
|
||||
UPDATE t1 SET c1 = c1 + 10;
|
||||
DELETE FROM t1 WHERE c1 = 12;
|
||||
|
||||
--echo #
|
||||
--echo # Do some statements on the non-transactional table.
|
||||
--echo #
|
||||
INSERT INTO t2 VALUES (1,'varchar-1'), (2,'varchar-2'), (3,'varchar-3');
|
||||
UPDATE t2 SET c1 = c1 + 10;
|
||||
DELETE FROM t2 WHERE c1 = 12;
|
||||
|
||||
--echo #
|
||||
--echo # Rollback transaction.
|
||||
--echo #
|
||||
ROLLBACK;
|
||||
SELECT * FROM t1;
|
||||
SELECT * FROM t2;
|
||||
TRUNCATE TABLE t1;
|
||||
TRUNCATE TABLE t2;
|
||||
|
||||
--echo #
|
||||
--echo # Flush all log buffers to the log file.
|
||||
--echo #
|
||||
FLUSH LOGS;
|
||||
|
||||
--echo #
|
||||
--echo # Call mysqlbinlog to display the log file contents.
|
||||
--echo #
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
||||
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /Xid = [0-9]*/Xid = #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/
|
||||
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
|
||||
|
||||
--echo #
|
||||
--echo # Cleanup.
|
||||
--echo #
|
||||
DROP TABLE t1, t2;
|
||||
|
||||
|
@ -461,3 +461,16 @@ SHOW CREATE EVENT TESTE_bug11763507;
|
||||
|
||||
DROP EVENT teste_bug11763507;
|
||||
--echo #END OF BUG#11763507 test.
|
||||
|
||||
--echo # ------------------------------------------------------------------
|
||||
--echo # -- End of 5.1 tests
|
||||
--echo # ------------------------------------------------------------------
|
||||
|
||||
#
|
||||
# Restore global concurrent_insert value. Keep in the end of the test file.
|
||||
#
|
||||
|
||||
set @@global.concurrent_insert= @old_concurrent_insert;
|
||||
|
||||
# Wait till all disconnects are completed
|
||||
--source include/wait_until_count_sessions.inc
|
||||
|
@ -1777,6 +1777,33 @@ drop table t1, t2;
|
||||
|
||||
set optimizer_switch=@subselect4_tmp;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-3928 Assertion `example' failed in Item_cache::is_expensive_processor with a 2-level IN subquery
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a1 INT, b1 TIME) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES (4,'21:22:34'),(6,'10:50:38');
|
||||
|
||||
CREATE TABLE t2 (a2 INT, b2 TIME) ENGINE=MyISAM;
|
||||
INSERT INTO t2 VALUES (8, '06:17:39');
|
||||
|
||||
CREATE TABLE t3 (a3 INT, b3 TIME) ENGINE=MyISAM;
|
||||
INSERT INTO t3 VALUES (1,'00:00:01'),(7,'00:00:02');
|
||||
|
||||
EXPLAIN
|
||||
SELECT * FROM t1 WHERE a1 IN (
|
||||
SELECT a2 FROM t2 WHERE a2 IN (
|
||||
SELECT a3 FROM t3 WHERE b2 = b1 AND b2 <= b1 ORDER BY b3
|
||||
)
|
||||
);
|
||||
|
||||
SELECT * FROM t1 WHERE a1 IN (
|
||||
SELECT a2 FROM t2 WHERE a2 IN (
|
||||
SELECT a3 FROM t3 WHERE b2 = b1 AND b2 <= b1 ORDER BY b3
|
||||
)
|
||||
);
|
||||
drop table t1, t2, t3;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-3899 Valgrind warnings (blocks are definitely lost) in filesort on IN subquery with SUM and DISTINCT
|
||||
--echo #
|
||||
|
@ -4702,6 +4702,32 @@ select t1.*, v2.* from t1 left join v2 on t1.id = v2.id;
|
||||
drop view v2;
|
||||
drop table t1,t2;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-3914: Wrong result (NULLs instead of real values)
|
||||
--echo # with INNER and RIGHT JOIN in a FROM subquery, derived_merge=on
|
||||
--echo # (fix of above MDEV-486 fix)
|
||||
--echo #
|
||||
SET @save_optimizer_switch_MDEV_3914=@@optimizer_switch;
|
||||
SET optimizer_switch = 'derived_merge=on';
|
||||
|
||||
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
|
||||
CREATE TABLE t2 (b INT) ENGINE=MyISAM;
|
||||
INSERT INTO t2 VALUES (3),(4);
|
||||
|
||||
CREATE TABLE t3 (c INT) ENGINE=MyISAM;
|
||||
INSERT INTO t3 VALUES (5),(6);
|
||||
|
||||
SELECT * FROM ( SELECT c FROM ( t1 INNER JOIN t2 ) RIGHT JOIN t3 ON a = c ) AS alias;
|
||||
|
||||
SET optimizer_switch = 'derived_merge=off';
|
||||
|
||||
SELECT * FROM ( SELECT c FROM ( t1 INNER JOIN t2 ) RIGHT JOIN t3 ON a = c ) AS alias;
|
||||
|
||||
SET optimizer_switch=@save_optimizer_switch_MDEV_3914;
|
||||
drop table t1,t2,t3;
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-589 (LP BUG#1007647) :
|
||||
--echo # Assertion `vcol_table == 0 || vcol_table == table' failed in
|
||||
@ -4747,6 +4773,27 @@ SELECT * FROM (
|
||||
drop tables t1,t2;
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-3876 Wrong result (extra rows) with ALL subquery
|
||||
--echo # from a MERGE view (duplicate of MDEV-3873)
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a INT NOT NULL) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES (1),(2);
|
||||
|
||||
CREATE TABLE t2 (b INT NOT NULL) ENGINE=MyISAM;
|
||||
INSERT INTO t2 VALUES (1),(3);
|
||||
|
||||
CREATE OR REPLACE ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t2;
|
||||
|
||||
SELECT a FROM t1 AS alias
|
||||
WHERE a >= ALL (
|
||||
SELECT b FROM t1 LEFT JOIN v1 ON (a = b)
|
||||
WHERE a = alias.a );
|
||||
|
||||
drop view v1;
|
||||
drop table t1,t2;
|
||||
|
||||
--echo # -----------------------------------------------------------------
|
||||
--echo # -- End of 5.3 tests.
|
||||
--echo # -----------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user