Skip to content

Commit

Permalink
Merge branch '5.5' into 10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sanja-byelkin committed Jul 25, 2019
2 parents 8d0dabc + 2536c0b commit ae47686
Show file tree
Hide file tree
Showing 63 changed files with 3,192 additions and 114 deletions.
70 changes: 70 additions & 0 deletions mysql-test/extra/binlog_tests/drop_temp_table.test
@@ -1,3 +1,4 @@
--source include/have_innodb.inc

--disable_warnings
DROP DATABASE IF EXISTS `drop-temp+table-test`;
Expand Down Expand Up @@ -104,3 +105,72 @@ RESET MASTER;
DROP TABLE t1;

# End of 4.1 tests


--echo #
--echo # BUG#28642318: POINT IN TIME RECOVERY USING MYSQLBINLOG BROKEN
--echo # WITH TEMPORARY TABLE -> ERRORS

--echo # Test case for DELETE query.

RESET MASTER;
connect (con1,localhost,root,,);

--echo # Set up.
--connection default
--disable_warnings
SET @save_binlog_format= @@session.binlog_format;
SET @@session.binlog_format=STATEMENT;
let $MYSQLD_DATADIR= `select @@datadir`;
CREATE TABLE t1 (a INT) ENGINE=INNODB;

--connection con1
SET @@session.binlog_format=STATEMENT;
CREATE TEMPORARY TABLE t1 (b BLOB) ENGINE=INNODB;

--connection default
DELETE d1, d2 FROM t1 AS d1, t1 AS d2 WHERE d1.a<>d2.a;

--exec $MYSQL_BINLOG --force-if-open $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/bug28642318.sql

--connection default
DROP TABLE t1;

--echo # DELETE query fails with table re-open error without patch.
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug28642318.sql

--echo # Clean up.
--connection con1
DROP TABLE IF EXISTS t1;

--connection default
DROP TABLE IF EXISTS t1;
RESET MASTER;

--echo # Test case for DROP query.

--connection default
CREATE TABLE t1 (a INT) ENGINE=INNODB;

--connection con1
CREATE TEMPORARY TABLE t1 (b BLOB) ENGINE=INNODB;

--connection default
DROP TABLE t1;

--connection con1
DROP TABLE t1;

--connection default
--exec $MYSQL_BINLOG --force-if-open $MYSQLD_DATADIR/master-bin.000001 > $MYSQLTEST_VARDIR/tmp/bug28642318.sql

--echo # DROP table query fails with unknown table error without patch.
--exec $MYSQL < $MYSQLTEST_VARDIR/tmp/bug28642318.sql

--echo # Clean up
--connection default
SET @@session.binlog_format= @save_binlog_format;
RESET MASTER;

