Commit aca8e7ed authored by Sergei Golubchik's avatar Sergei Golubchik

5.3 merge

parents 750b9147 4f67a147
MYSQL_VERSION_MAJOR=5 MYSQL_VERSION_MAJOR=5
MYSQL_VERSION_MINOR=5 MYSQL_VERSION_MINOR=5
MYSQL_VERSION_PATCH=28 MYSQL_VERSION_PATCH=29
MYSQL_VERSION_EXTRA=a MYSQL_VERSION_EXTRA=
...@@ -191,6 +191,32 @@ t1 CREATE TABLE `t1` ( ...@@ -191,6 +191,32 @@ t1 CREATE TABLE `t1` (
`r` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT '' `r` varchar(10) CHARACTER SET ucs2 NOT NULL DEFAULT ''
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1; DROP TABLE t1;
#
# Bug #51876 : crash/memory underrun when loading data with ucs2
# and reverse() function
#
# 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);
# should return 2 zeroes (as the value is truncated)
SELECT * FROM t1;
a
0
1
DROP TABLE t1;
# 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);
# should return 0 and 1 (10 reversed)
SELECT * FROM t1;
a
0
1
DROP TABLE t1;
create table t2(f1 Char(30)); create table t2(f1 Char(30));
insert into t2 values ("103000"), ("22720000"), ("3401200"), ("78000"); insert into t2 values ("103000"), ("22720000"), ("3401200"), ("78000");
select lpad(f1, 12, "-o-/") from t2; select lpad(f1, 12, "-o-/") from t2;
......
...@@ -4,5 +4,5 @@ insert t1 values (addtime('9999-12-31 23:59:59', '00:00:01')), ...@@ -4,5 +4,5 @@ insert t1 values (addtime('9999-12-31 23:59:59', '00:00:01')),
select * from t1; select * from t1;
d d
NULL NULL
NULL 0000-00-00 00:00:00
drop table t1; drop table t1;
...@@ -2115,6 +2115,55 @@ a ...@@ -2115,6 +2115,55 @@ a
4 4
drop table t1,t2; drop table t1,t2;
# #
# MDEV-3873: Wrong result (extra rows) with NOT IN and
# a subquery from a MERGE view
#
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;
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;
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;
a b
drop view v_temptable, v_merge;
drop table t1,t2,t3,t4,tv;
#
# MDEV-3912: Wrong result (extra rows) with FROM subquery inside
# ALL subquery, LEFT JOIN, derived_merge.
# (duplicate of MDEV-3873 (above))
#
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
);
a
8
set optimizer_switch=@save3912_optimizer_switch;
drop table t1, t2, t3;
#
# end of 5.3 tests # end of 5.3 tests
# #
set optimizer_switch=@exit_optimizer_switch; set optimizer_switch=@exit_optimizer_switch;
......
...@@ -1423,7 +1423,7 @@ MAKEDATE(11111111,1) ...@@ -1423,7 +1423,7 @@ MAKEDATE(11111111,1)
NULL NULL
SELECT WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1); SELECT WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1);
WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1) WEEK(DATE_ADD(FROM_DAYS(1),INTERVAL 1 MONTH), 1)
NULL 0
# #
# Bug#12584302 AFTER FIX FOR #12403504: ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0, # Bug#12584302 AFTER FIX FOR #12403504: ASSERTION FAILED: DELSUM+(INT) Y/4-TEMP > 0,
# #
......
grant file on *.* to user1@localhost with grant option;
grant select on `a%`.* to user1@localhost with grant option;
grant file on aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.* to 'user'@'%' identified by 'secret';
ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
drop user user1@localhost;
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));
Warnings:
Warning 1265 Data truncated for column 'Db' at row 1
insert mysql.db set db=concat('=>', repeat(_utf8 'й', 200));
Warnings:
Warning 1265 Data truncated for column 'Db' at row 1
flush privileges;
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;
...@@ -2130,6 +2130,47 @@ the value below *must* be 1 ...@@ -2130,6 +2130,47 @@ the value below *must* be 1
show status like 'Created_tmp_disk_tables'; show status like 'Created_tmp_disk_tables';
Variable_name Value Variable_name Value
Created_tmp_disk_tables 1 Created_tmp_disk_tables 1
#
# Bug #1002146: Unneeded filesort if usage of join buffer is not allowed
# (bug mdev-645)
#
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;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range idx idx 5 NULL 5 Using where; Using index
1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 Using index
SELECT t2.a FROM t2 STRAIGHT_JOIN t1 ON t2.a <> 0 WHERE t2.a <> 6
GROUP BY t2.a;
a
3
4
100
200
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;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range idx idx 5 NULL 5 Using where; Using index
1 SIMPLE t1 index NULL PRIMARY 4 NULL 4 Using where; Using index
SELECT t2.a FROM t2 LEFT JOIN t1 ON t2.a <> 0 WHERE t2.a <> 6
GROUP BY t2.a;
a
0
3
4
100
200
set optimizer_switch=@save_optimizer_switch;
DROP TABLE t1,t2;
# End of 5.3 tests # End of 5.3 tests
# #
# Bug#49771: Incorrect MIN (date) when minimum value is 0000-00-00 # Bug#49771: Incorrect MIN (date) when minimum value is 0000-00-00
......
...@@ -2019,10 +2019,10 @@ SELECT t1.pk FROM t2 LEFT JOIN t1 ON t2.pk = t1.a ...@@ -2019,10 +2019,10 @@ SELECT t1.pk FROM t2 LEFT JOIN t1 ON t2.pk = t1.a
WHERE t1.b BETWEEN 5 AND 6 AND t1.pk IS NULL OR t1.pk = 5 WHERE t1.b BETWEEN 5 AND 6 AND t1.pk IS NULL OR t1.pk = 5
ORDER BY t1.pk; ORDER BY t1.pk;
id select_type table type possible_keys key key_len ref rows filtered Extra id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 const PRIMARY,idx PRIMARY 4 const 1 100.00 1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 100.00
1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 100.00 Using index 1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 100.00 Using index
Warnings: Warnings:
Note 1003 select 5 AS `pk` from `test`.`t2` join `test`.`t1` where ((((1 between 5 and 6) and isnull(5)) or 1)) order by 5 Note 1003 select 5 AS `pk` from `test`.`t2` join `test`.`t1` where (1) order by 5
SELECT t1.pk FROM t2 LEFT JOIN t1 ON t2.pk = t1.a SELECT t1.pk FROM t2 LEFT JOIN t1 ON t2.pk = t1.a
WHERE t1.b BETWEEN 5 AND 6 AND t1.pk IS NULL OR t1.pk = 5 WHERE t1.b BETWEEN 5 AND 6 AND t1.pk IS NULL OR t1.pk = 5
ORDER BY t1.pk; ORDER BY t1.pk;
...@@ -2058,10 +2058,10 @@ SELECT t1.b, t2.c, t2.d FROM t2 LEFT JOIN t1 ON t2.c = t1.a ...@@ -2058,10 +2058,10 @@ SELECT t1.b, t2.c, t2.d FROM t2 LEFT JOIN t1 ON t2.c = t1.a
WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5 WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5
ORDER BY t1.b; ORDER BY t1.b;
id select_type table type possible_keys key key_len ref rows filtered Extra id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ref PRIMARY,idx idx 4 const 2 100.00 Using where; Using filesort 1 SIMPLE t1 ref idx idx 4 const 2 100.00 Using where
1 SIMPLE t2 ref c c 5 test.t1.a 2 100.00 1 SIMPLE t2 ref c c 5 test.t1.a 2 100.00
Warnings: Warnings:
Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (((`test`.`t1`.`pk` between 5 and 6) and isnull(`test`.`t1`.`b`)) or (`test`.`t1`.`b` = 5))) order by `test`.`t1`.`b` Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` = 5)) order by `test`.`t1`.`b`
SELECT t1.b, t2.c, t2.d FROM t2 LEFT JOIN t1 ON t2.c = t1.a SELECT t1.b, t2.c, t2.d FROM t2 LEFT JOIN t1 ON t2.c = t1.a
WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5 WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5
ORDER BY t1.b; ORDER BY t1.b;
......
...@@ -2030,10 +2030,10 @@ SELECT t1.pk FROM t2 LEFT JOIN t1 ON t2.pk = t1.a ...@@ -2030,10 +2030,10 @@ SELECT t1.pk FROM t2 LEFT JOIN t1 ON t2.pk = t1.a
WHERE t1.b BETWEEN 5 AND 6 AND t1.pk IS NULL OR t1.pk = 5 WHERE t1.b BETWEEN 5 AND 6 AND t1.pk IS NULL OR t1.pk = 5
ORDER BY t1.pk; ORDER BY t1.pk;
id select_type table type possible_keys key key_len ref rows filtered Extra id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 const PRIMARY,idx PRIMARY 4 const 1 100.00 1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 100.00
1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 100.00 Using index 1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 100.00 Using index
Warnings: Warnings:
Note 1003 select 5 AS `pk` from `test`.`t2` join `test`.`t1` where ((((1 between 5 and 6) and isnull(5)) or 1)) order by 5 Note 1003 select 5 AS `pk` from `test`.`t2` join `test`.`t1` where (1) order by 5
SELECT t1.pk FROM t2 LEFT JOIN t1 ON t2.pk = t1.a SELECT t1.pk FROM t2 LEFT JOIN t1 ON t2.pk = t1.a
WHERE t1.b BETWEEN 5 AND 6 AND t1.pk IS NULL OR t1.pk = 5 WHERE t1.b BETWEEN 5 AND 6 AND t1.pk IS NULL OR t1.pk = 5
ORDER BY t1.pk; ORDER BY t1.pk;
...@@ -2069,10 +2069,10 @@ SELECT t1.b, t2.c, t2.d FROM t2 LEFT JOIN t1 ON t2.c = t1.a ...@@ -2069,10 +2069,10 @@ SELECT t1.b, t2.c, t2.d FROM t2 LEFT JOIN t1 ON t2.c = t1.a
WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5 WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5
ORDER BY t1.b; ORDER BY t1.b;
id select_type table type possible_keys key key_len ref rows filtered Extra id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ref PRIMARY,idx idx 4 const 2 100.00 Using where; Using filesort 1 SIMPLE t1 ref idx idx 4 const 2 100.00 Using where
1 SIMPLE t2 ref c c 5 test.t1.a 2 100.00 1 SIMPLE t2 ref c c 5 test.t1.a 2 100.00
Warnings: Warnings:
Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (((`test`.`t1`.`pk` between 5 and 6) and isnull(`test`.`t1`.`b`)) or (`test`.`t1`.`b` = 5))) order by `test`.`t1`.`b` Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` = 5)) order by `test`.`t1`.`b`
SELECT t1.b, t2.c, t2.d FROM t2 LEFT JOIN t1 ON t2.c = t1.a SELECT t1.b, t2.c, t2.d FROM t2 LEFT JOIN t1 ON t2.c = t1.a
WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5 WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5
ORDER BY t1.b; ORDER BY t1.b;
......
...@@ -504,35 +504,6 @@ CREATE TABLE t1 (id INT NOT NULL); ...@@ -504,35 +504,6 @@ CREATE TABLE t1 (id INT NOT NULL);
LOAD DATA LOCAL INFILE 'tb.txt' INTO TABLE t1; LOAD DATA LOCAL INFILE 'tb.txt' INTO TABLE t1;
DROP TABLE t1; DROP TABLE t1;
# #
# Bug #51876 : crash/memory underrun when loading data with ucs2
# and reverse() function
#
# 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);
Warnings:
Warning 1366 Incorrect integer value: '?' for column 'a' at row 1
Warning 1366 Incorrect integer value: '?' for column 'a' at row 2
# should return 2 zeroes (as the value is truncated)
SELECT * FROM t1;
a
0
0
DROP TABLE t1;
# 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);
# should return 0 and 1 (10 reversed)
SELECT * FROM t1;
a
0
1
DROP TABLE t1;
#
# Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS AND WRITES WITH U # Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS AND WRITES WITH U
# #
CREATE TABLE t1(f1 INT); CREATE TABLE t1(f1 INT);
......
...@@ -509,5 +509,9 @@ SHOW TABLES IN connected_db; ...@@ -509,5 +509,9 @@ SHOW TABLES IN connected_db;
Tables_in_connected_db Tables_in_connected_db
table_in_connected_db table_in_connected_db
DROP DATABASE connected_db; DROP DATABASE connected_db;
create database `aa``bb````cc`;
DATABASE()
aa`bb``cc
drop database `aa``bb````cc`;
End of tests End of tests
...@@ -280,3 +280,7 @@ Event sql_mode time_zone Create Event character_set_client collation_connection ...@@ -280,3 +280,7 @@ Event sql_mode time_zone Create Event character_set_client collation_connection
teste_bug11763507 SYSTEM # latin1 latin1_swedish_ci latin1_swedish_ci teste_bug11763507 SYSTEM # latin1 latin1_swedish_ci latin1_swedish_ci
DROP EVENT teste_bug11763507; DROP EVENT teste_bug11763507;
#END OF BUG#11763507 test. #END OF BUG#11763507 test.
# ------------------------------------------------------------------
# -- End of 5.1 tests
# ------------------------------------------------------------------
set @@global.concurrent_insert= @old_concurrent_insert;
...@@ -2248,6 +2248,32 @@ NULL NULL ...@@ -2248,6 +2248,32 @@ NULL NULL
drop table t1, t2; drop table t1, t2;
set optimizer_switch=@subselect4_tmp; set optimizer_switch=@subselect4_tmp;
# #
# MDEV-3928 Assertion `example' failed in Item_cache::is_expensive_processor with a 2-level IN subquery
#
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
)
);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 system NULL NULL NULL NULL 1
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 Using where
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
)
);
a1 b1
drop table t1, t2, t3;
#
# MDEV-3899 Valgrind warnings (blocks are definitely lost) in filesort on IN subquery with SUM and DISTINCT # MDEV-3899 Valgrind warnings (blocks are definitely lost) in filesort on IN subquery with SUM and DISTINCT
# #
CREATE TABLE t1 (a INT) ENGINE=MyISAM; CREATE TABLE t1 (a INT) ENGINE=MyISAM;
......
...@@ -2988,7 +2988,7 @@ EXPLAIN ...@@ -2988,7 +2988,7 @@ EXPLAIN
SELECT a FROM t1 t WHERE a IN (SELECT b FROM t1, t2 WHERE b = a) SELECT a FROM t1 t WHERE a IN (SELECT b FROM t1, t2 WHERE b = a)
GROUP BY a HAVING a != 'z'; GROUP BY a HAVING a != 'z';
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t index idx_a idx_a 4 NULL 3 Using index; Using temporary; Using filesort 1 PRIMARY t index idx_a idx_a 4 NULL 3 Using index
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 Using where 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 Using where
2 MATERIALIZED t1 ref idx_a idx_a 4 test.t2.b 2 Using index 2 MATERIALIZED t1 ref idx_a idx_a 4 test.t2.b 2 Using index
...@@ -3002,7 +3002,7 @@ EXPLAIN ...@@ -3002,7 +3002,7 @@ EXPLAIN
SELECT a FROM t1 t WHERE a IN (SELECT b FROM t1, t2 WHERE b = a) SELECT a FROM t1 t WHERE a IN (SELECT b FROM t1, t2 WHERE b = a)
GROUP BY a HAVING a != 'z'; GROUP BY a HAVING a != 'z';
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t index idx_a idx_a 4 NULL 3 Using index; Using temporary; Using filesort 1 PRIMARY t index idx_a idx_a 4 NULL 3 Using index
1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 Using where 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 Using where
2 MATERIALIZED t1 ref idx_a idx_a 4 test.t2.b 2 Using index 2 MATERIALIZED t1 ref idx_a idx_a 4 test.t2.b 2 Using index
......
...@@ -4780,6 +4780,30 @@ id id bbb iddqd val1 ...@@ -4780,6 +4780,30 @@ id id bbb iddqd val1
drop view v2; drop view v2;
drop table t1,t2; drop table t1,t2;
# #
# MDEV-3914: Wrong result (NULLs instead of real values)
# with INNER and RIGHT JOIN in a FROM subquery, derived_merge=on
# (fix of above MDEV-486 fix)
#
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;
c
5
6
SET optimizer_switch = 'derived_merge=off';
SELECT * FROM ( SELECT c FROM ( t1 INNER JOIN t2 ) RIGHT JOIN t3 ON a = c ) AS alias;
c
5
6
SET optimizer_switch=@save_optimizer_switch_MDEV_3914;
drop table t1,t2,t3;
#
# MDEV-589 (LP BUG#1007647) : # MDEV-589 (LP BUG#1007647) :
# Assertion `vcol_table == 0 || vcol_table == table' failed in # Assertion `vcol_table == 0 || vcol_table == table' failed in
# fill_record(THD*, List<Item>&, List<Item>&, bool) # fill_record(THD*, List<Item>&, List<Item>&, bool)
...@@ -4822,6 +4846,23 @@ f2 f1 ...@@ -4822,6 +4846,23 @@ f2 f1
7 NULL 7 NULL
8 NULL 8 NULL
drop tables t1,t2; drop tables t1,t2;
#
# MDEV-3876 Wrong result (extra rows) with ALL subquery
# from a MERGE view (duplicate of MDEV-3873)
#
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 );
a
1
drop view v1;
drop table t1,t2;
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# -- End of 5.3 tests. # -- End of 5.3 tests.
# ----------------------------------------------------------------- # -----------------------------------------------------------------
......
...@@ -58,7 +58,7 @@ Tables_in_db1 ...@@ -58,7 +58,7 @@ Tables_in_db1
t2 t2
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `db1`; drop table `t1` master-bin.000001 # Query # # use `db1`; DROP TABLE `t1`
DROP TABLE t3; DROP TABLE t3;
DROP DATABASE db1; DROP DATABASE db1;
set binlog_format=mixed; set binlog_format=mixed;
...@@ -121,7 +121,7 @@ Tables_in_db1 ...@@ -121,7 +121,7 @@ Tables_in_db1
t2 t2
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `db1`; drop table `t1` master-bin.000001 # Query # # use `db1`; DROP TABLE `t1`
DROP TABLE t3; DROP TABLE t3;
DROP DATABASE db1; DROP DATABASE db1;
set binlog_format=row; set binlog_format=row;
...@@ -185,7 +185,7 @@ Tables_in_db1 ...@@ -185,7 +185,7 @@ Tables_in_db1
t2 t2
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # use `db1`; drop table `t1` master-bin.000001 # Query # # use `db1`; DROP TABLE `t1`
DROP TABLE t3; DROP TABLE t3;
DROP DATABASE db1; DROP DATABASE db1;
show databases; show databases;
......
...@@ -164,15 +164,15 @@ BEGIN ...@@ -164,15 +164,15 @@ BEGIN
# at # # at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number # #010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F #010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO test.t1 ### INSERT INTO `test`.`t1`
### SET ### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */ ### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### INSERT INTO test.t1 ### INSERT INTO `test`.`t1`
### SET ### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */ ### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### INSERT INTO test.t1 ### INSERT INTO `test`.`t1`
### SET ### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */ ### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
...@@ -180,21 +180,21 @@ BEGIN ...@@ -180,21 +180,21 @@ BEGIN
# at # # at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number # #010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F #010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE test.t1 ### UPDATE `test`.`t1`
### WHERE ### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */ ### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### SET ### SET
### @1=11 /* INT meta=0 nullable=1 is_null=0 */ ### @1=11 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### UPDATE test.t1 ### UPDATE `test`.`t1`
### WHERE ### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */ ### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### SET ### SET
### @1=12 /* INT meta=0 nullable=1 is_null=0 */ ### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### UPDATE test.t1 ### UPDATE `test`.`t1`
### WHERE ### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */ ### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
...@@ -205,7 +205,7 @@ BEGIN ...@@ -205,7 +205,7 @@ BEGIN
# at # # at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number # #010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F #010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM test.t1 ### DELETE FROM `test`.`t1`
### WHERE ### WHERE
### @1=12 /* INT meta=0 nullable=1 is_null=0 */ ### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
...@@ -231,15 +231,15 @@ BEGIN ...@@ -231,15 +231,15 @@ BEGIN
# at # # at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number # #010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F #010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO test.t2 ### INSERT INTO `test`.`t2`
### SET ### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */ ### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### INSERT INTO test.t2 ### INSERT INTO `test`.`t2`
### SET ### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */ ### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### INSERT INTO test.t2 ### INSERT INTO `test`.`t2`
### SET ### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */ ### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
...@@ -257,21 +257,21 @@ BEGIN ...@@ -257,21 +257,21 @@ BEGIN
# at # # at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number # #010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F #010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE test.t2 ### UPDATE `test`.`t2`
### WHERE ### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */ ### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### SET ### SET
### @1=11 /* INT meta=0 nullable=1 is_null=0 */ ### @1=11 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### UPDATE test.t2 ### UPDATE `test`.`t2`
### WHERE ### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */ ### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### SET ### SET
### @1=12 /* INT meta=0 nullable=1 is_null=0 */ ### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### UPDATE test.t2 ### UPDATE `test`.`t2`
### WHERE ### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */ ### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
...@@ -292,7 +292,7 @@ BEGIN ...@@ -292,7 +292,7 @@ BEGIN
# at # # at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number # #010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F #010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM test.t2 ### DELETE FROM `test`.`t2`
### WHERE ### WHERE
### @1=12 /* INT meta=0 nullable=1 is_null=0 */ ### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
...@@ -310,15 +310,15 @@ BEGIN ...@@ -310,15 +310,15 @@ BEGIN
# at # # at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number # #010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F #010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO test.t1 ### INSERT INTO `test`.`t1`
### SET ### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */ ### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### INSERT INTO test.t1 ### INSERT INTO `test`.`t1`
### SET ### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */ ### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### INSERT INTO test.t1 ### INSERT INTO `test`.`t1`
### SET ### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */ ### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
...@@ -326,21 +326,21 @@ BEGIN ...@@ -326,21 +326,21 @@ BEGIN
# at # # at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number # #010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F #010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE test.t1 ### UPDATE `test`.`t1`
### WHERE ### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */ ### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### SET ### SET
### @1=11 /* INT meta=0 nullable=1 is_null=0 */ ### @1=11 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### UPDATE test.t1 ### UPDATE `test`.`t1`
### WHERE ### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */ ### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### SET ### SET
### @1=12 /* INT meta=0 nullable=1 is_null=0 */ ### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### UPDATE test.t1 ### UPDATE `test`.`t1`
### WHERE ### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */ ### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
...@@ -351,7 +351,7 @@ BEGIN ...@@ -351,7 +351,7 @@ BEGIN
# at # # at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number # #010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t1` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F #010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM test.t1 ### DELETE FROM `test`.`t1`
### WHERE ### WHERE
### @1=12 /* INT meta=0 nullable=1 is_null=0 */ ### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
...@@ -377,15 +377,15 @@ BEGIN ...@@ -377,15 +377,15 @@ BEGIN
# at # # at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number # #010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F #010909 4:46:40 server id 1 end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO test.t2 ### INSERT INTO `test`.`t2`
### SET ### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */ ### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### INSERT INTO test.t2 ### INSERT INTO `test`.`t2`
### SET ### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */ ### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### INSERT INTO test.t2 ### INSERT INTO `test`.`t2`
### SET ### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */ ### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
...@@ -403,21 +403,21 @@ BEGIN ...@@ -403,21 +403,21 @@ BEGIN
# at # # at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number # #010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F #010909 4:46:40 server id 1 end_log_pos # Update_rows: table id # flags: STMT_END_F
### UPDATE test.t2 ### UPDATE `test`.`t2`
### WHERE ### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */ ### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### SET ### SET
### @1=11 /* INT meta=0 nullable=1 is_null=0 */ ### @1=11 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-1' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### UPDATE test.t2 ### UPDATE `test`.`t2`
### WHERE ### WHERE
### @1=2 /* INT meta=0 nullable=1 is_null=0 */ ### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### SET ### SET
### @1=12 /* INT meta=0 nullable=1 is_null=0 */ ### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### UPDATE test.t2 ### UPDATE `test`.`t2`
### WHERE ### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */ ### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
...@@ -438,7 +438,7 @@ BEGIN ...@@ -438,7 +438,7 @@ BEGIN
# at # # at #
#010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number # #010909 4:46:40 server id 1 end_log_pos # Table_map: `test`.`t2` mapped to number #
#010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F #010909 4:46:40 server id 1 end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM test.t2 ### DELETE FROM `test`.`t2`
### WHERE ### WHERE
### @1=12 /* INT meta=0 nullable=1 is_null=0 */ ### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */ ### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
......
...@@ -57,11 +57,11 @@ BEGIN ...@@ -57,11 +57,11 @@ BEGIN
# at # # at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number # #010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F #010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO new_test1.t1 ### INSERT INTO `new_test1`.`t1`
### SET ### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */ ### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2=1 /* INT meta=0 nullable=1 is_null=0 */ ### @2=1 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO new_test1.t1 ### INSERT INTO `new_test1`.`t1`
### SET ### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */ ### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2=2 /* INT meta=0 nullable=1 is_null=0 */ ### @2=2 /* INT meta=0 nullable=1 is_null=0 */
...@@ -85,10 +85,10 @@ BEGIN ...@@ -85,10 +85,10 @@ BEGIN
# at # # at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number # #010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F #010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO test2.t2 ### INSERT INTO `test2`.`t2`
### SET ### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */ ### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO test2.t2 ### INSERT INTO `test2`.`t2`
### SET ### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */ ### @1=2 /* INT meta=0 nullable=1 is_null=0 */
# at # # at #
...@@ -105,7 +105,7 @@ BEGIN ...@@ -105,7 +105,7 @@ BEGIN
# at # # at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number # #010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F #010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM new_test1.t1 ### DELETE FROM `new_test1`.`t1`
### WHERE ### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */ ### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2=1 /* INT meta=0 nullable=1 is_null=0 */ ### @2=1 /* INT meta=0 nullable=1 is_null=0 */
...@@ -129,10 +129,10 @@ BEGIN ...@@ -129,10 +129,10 @@ BEGIN
# at # # at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test3`.`t3` mapped to number # #010909 4:46:40 server id # end_log_pos # Table_map: `new_test3`.`t3` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F #010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO new_test3.t3 ### INSERT INTO `new_test3`.`t3`
### SET ### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */ ### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO new_test3.t3 ### INSERT INTO `new_test3`.`t3`
### SET ### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */ ### @1=2 /* INT meta=0 nullable=1 is_null=0 */
# at # # at #
...@@ -149,7 +149,7 @@ BEGIN ...@@ -149,7 +149,7 @@ BEGIN
# at # # at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number # #010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F #010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO new_test1.t1 ### INSERT INTO `new_test1`.`t1`
### SET ### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */ ### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2=3 /* INT meta=0 nullable=1 is_null=0 */ ### @2=3 /* INT meta=0 nullable=1 is_null=0 */
...@@ -167,23 +167,23 @@ BEGIN ...@@ -167,23 +167,23 @@ BEGIN
# at # # at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number # #010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F #010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO new_test1.t1 ### INSERT INTO `new_test1`.`t1`
### SET ### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */ ### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2=2 /* INT meta=0 nullable=1 is_null=0 */ ### @2=2 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO new_test1.t1 ### INSERT INTO `new_test1`.`t1`
### SET ### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */ ### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2=3 /* INT meta=0 nullable=1 is_null=0 */ ### @2=3 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO new_test1.t1 ### INSERT INTO `new_test1`.`t1`
### SET ### SET
### @1=4 /* INT meta=0 nullable=1 is_null=0 */ ### @1=4 /* INT meta=0 nullable=1 is_null=0 */
### @2=4 /* INT meta=0 nullable=1 is_null=0 */ ### @2=4 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO new_test1.t1 ### INSERT INTO `new_test1`.`t1`
### SET ### SET
### @1=5 /* INT meta=0 nullable=1 is_null=0 */ ### @1=5 /* INT meta=0 nullable=1 is_null=0 */
### @2=5 /* INT meta=0 nullable=1 is_null=0 */ ### @2=5 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO new_test1.t1 ### INSERT INTO `new_test1`.`t1`
### SET ### SET
### @1=6 /* INT meta=0 nullable=1 is_null=0 */ ### @1=6 /* INT meta=0 nullable=1 is_null=0 */
### @2=6 /* INT meta=0 nullable=1 is_null=0 */ ### @2=6 /* INT meta=0 nullable=1 is_null=0 */
...@@ -201,7 +201,7 @@ BEGIN ...@@ -201,7 +201,7 @@ BEGIN
# at # # at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test3`.`t3` mapped to number # #010909 4:46:40 server id # end_log_pos # Table_map: `new_test3`.`t3` mapped to number #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F #010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM new_test3.t3 ### DELETE FROM `new_test3`.`t3`
### WHERE ### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */ ### @1=1 /* INT meta=0 nullable=1 is_null=0 */
# at # # at #
...@@ -251,11 +251,11 @@ BEGIN ...@@ -251,11 +251,11 @@ BEGIN
# at # # at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number # #010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F #010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO new_test1.t1 ### INSERT INTO `new_test1`.`t1`
### SET ### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */ ### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2=1 /* INT meta=0 nullable=1 is_null=0 */ ### @2=1 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO new_test1.t1 ### INSERT INTO `new_test1`.`t1`
### SET ### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */ ### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2=2 /* INT meta=0 nullable=1 is_null=0 */ ### @2=2 /* INT meta=0 nullable=1 is_null=0 */
...@@ -279,10 +279,10 @@ BEGIN ...@@ -279,10 +279,10 @@ BEGIN
# at # # at #
#010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number # #010909 4:46:40 server id # end_log_pos # Table_map: `test2`.`t2` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F #010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO test2.t2 ### INSERT INTO `test2`.`t2`
### SET ### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */ ### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO test2.t2 ### INSERT INTO `test2`.`t2`
### SET ### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */ ### @1=2 /* INT meta=0 nullable=1 is_null=0 */
# at # # at #
...@@ -299,7 +299,7 @@ BEGIN ...@@ -299,7 +299,7 @@ BEGIN
# at # # at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number # #010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F #010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM new_test1.t1 ### DELETE FROM `new_test1`.`t1`
### WHERE ### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */ ### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2=1 /* INT meta=0 nullable=1 is_null=0 */ ### @2=1 /* INT meta=0 nullable=1 is_null=0 */
...@@ -323,10 +323,10 @@ BEGIN ...@@ -323,10 +323,10 @@ BEGIN
# at # # at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test3`.`t3` mapped to number # #010909 4:46:40 server id # end_log_pos # Table_map: `new_test3`.`t3` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F #010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO new_test3.t3 ### INSERT INTO `new_test3`.`t3`
### SET ### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */ ### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO new_test3.t3 ### INSERT INTO `new_test3`.`t3`
### SET ### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */ ### @1=2 /* INT meta=0 nullable=1 is_null=0 */
# at # # at #
...@@ -343,7 +343,7 @@ BEGIN ...@@ -343,7 +343,7 @@ BEGIN
# at # # at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number # #010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F #010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO new_test1.t1 ### INSERT INTO `new_test1`.`t1`
### SET ### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */ ### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2=3 /* INT meta=0 nullable=1 is_null=0 */ ### @2=3 /* INT meta=0 nullable=1 is_null=0 */
...@@ -361,23 +361,23 @@ BEGIN ...@@ -361,23 +361,23 @@ BEGIN
# at # # at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number # #010909 4:46:40 server id # end_log_pos # Table_map: `new_test1`.`t1` mapped to number #
#010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F #010909 4:46:40 server id # end_log_pos # Write_rows: table id # flags: STMT_END_F
### INSERT INTO new_test1.t1 ### INSERT INTO `new_test1`.`t1`
### SET ### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */ ### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2=2 /* INT meta=0 nullable=1 is_null=0 */ ### @2=2 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO new_test1.t1 ### INSERT INTO `new_test1`.`t1`
### SET ### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */ ### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2=3 /* INT meta=0 nullable=1 is_null=0 */ ### @2=3 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO new_test1.t1 ### INSERT INTO `new_test1`.`t1`
### SET ### SET
### @1=4 /* INT meta=0 nullable=1 is_null=0 */ ### @1=4 /* INT meta=0 nullable=1 is_null=0 */
### @2=4 /* INT meta=0 nullable=1 is_null=0 */ ### @2=4 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO new_test1.t1 ### INSERT INTO `new_test1`.`t1`
### SET ### SET
### @1=5 /* INT meta=0 nullable=1 is_null=0 */ ### @1=5 /* INT meta=0 nullable=1 is_null=0 */
### @2=5 /* INT meta=0 nullable=1 is_null=0 */ ### @2=5 /* INT meta=0 nullable=1 is_null=0 */
### INSERT INTO new_test1.t1 ### INSERT INTO `new_test1`.`t1`
### SET ### SET
### @1=6 /* INT meta=0 nullable=1 is_null=0 */ ### @1=6 /* INT meta=0 nullable=1 is_null=0 */
### @2=6 /* INT meta=0 nullable=1 is_null=0 */ ### @2=6 /* INT meta=0 nullable=1 is_null=0 */
...@@ -395,7 +395,7 @@ BEGIN ...@@ -395,7 +395,7 @@ BEGIN
# at # # at #
#010909 4:46:40 server id # end_log_pos # Table_map: `new_test3`.`t3` mapped to number # #010909 4:46:40 server id # end_log_pos # Table_map: `new_test3`.`t3` mapped to number #
#010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F #010909 4:46:40 server id # end_log_pos # Delete_rows: table id # flags: STMT_END_F
### DELETE FROM new_test3.t3 ### DELETE FROM `new_test3`.`t3`
### WHERE ### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */ ### @1=1 /* INT meta=0 nullable=1 is_null=0 */
# at # # at #
......
Verbose statements from : write-partial-row.binlog Verbose statements from : write-partial-row.binlog
select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%'; select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%';
stmt stmt
### INSERT INTO mysql.ndb_apply_status ### INSERT INTO `mysql`.`ndb_apply_status`
### SET ### SET
### @1=1 ### @1=1
### @2=25769803786 ### @2=25769803786
### @3='' ### @3=''
### @4=0 ### @4=0
### @5=0 ### @5=0
### INSERT INTO test.ba ### INSERT INTO `test`.`ba`
### SET ### SET
### @1=3 ### @1=3
### @2=3 ### @2=3
### @3=3 ### @3=3
### INSERT INTO test.ba ### INSERT INTO `test`.`ba`
### SET ### SET
### @1=1 ### @1=1
### @2=1 ### @2=1
### @3=1 ### @3=1
### INSERT INTO test.ba ### INSERT INTO `test`.`ba`
### SET ### SET
### @1=2 ### @1=2
### @2=2 ### @2=2
### @3=2 ### @3=2
### INSERT INTO test.ba ### INSERT INTO `test`.`ba`
### SET ### SET
### @1=4 ### @1=4
### @2=4 ### @2=4
### @3=4 ### @3=4
### INSERT INTO test.ba ### INSERT INTO `test`.`ba`
### SET ### SET
### @1=4 ### @1=4
### @3=40 ### @3=40
### DELETE FROM test.ba ### DELETE FROM `test`.`ba`
### WHERE ### WHERE
### @1=2 ### @1=2
drop table raw_binlog_rows; drop table raw_binlog_rows;
Verbose statements from : write-full-row.binlog Verbose statements from : write-full-row.binlog
select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%'; select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%';
stmt stmt
### INSERT INTO mysql.ndb_apply_status ### INSERT INTO `mysql`.`ndb_apply_status`
### SET ### SET
### @1=2 ### @1=2
### @2=25769803786 ### @2=25769803786
### @3='' ### @3=''
### @4=0 ### @4=0
### @5=0 ### @5=0
### INSERT INTO test.ba ### INSERT INTO `test`.`ba`
### SET ### SET
### @1=3 ### @1=3
### @2=3 ### @2=3
### @3=3 ### @3=3
### INSERT INTO test.ba ### INSERT INTO `test`.`ba`
### SET ### SET
### @1=1 ### @1=1
### @2=1 ### @2=1
### @3=1 ### @3=1
### INSERT INTO test.ba ### INSERT INTO `test`.`ba`
### SET ### SET
### @1=2 ### @1=2
### @2=2 ### @2=2
### @3=2 ### @3=2
### INSERT INTO test.ba ### INSERT INTO `test`.`ba`
### SET ### SET
### @1=4 ### @1=4
### @2=4 ### @2=4
### @3=4 ### @3=4
### INSERT INTO test.ba ### INSERT INTO `test`.`ba`
### SET ### SET
### @1=4 ### @1=4
### @2=4 ### @2=4
### @3=40 ### @3=40
### DELETE FROM test.ba ### DELETE FROM `test`.`ba`
### WHERE ### WHERE
### @1=2 ### @1=2
drop table raw_binlog_rows; drop table raw_binlog_rows;
Verbose statements from : update-partial-row.binlog Verbose statements from : update-partial-row.binlog
select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%'; select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%';
stmt stmt
### INSERT INTO mysql.ndb_apply_status ### INSERT INTO `mysql`.`ndb_apply_status`
### SET ### SET
### @1=3 ### @1=3
### @2=25769803786 ### @2=25769803786
### @3='' ### @3=''
### @4=0 ### @4=0
### @5=0 ### @5=0
### INSERT INTO test.ba ### INSERT INTO `test`.`ba`
### SET ### SET
### @1=3 ### @1=3
### @2=3 ### @2=3
### @3=3 ### @3=3
### INSERT INTO test.ba ### INSERT INTO `test`.`ba`
### SET ### SET
### @1=1 ### @1=1
### @2=1 ### @2=1
### @3=1 ### @3=1
### INSERT INTO test.ba ### INSERT INTO `test`.`ba`
### SET ### SET
### @1=2 ### @1=2
### @2=2 ### @2=2
### @3=2 ### @3=2
### INSERT INTO test.ba ### INSERT INTO `test`.`ba`
### SET ### SET
### @1=4 ### @1=4
### @2=4 ### @2=4
### @3=4 ### @3=4
### UPDATE test.ba ### UPDATE `test`.`ba`
### WHERE ### WHERE
### @1=4 ### @1=4
### @3=4 ### @3=4
### SET ### SET
### @1=4 ### @1=4
### @3=40 ### @3=40
### DELETE FROM test.ba ### DELETE FROM `test`.`ba`
### WHERE ### WHERE
### @1=2 ### @1=2
drop table raw_binlog_rows; drop table raw_binlog_rows;
Verbose statements from : update-full-row.binlog Verbose statements from : update-full-row.binlog
select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%'; select replace(txt,'\r', '') as stmt from raw_binlog_rows where txt like '###%';
stmt stmt
### INSERT INTO mysql.ndb_apply_status ### INSERT INTO `mysql`.`ndb_apply_status`
### SET ### SET
### @1=4 ### @1=4
### @2=25769803786 ### @2=25769803786
### @3='' ### @3=''
### @4=0 ### @4=0
### @5=0 ### @5=0
### INSERT INTO test.ba ### INSERT INTO `test`.`ba`
### SET ### SET
### @1=3 ### @1=3
### @2=3 ### @2=3
### @3=3 ### @3=3
### INSERT INTO test.ba ### INSERT INTO `test`.`ba`
### SET ### SET
### @1=1 ### @1=1
### @2=1 ### @2=1
### @3=1 ### @3=1
### INSERT INTO test.ba ### INSERT INTO `test`.`ba`
### SET ### SET
### @1=2 ### @1=2
### @2=2 ### @2=2
### @3=2 ### @3=2
### INSERT INTO test.ba ### INSERT INTO `test`.`ba`
### SET ### SET
### @1=4 ### @1=4
### @2=4 ### @2=4
### @3=4 ### @3=4
### UPDATE test.ba ### UPDATE `test`.`ba`
### WHERE ### WHERE
### @1=4 ### @1=4
### @2=4 ### @2=4
...@@ -155,7 +155,7 @@ stmt ...@@ -155,7 +155,7 @@ stmt
### @1=4 ### @1=4
### @2=4 ### @2=4
### @3=40 ### @3=40
### DELETE FROM test.ba ### DELETE FROM `test`.`ba`
### WHERE ### WHERE
### @1=2 ### @1=2
drop table raw_binlog_rows; drop table raw_binlog_rows;
...@@ -20,5 +20,5 @@ let $engine_type=InnoDB; ...@@ -20,5 +20,5 @@ let $engine_type=InnoDB;
--source include/have_binlog_format_row.inc --source include/have_binlog_format_row.inc
--source include/have_ucs2.inc --source include/have_ucs2.inc
--source include/mysqlbinlog_row_engine.inc --source extra/binlog_tests/mysqlbinlog_row_engine.inc
...@@ -20,4 +20,4 @@ let $engine_type=MyISAM; ...@@ -20,4 +20,4 @@ let $engine_type=MyISAM;
--source include/have_binlog_format_row.inc --source include/have_binlog_format_row.inc
--source include/have_ucs2.inc --source include/have_ucs2.inc
--source include/mysqlbinlog_row_engine.inc --source extra/binlog_tests/mysqlbinlog_row_engine.inc
use test;
drop table if exists t1;
create table t1 (id int primary key, value int, value2 int,
value3 int, index(value,value2)) engine=innodb;
insert into t1 values
(10,10,10,10),(11,11,11,11),(12,12,12,12),(13,13,13,13),(14,14,14,14),
(15,15,15,15),(16,16,16,16),(17,17,17,17),(18,18,18,18),(19,19,19,19),
(20,20,20,20);
use test;
start transaction with consistent snapshot;
use test;
CREATE PROCEDURE update_t1()
BEGIN
DECLARE i INT DEFAULT 1;
while (i <= 5000) DO
update test.t1 set value2=value2+1, value3=value3+1 where id=12;
SET i = i + 1;
END WHILE;
END|
set autocommit=0;
CALL update_t1();
select * from t1;
id value value2 value3
10 10 10 10
11 11 11 11
12 12 5012 5012
13 13 13 13
14 14 14 14
15 15 15 15
16 16 16 16
17 17 17 17
18 18 18 18
19 19 19 19
20 20 20 20
set autocommit=1;
select * from t1;
id value value2 value3
10 10 10 10
11 11 11 11
12 12 5012 5012
13 13 13 13
14 14 14 14
15 15 15 15
16 16 16 16
17 17 17 17
18 18 18 18
19 19 19 19
20 20 20 20
select * from t1 force index(value) where value=12;
kill query @id;
ERROR 70100: Query execution was interrupted
drop procedure if exists update_t1;
drop table if exists t1;
--source include/have_innodb.inc
#
# create test-bed to run test
#
use test;
--disable_warnings
drop table if exists t1;
--enable_warnings
create table t1 (id int primary key, value int, value2 int,
value3 int, index(value,value2)) engine=innodb;
insert into t1 values
(10,10,10,10),(11,11,11,11),(12,12,12,12),(13,13,13,13),(14,14,14,14),
(15,15,15,15),(16,16,16,16),(17,17,17,17),(18,18,18,18),(19,19,19,19),
(20,20,20,20);
let $ID= `SELECT @id := CONNECTION_ID()`;
#
# we need multiple connections as we need to keep one connection
# active with trx requesting consistent read.
#
connect (conn1, localhost, root,,);
connect (conn2, localhost, root,,);
connect (conn3, localhost, root,,);
#
# start trx with consistent read
#
connection conn1;
use test;
start transaction with consistent snapshot;
#
# update table such that secondary index is updated.
#
connection conn2;
use test;
delimiter |;
CREATE PROCEDURE update_t1()
BEGIN
DECLARE i INT DEFAULT 1;
while (i <= 5000) DO
update test.t1 set value2=value2+1, value3=value3+1 where id=12;
SET i = i + 1;
END WHILE;
END|
delimiter ;|
set autocommit=0;
CALL update_t1();
select * from t1;
set autocommit=1;
select * from t1;
#
# Now try to fire select query from connection-1 enforcing
# use of secondary index.
#
connection conn1;
let $ID= `SELECT @id := CONNECTION_ID()`;
#--error ER_QUERY_INTERRUPTED
--send
select * from t1 force index(value) where value=12;
#
# select is going to take good time so let's kill query.
#
connection conn3;
let $wait_condition=
select * from information_schema.processlist where state = 'Sending data' and
info = 'select * from t1 force index(value) where value=12';
--source include/wait_condition.inc
let $ignore= `SELECT @id := $ID`;
kill query @id;
#
# reap the value of connection-1
#
connection conn1;
--error ER_QUERY_INTERRUPTED
reap;
#
# clean test-bed.
#
connection default;
disconnect conn1;
disconnect conn2;
disconnect conn3;
drop procedure if exists update_t1;
drop table if exists t1;
...@@ -55,9 +55,6 @@ Warnings: ...@@ -55,9 +55,6 @@ Warnings:
Warning 1292 Truncated incorrect innodb_change_buffering_debug value: '-2' Warning 1292 Truncated incorrect innodb_change_buffering_debug value: '-2'
set global innodb_change_buffering_debug=1e1; set global innodb_change_buffering_debug=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_change_buffering_debug' ERROR 42000: Incorrect argument type to variable 'innodb_change_buffering_debug'
set global innodb_change_buffering_debug=2;
Warnings:
Warning 1292 Truncated incorrect innodb_change_buffering_debug value: '2'
SET @@global.innodb_change_buffering_debug = @start_global_value; SET @@global.innodb_change_buffering_debug = @start_global_value;
SELECT @@global.innodb_change_buffering_debug; SELECT @@global.innodb_change_buffering_debug;
@@global.innodb_change_buffering_debug @@global.innodb_change_buffering_debug
......
...@@ -42,7 +42,9 @@ set global innodb_change_buffering_debug='foo'; ...@@ -42,7 +42,9 @@ set global innodb_change_buffering_debug='foo';
set global innodb_change_buffering_debug=-2; set global innodb_change_buffering_debug=-2;
--error ER_WRONG_TYPE_FOR_VAR --error ER_WRONG_TYPE_FOR_VAR
set global innodb_change_buffering_debug=1e1; set global innodb_change_buffering_debug=1e1;
set global innodb_change_buffering_debug=2; # The value 2 is supposed to kill the server if there are unmerged changes.
# Do not try to set the value to 2 or anything that can be clamped to 2.
#set global innodb_change_buffering_debug=2;
# #
# Cleanup # Cleanup
......
...@@ -68,6 +68,38 @@ RPAD(_ucs2 X'0420',10,_ucs2 X'0421') r; ...@@ -68,6 +68,38 @@ RPAD(_ucs2 X'0420',10,_ucs2 X'0421') r;
SHOW CREATE TABLE t1; SHOW CREATE TABLE t1;
DROP 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 # BUG3946
# #
......
...@@ -1450,6 +1450,67 @@ INSERT INTO t1 SELECT * FROM ( SELECT * FROM t1 ) AS alias UNION SELECT * FROM t ...@@ -1450,6 +1450,67 @@ INSERT INTO t1 SELECT * FROM ( SELECT * FROM t1 ) AS alias UNION SELECT * FROM t
select * from t1; select * from t1;
drop table t1,t2; 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 #
--echo # end of 5.3 tests --echo # end of 5.3 tests
--echo # --echo #
......
--lower-case-table-names=1
# 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; ...@@ -1484,6 +1484,41 @@ DROP TABLE t1;
--echo the value below *must* be 1 --echo the value below *must* be 1
show status like 'Created_tmp_disk_tables'; 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 # End of 5.3 tests
--echo # --echo #
......
...@@ -572,36 +572,40 @@ DROP TABLE t1; ...@@ -572,36 +572,40 @@ DROP TABLE t1;
connection default; connection default;
disconnect con1; 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 # 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;
######################################################################################
--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;
--echo # --echo #
--echo # Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS AND WRITES WITH U --echo # Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS AND WRITES WITH U
......
...@@ -582,5 +582,17 @@ DROP DATABASE connected_db; ...@@ -582,5 +582,17 @@ DROP DATABASE connected_db;
--remove_file $MYSQLTEST_VARDIR/tmp/one_db_1.sql --remove_file $MYSQLTEST_VARDIR/tmp/one_db_1.sql
--remove_file $MYSQLTEST_VARDIR/tmp/one_db_2.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
--echo End of tests --echo End of tests
...@@ -461,3 +461,16 @@ SHOW CREATE EVENT TESTE_bug11763507; ...@@ -461,3 +461,16 @@ SHOW CREATE EVENT TESTE_bug11763507;
DROP EVENT teste_bug11763507; DROP EVENT teste_bug11763507;
--echo #END OF BUG#11763507 test. --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; ...@@ -1777,6 +1777,33 @@ drop table t1, t2;
set optimizer_switch=@subselect4_tmp; 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 #
--echo # MDEV-3899 Valgrind warnings (blocks are definitely lost) in filesort on IN subquery with SUM and DISTINCT --echo # MDEV-3899 Valgrind warnings (blocks are definitely lost) in filesort on IN subquery with SUM and DISTINCT
--echo # --echo #
......
...@@ -4702,6 +4702,32 @@ select t1.*, v2.* from t1 left join v2 on t1.id = v2.id; ...@@ -4702,6 +4702,32 @@ select t1.*, v2.* from t1 left join v2 on t1.id = v2.id;
drop view v2; drop view v2;
drop table t1,t2; 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 #
--echo # MDEV-589 (LP BUG#1007647) : --echo # MDEV-589 (LP BUG#1007647) :
--echo # Assertion `vcol_table == 0 || vcol_table == table' failed in --echo # Assertion `vcol_table == 0 || vcol_table == table' failed in
...@@ -4747,6 +4773,27 @@ SELECT * FROM ( ...@@ -4747,6 +4773,27 @@ SELECT * FROM (
drop tables t1,t2; 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 # -----------------------------------------------------------------
--echo # -- End of 5.3 tests. --echo # -- End of 5.3 tests.
--echo # ----------------------------------------------------------------- --echo # -----------------------------------------------------------------
......
...@@ -88,15 +88,11 @@ end: ...@@ -88,15 +88,11 @@ end:
int my_copystat(const char *from, const char *to, int MyFlags) int my_copystat(const char *from, const char *to, int MyFlags)
{ {
struct stat statbuf; MY_STAT statbuf;
if (stat(from, &statbuf)) if (my_stat(from, &statbuf, MyFlags) == NULL)
{
my_errno=errno;
if (MyFlags & (MY_FAE+MY_WME))
my_error(EE_STAT, MYF(ME_BELL+ME_WAITTANG),from,errno);
return -1; /* Can't get stat on input file */ return -1; /* Can't get stat on input file */
}
if ((statbuf.st_mode & S_IFMT) != S_IFREG) if ((statbuf.st_mode & S_IFMT) != S_IFREG)
return 1; return 1;
......
...@@ -44,6 +44,12 @@ static const char *get_os_version_name(OSVERSIONINFOEX *ver) ...@@ -44,6 +44,12 @@ static const char *get_os_version_name(OSVERSIONINFOEX *ver)
DWORD major = ver->dwMajorVersion; DWORD major = ver->dwMajorVersion;
DWORD minor = ver->dwMinorVersion; DWORD minor = ver->dwMinorVersion;
if (major == 6 && minor == 2)
{
return (ver->wProductType == VER_NT_WORKSTATION)?
"Windows 8":"Windows Server 2012";
}
if (major == 6 && minor == 1) if (major == 6 && minor == 1)
{ {
return (ver->wProductType == VER_NT_WORKSTATION)? return (ver->wProductType == VER_NT_WORKSTATION)?
......
...@@ -423,8 +423,11 @@ my $mysqld_install_cmd_line = quote_options($mysqld_bootstrap, ...@@ -423,8 +423,11 @@ my $mysqld_install_cmd_line = quote_options($mysqld_bootstrap,
"--bootstrap", "--bootstrap",
"--basedir=$opt->{basedir}", "--basedir=$opt->{basedir}",
"--datadir=$opt->{ldata}", "--datadir=$opt->{ldata}",
"--log-warnings=0",
"--loose-skip-innodb", "--loose-skip-innodb",
"--loose-skip-ndbcluster",
"--max_allowed_packet=8M", "--max_allowed_packet=8M",
"--default-storage-engine=MyISAM",
"--net_buffer_length=16K", "--net_buffer_length=16K",
@args, @args,
); );
...@@ -437,6 +440,8 @@ report_verbose_wait($opt,"Installing MySQL system tables..."); ...@@ -437,6 +440,8 @@ report_verbose_wait($opt,"Installing MySQL system tables...");
open(SQL, $create_system_tables) open(SQL, $create_system_tables)
or error($opt,"can't open $create_system_tables for reading: $!"); or error($opt,"can't open $create_system_tables for reading: $!");
open(SQL2, $fill_system_tables)
or error($opt,"can't open $fill_system_tables for reading: $!");
# FIXME > /dev/null ? # FIXME > /dev/null ?
if ( open(PIPE, "| $mysqld_install_cmd_line") ) if ( open(PIPE, "| $mysqld_install_cmd_line") )
{ {
...@@ -450,8 +455,20 @@ if ( open(PIPE, "| $mysqld_install_cmd_line") ) ...@@ -450,8 +455,20 @@ if ( open(PIPE, "| $mysqld_install_cmd_line") )
print PIPE $_; print PIPE $_;
} }
while ( <SQL2> )
{
# TODO: make it similar to the above condition when we're sure
# @@hostname returns a fqdn
# When doing a "cross bootstrap" install, no reference to the current
# host should be added to the system tables. So we filter out any
# lines which contain the current host name.
next if /\@current_hostname/;
print PIPE $_;
}
close PIPE; close PIPE;
close SQL; close SQL;
close SQL2;
report_verbose($opt,"OK"); report_verbose($opt,"OK");
......
...@@ -64,6 +64,28 @@ $homedir = $ENV{HOME}; ...@@ -64,6 +64,28 @@ $homedir = $ENV{HOME};
$my_progname = $0; $my_progname = $0;
$my_progname =~ s/.*[\/]//; $my_progname =~ s/.*[\/]//;
if (defined($ENV{UMASK})) {
my $UMASK = $ENV{UMASK};
my $m;
my $fmode = "0640";
if(($UMASK =~ m/[^0246]/) || ($UMASK =~ m/^[^0]/) || (length($UMASK) != 4)) {
printf("UMASK must be a 3-digit mode with an additional leading 0 to indicate octal.\n");
printf("The first digit will be corrected to 6, the others may be 0, 2, 4, or 6.\n"); }
else {
$fmode= substr $UMASK, 2, 2;
$fmode= "06${fmode}"; }
if($fmode != $UMASK) {
printf("UMASK corrected from $UMASK to $fmode ...\n"); }
$fmode= oct($fmode);
umask($fmode);
}
main(); main();
#### ####
......
This diff is collapsed.
...@@ -4442,8 +4442,8 @@ static int old_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql) ...@@ -4442,8 +4442,8 @@ static int old_password_auth_client(MYSQL_PLUGIN_VIO *vio, MYSQL *mysql)
DBUG_RETURN(CR_SERVER_HANDSHAKE_ERR); DBUG_RETURN(CR_SERVER_HANDSHAKE_ERR);
/* save it in MYSQL */ /* save it in MYSQL */
memmove(mysql->scramble, pkt, pkt_len); memmove(mysql->scramble, pkt, pkt_len - 1);
mysql->scramble[pkt_len] = 0; mysql->scramble[pkt_len - 1] = 0;
} }
if (mysql->passwd[0]) if (mysql->passwd[0])
......
/* Copyright (c) 2006, 2011, Oracle and/or its affiliates. /* Copyright (c) 2006, 2011, Oracle and/or its affiliates.
Copyright (c) 2012, 2013, Monty Proram Ab.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -2604,6 +2604,7 @@ void Item_xml_str_func::fix_length_and_dec() ...@@ -2604,6 +2604,7 @@ void Item_xml_str_func::fix_length_and_dec()
status_var_increment(current_thd->status_var.feature_xml); status_var_increment(current_thd->status_var.feature_xml);
nodeset_func= 0; nodeset_func= 0;
set_persist_maybe_null(1);
if (agg_arg_charsets_for_comparison(collation, args, arg_count)) if (agg_arg_charsets_for_comparison(collation, args, arg_count))
return; return;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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