--disconnect con1
--enable_warnings
5 changes: 5 additions & 0 deletions mysql-test/r/connect_debug.result
Expand Up @@ -3,3 +3,8 @@ set global debug_dbug='+d,auth_disconnect';
create user 'bad' identified by 'worse';
set global debug_dbug=@old_dbug;
drop user bad;
set global debug_dbug='+d,auth_invalid_plugin';
create user 'bad' identified by 'worse';
ERROR 2059 (HY000): Authentication plugin 'foo/bar' cannot be loaded: invalid plugin name
set global debug_dbug=@old_dbug;
drop user bad;
11 changes: 11 additions & 0 deletions mysql-test/r/derived.result
Expand Up @@ -601,6 +601,17 @@ select x.id, message from (select id from t1) x left join
(select id, 1 as message from t2) y on x.id=y.id
where coalesce(message,0) <> 0;
id message
explain extended
select x.id, message from (select id from t1) x left join
(select id, 1 as message from t2) y on x.id=y.id
where message <> 0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 100.00
1 PRIMARY <derived3> ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
3 DERIVED t2 ALL NULL NULL NULL NULL 3 100.00
2 DERIVED t1 ALL NULL NULL NULL NULL 3 100.00
Warnings:
Note 1003 select `x`.`id` AS `id`,`y`.`message` AS `message` from (select `test`.`t1`.`id` AS `id` from `test`.`t1`) `x` join (select `test`.`t2`.`id` AS `id`,1 AS `message` from `test`.`t2`) `y` where ((`y`.`id` = `x`.`id`) and (`y`.`message` <> 0))
drop table t1,t2;
#
# MDEV-7827: Assertion `!table || (!table->read_set ||
Expand Down
59 changes: 58 additions & 1 deletion mysql-test/r/derived_view.result
Expand Up @@ -1298,7 +1298,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1276 Field or reference 't.a' of SELECT #3 was resolved in SELECT #1
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where <in_optimizer>(1,<expr_cache><`test`.`t1`.`a`>(exists(select 28 from `test`.`t3` where ('j' < `test`.`t1`.`a`))))
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where <in_optimizer>(1,<expr_cache><`test`.`t1`.`a`>(exists(select 28 from `test`.`t3` where ('j' < `test`.`t1`.`a`) limit 1)))
SELECT * FROM (SELECT * FROM t1) AS t
WHERE EXISTS (SELECT t2.a FROM t3 RIGHT JOIN t2 ON (t3.a = t2.a)
WHERE t2.b < t.a);
Expand Down Expand Up @@ -3052,3 +3052,60 @@ id select_type table type possible_keys key key_len ref rows Extra
7 DERIVED p9 ALL NULL NULL NULL NULL 550 Using where; Using join buffer (incremental, BNL join)
7 DERIVED p10 ALL NULL NULL NULL NULL 550 Using where; Using join buffer (incremental, BNL join)
DROP TABLE t1, t2;
#
# MDEV-19778: equality condition for mergeable view returning constants
# in its columns and used as inner table of outer join
#
create table t1 (pk int, a int);
insert into t1 values (1,7), (2,3), (3,2), (4,3);
create table t2 (b int);
insert into t2 values (5), (1), (NULL), (3);
create table t3 (c int);
insert into t3 values (1), (8);
create view v1 as
select 3 as d, t2.b from t2;
select * from t1 left join v1 on t1.pk <= 2 where t1.a=v1.d;
pk a d b
2 3 3 5
2 3 3 1
2 3 3 NULL
2 3 3 3
explain extended select * from t1 left join v1 on t1.pk <= 2 where t1.a=v1.d;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 100.00 Using where
1 SIMPLE t2 ALL NULL NULL NULL NULL 4 100.00 Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a` AS `a`,3 AS `d`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` = 3) and (`test`.`t1`.`pk` <= 2))
select * from t1 left join (select 3 as d, t2.b from t2) dt on t1.pk <= 2
where t1.a=dt.d;
pk a d b
2 3 3 5
2 3 3 1
2 3 3 NULL
2 3 3 3
explain extended select * from t1 left join (select 3 as d, t2.b from t2) dt on t1.pk <= 2
where t1.a=dt.d;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 100.00 Using where
1 SIMPLE t2 ALL NULL NULL NULL NULL 4 100.00 Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a` AS `a`,3 AS `d`,`test`.`t2`.`b` AS `b` from `test`.`t1` join `test`.`t2` where ((`test`.`t1`.`a` = 3) and (`test`.`t1`.`pk` <= 2))
select * from t1 left join (v1,t3) on t1.pk <= 2 where t1.a=v1.d;
pk a d b c
2 3 3 5 1
2 3 3 5 8
2 3 3 1 1
2 3 3 1 8
2 3 3 NULL 1
2 3 3 NULL 8
2 3 3 3 1
2 3 3 3 8
explain extended select * from t1 left join (v1,t3) on t1.pk <= 2 where t1.a=v1.d;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 100.00 Using where; Using join buffer (flat, BNL join)
1 SIMPLE t2 ALL NULL NULL NULL NULL 4 100.00 Using join buffer (incremental, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a` AS `a`,3 AS `d`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`c` AS `c` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t1`.`a` = 3) and (`test`.`t1`.`pk` <= 2))
drop view v1;
drop table t1,t2,t3;
2 changes: 2 additions & 0 deletions mysql-test/r/func_group.result
Expand Up @@ -1981,6 +1981,7 @@ NULL
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'j'
Warning 1292 Truncated incorrect DOUBLE value: 'j'
Warning 1292 Truncated incorrect DOUBLE value: 'j'

EXPLAIN
SELECT MIN(t2.pk)
Expand All @@ -1995,6 +1996,7 @@ id select_type table type possible_keys key key_len ref rows Extra
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'j'
Warning 1292 Truncated incorrect DOUBLE value: 'j'
Warning 1292 Truncated incorrect DOUBLE value: 'j'

#
# 2) Test that subquery materialization is setup for query with
Expand Down
4 changes: 2 additions & 2 deletions mysql-test/r/information_schema_parameters.result
Expand Up @@ -392,15 +392,15 @@ SPECIFIC_CATALOG SPECIFIC_SCHEMA SPECIFIC_NAME ORDINAL_POSITION PARAMETER_MODE P
DROP DATABASE IF EXISTS i_s_parameters_test;
CREATE DATABASE i_s_parameters_test;
USE i_s_parameters_test;
CREATE PROCEDURE testproc (OUT param1 INT)
CREATE PROCEDURE testproc (IN param1 INT)
BEGIN
SELECT 2+2 as param1;
END;
//
SELECT * FROM INFORMATION_SCHEMA.PARAMETERS
WHERE SPECIFIC_SCHEMA = 'i_s_parameters_test' AND SPECIFIC_NAME = 'testproc';
SPECIFIC_CATALOG SPECIFIC_SCHEMA SPECIFIC_NAME ORDINAL_POSITION PARAMETER_MODE PARAMETER_NAME DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_TYPE
def i_s_parameters_test testproc 1 OUT param1 int NULL NULL 10 0 NULL NULL NULL int(11) PROCEDURE
def i_s_parameters_test testproc 1 IN param1 int NULL NULL 10 0 NULL NULL NULL int(11) PROCEDURE
# ========== parameters.5 ==========
DROP DATABASE IF EXISTS i_s_parameters_test;
CREATE DATABASE i_s_parameters_test;
Expand Down

0 comments on commit ae47686

Please sign in to comment.