Commit 30df297c authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 10.0 into 10.1

Rewrite the test encryption.innodb-checksum-algorithm not to
require any restarts or re-bootstrapping, and to cover all
innodb_page_size combinations.

Test innodb.101_compatibility with all innodb_page_size combinations.
parents da61107f d8d39721
[64k]
innodb-page-size=64K
innodb-buffer-pool-size=24M
[32k]
innodb-page-size=32K
innodb-buffer-pool-size=24M
[16k]
innodb-page-size=16K
[8k]
innodb-page-size=8K
[4k]
innodb-page-size=4K
# The goal of including this file is to enable innodb_page_size combinations
# (see include/innodb_page_size.combinations)
--source include/have_innodb.inc
[16k]
innodb-page-size=16K
[8k]
innodb-page-size=8K
[4k]
innodb-page-size=4K
# The goal of including this file is to enable innodb_page_size combinations
# (see include/innodb_page_size.combinations)
--source include/have_innodb.inc
......@@ -2812,15 +2812,26 @@ sub mysql_server_start($) {
}
my $mysqld_basedir= $mysqld->value('basedir');
my $extra_opts= get_extra_opts($mysqld, $tinfo);
if ( $basedir eq $mysqld_basedir )
{
if (! $opt_start_dirty) # If dirty, keep possibly grown system db
{
# Copy datadir from installed system db
my $path= ($opt_parallel == 1) ? "$opt_vardir" : "$opt_vardir/..";
my $install_db= "$path/install.db";
copytree($install_db, $datadir) if -d $install_db;
mtr_error("Failed to copy system db to '$datadir'") unless -d $datadir;
# Some InnoDB options are incompatible with the default bootstrap.
# If they are used, re-bootstrap
if ( $extra_opts and
"@$extra_opts" =~ /--innodb[-_](?:page[-_]size|checksum[-_]algorithm|undo[-_]tablespaces|log[-_]group[-_]home[-_]dir|data[-_]home[-_]dir)/ )
{
mysql_install_db($mysqld, undef, $extra_opts);
}
else {
# Copy datadir from installed system db
my $path= ($opt_parallel == 1) ? "$opt_vardir" : "$opt_vardir/..";
my $install_db= "$path/install.db";
copytree($install_db, $datadir) if -d $install_db;
mtr_error("Failed to copy system db to '$datadir'") unless -d $datadir;
}
}
}
else
......@@ -2859,7 +2870,6 @@ sub mysql_server_start($) {
if (!$opt_embedded_server)
{
my $extra_opts= get_extra_opts($mysqld, $tinfo);
mysqld_start($mysqld,$extra_opts);
# Save this test case information, so next can examine it
......@@ -3083,7 +3093,7 @@ sub default_mysqld {
sub mysql_install_db {
my ($mysqld, $datadir)= @_;
my ($mysqld, $datadir, $extra_opts)= @_;
my $install_datadir= $datadir || $mysqld->value('datadir');
my $install_basedir= $mysqld->value('basedir');
......@@ -3124,6 +3134,13 @@ sub mysql_install_db {
mtr_add_arg($args, $extra_opt);
}
}
# InnoDB options can come not only from the command line, but also
# from option files or combinations
foreach my $extra_opt ( @$extra_opts ) {
if ($extra_opt =~ /--innodb/) {
mtr_add_arg($args, $extra_opt);
}
}
# If DISABLE_GRANT_OPTIONS is defined when the server is compiled (e.g.,
# configure --disable-grant-options), mysqld will not recognize the
......
......@@ -2339,4 +2339,99 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t1`.`v1` AS `v1`,`test`.`t2`.`i2` AS `i2`,`test`.`t2`.`v2` AS `v2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`v3` AS `v3` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`v3` = 4) and (`test`.`t1`.`i1` = `test`.`t3`.`i3`) and (`test`.`t2`.`i2` = `test`.`t3`.`i3`))
drop table t1,t2,t3;
#
# MDEV-11958: LEFT JOIN with stored routine produces incorrect result
#
CREATE TABLE t (x INT);
INSERT INTO t VALUES(1),(NULL);
CREATE FUNCTION f (val INT, ret INT) RETURNS INT DETERMINISTIC RETURN IFNULL(val, ret);
SELECT t1.x, t2.x, IFNULL(t2.x,0), f(t2.x,0)
FROM t t1 LEFT JOIN t t2
ON t1.x = t2.x
WHERE IFNULL(t2.x,0)=0;
x x IFNULL(t2.x,0) f(t2.x,0)
NULL NULL 0 0
explain extended
SELECT t1.x, t2.x, IFNULL(t2.x,0), f(t2.x,0)
FROM t t1 LEFT JOIN t t2
ON t1.x = t2.x
WHERE IFNULL(t2.x,0)=0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t2`.`x` AS `x`,ifnull(`test`.`t2`.`x`,0) AS `IFNULL(t2.x,0)`,`f`(`test`.`t2`.`x`,0) AS `f(t2.x,0)` from `test`.`t` `t1` left join `test`.`t` `t2` on((`test`.`t2`.`x` = `test`.`t1`.`x`)) where (ifnull(`test`.`t2`.`x`,0) = 0)
SELECT t1.x, t2.x, IFNULL(t2.x,0), f(t2.x,0)
FROM t t1 LEFT JOIN t t2
ON t1.x = t2.x
WHERE f(t2.x,0)=0;
x x IFNULL(t2.x,0) f(t2.x,0)
NULL NULL 0 0
explain extended
SELECT t1.x, t2.x, IFNULL(t2.x,0), f(t2.x,0)
FROM t t1 LEFT JOIN t t2
ON t1.x = t2.x
WHERE f(t2.x,0)=0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t2`.`x` AS `x`,ifnull(`test`.`t2`.`x`,0) AS `IFNULL(t2.x,0)`,`f`(`test`.`t2`.`x`,0) AS `f(t2.x,0)` from `test`.`t` `t1` left join `test`.`t` `t2` on((`test`.`t2`.`x` = `test`.`t1`.`x`)) where (`f`(`test`.`t2`.`x`,0) = 0)
drop function f;
drop table t;
CREATE TABLE t1 (
col1 DECIMAL(33,5) NULL DEFAULT NULL,
col2 DECIMAL(33,5) NULL DEFAULT NULL
);
CREATE TABLE t2 (
col1 DECIMAL(33,5) NULL DEFAULT NULL,
col2 DECIMAL(33,5) NULL DEFAULT NULL,
col3 DECIMAL(33,5) NULL DEFAULT NULL
);
INSERT INTO t1 VALUES (2, 1.1), (2, 2.1);
INSERT INTO t2 VALUES (3, 3.1, 4), (1, 1, NULL);
CREATE FUNCTION f1 ( p_num DECIMAL(45,15), p_return DECIMAL(45,15))
RETURNS decimal(33,5)
LANGUAGE SQL
DETERMINISTIC
CONTAINS SQL
SQL SECURITY INVOKER
BEGIN
IF p_num IS NULL THEN
RETURN p_return;
ELSE
RETURN p_num;
END IF;
END |
SELECT t1.col1, t2.col1, t2.col3
FROM t1 LEFT OUTER JOIN t2 ON t1.col1 = t2.col2
WHERE IFNULL(t2.col3,0) = 0;
col1 col1 col3
2.00000 NULL NULL
2.00000 NULL NULL
EXPLAIN EXTENDED SELECT t1.col1, t2.col1, t2.col3
FROM t1 LEFT OUTER JOIN t2 ON t1.col1 = t2.col2
WHERE IFNULL(t2.col3,0) = 0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`col1` AS `col1`,`test`.`t2`.`col1` AS `col1`,`test`.`t2`.`col3` AS `col3` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`col2` = `test`.`t1`.`col1`)) where (ifnull(`test`.`t2`.`col3`,0) = 0)
SELECT t1.col1, t2.col1, t2.col3
FROM t1 LEFT OUTER JOIN t2 ON t1.col1 = t2.col2
WHERE f1(t2.col3,0) = 0;
col1 col1 col3
2.00000 NULL NULL
2.00000 NULL NULL
EXPLAIN EXTENDED SELECT t1.col1, t2.col1, t2.col3
FROM t1 LEFT OUTER JOIN t2 ON t1.col1 = t2.col2
WHERE f1(t2.col3,0) = 0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`col1` AS `col1`,`test`.`t2`.`col1` AS `col1`,`test`.`t2`.`col3` AS `col3` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`col2` = `test`.`t1`.`col1`)) where (`f1`(`test`.`t2`.`col3`,0) = 0)
DROP FUNCTION f1;
DROP TABLE t1,t2;
# end of 5.5 tests
SET optimizer_switch=@save_optimizer_switch;
......@@ -2350,6 +2350,101 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select `test`.`t1`.`i1` AS `i1`,`test`.`t1`.`v1` AS `v1`,`test`.`t2`.`i2` AS `i2`,`test`.`t2`.`v2` AS `v2`,`test`.`t3`.`i3` AS `i3`,`test`.`t3`.`v3` AS `v3` from `test`.`t1` join `test`.`t2` join `test`.`t3` where ((`test`.`t3`.`v3` = 4) and (`test`.`t1`.`i1` = `test`.`t3`.`i3`) and (`test`.`t2`.`i2` = `test`.`t3`.`i3`))
drop table t1,t2,t3;
#
# MDEV-11958: LEFT JOIN with stored routine produces incorrect result
#
CREATE TABLE t (x INT);
INSERT INTO t VALUES(1),(NULL);
CREATE FUNCTION f (val INT, ret INT) RETURNS INT DETERMINISTIC RETURN IFNULL(val, ret);
SELECT t1.x, t2.x, IFNULL(t2.x,0), f(t2.x,0)
FROM t t1 LEFT JOIN t t2
ON t1.x = t2.x
WHERE IFNULL(t2.x,0)=0;
x x IFNULL(t2.x,0) f(t2.x,0)
NULL NULL 0 0
explain extended
SELECT t1.x, t2.x, IFNULL(t2.x,0), f(t2.x,0)
FROM t t1 LEFT JOIN t t2
ON t1.x = t2.x
WHERE IFNULL(t2.x,0)=0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t2`.`x` AS `x`,ifnull(`test`.`t2`.`x`,0) AS `IFNULL(t2.x,0)`,`f`(`test`.`t2`.`x`,0) AS `f(t2.x,0)` from `test`.`t` `t1` left join `test`.`t` `t2` on((`test`.`t2`.`x` = `test`.`t1`.`x`)) where (ifnull(`test`.`t2`.`x`,0) = 0)
SELECT t1.x, t2.x, IFNULL(t2.x,0), f(t2.x,0)
FROM t t1 LEFT JOIN t t2
ON t1.x = t2.x
WHERE f(t2.x,0)=0;
x x IFNULL(t2.x,0) f(t2.x,0)
NULL NULL 0 0
explain extended
SELECT t1.x, t2.x, IFNULL(t2.x,0), f(t2.x,0)
FROM t t1 LEFT JOIN t t2
ON t1.x = t2.x
WHERE f(t2.x,0)=0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`x` AS `x`,`test`.`t2`.`x` AS `x`,ifnull(`test`.`t2`.`x`,0) AS `IFNULL(t2.x,0)`,`f`(`test`.`t2`.`x`,0) AS `f(t2.x,0)` from `test`.`t` `t1` left join `test`.`t` `t2` on((`test`.`t2`.`x` = `test`.`t1`.`x`)) where (`f`(`test`.`t2`.`x`,0) = 0)
drop function f;
drop table t;
CREATE TABLE t1 (
col1 DECIMAL(33,5) NULL DEFAULT NULL,
col2 DECIMAL(33,5) NULL DEFAULT NULL
);
CREATE TABLE t2 (
col1 DECIMAL(33,5) NULL DEFAULT NULL,
col2 DECIMAL(33,5) NULL DEFAULT NULL,
col3 DECIMAL(33,5) NULL DEFAULT NULL
);
INSERT INTO t1 VALUES (2, 1.1), (2, 2.1);
INSERT INTO t2 VALUES (3, 3.1, 4), (1, 1, NULL);
CREATE FUNCTION f1 ( p_num DECIMAL(45,15), p_return DECIMAL(45,15))
RETURNS decimal(33,5)
LANGUAGE SQL
DETERMINISTIC
CONTAINS SQL
SQL SECURITY INVOKER
BEGIN
IF p_num IS NULL THEN
RETURN p_return;
ELSE
RETURN p_num;
END IF;
END |
SELECT t1.col1, t2.col1, t2.col3
FROM t1 LEFT OUTER JOIN t2 ON t1.col1 = t2.col2
WHERE IFNULL(t2.col3,0) = 0;
col1 col1 col3
2.00000 NULL NULL
2.00000 NULL NULL
EXPLAIN EXTENDED SELECT t1.col1, t2.col1, t2.col3
FROM t1 LEFT OUTER JOIN t2 ON t1.col1 = t2.col2
WHERE IFNULL(t2.col3,0) = 0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`col1` AS `col1`,`test`.`t2`.`col1` AS `col1`,`test`.`t2`.`col3` AS `col3` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`col2` = `test`.`t1`.`col1`)) where (ifnull(`test`.`t2`.`col3`,0) = 0)
SELECT t1.col1, t2.col1, t2.col3
FROM t1 LEFT OUTER JOIN t2 ON t1.col1 = t2.col2
WHERE f1(t2.col3,0) = 0;
col1 col1 col3
2.00000 NULL NULL
2.00000 NULL NULL
EXPLAIN EXTENDED SELECT t1.col1, t2.col1, t2.col3
FROM t1 LEFT OUTER JOIN t2 ON t1.col1 = t2.col2
WHERE f1(t2.col3,0) = 0;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
Warnings:
Note 1003 select `test`.`t1`.`col1` AS `col1`,`test`.`t2`.`col1` AS `col1`,`test`.`t2`.`col3` AS `col3` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`col2` = `test`.`t1`.`col1`)) where (`f1`(`test`.`t2`.`col3`,0) = 0)
DROP FUNCTION f1;
DROP TABLE t1,t2;
# end of 5.5 tests
SET optimizer_switch=@save_optimizer_switch;
set join_cache_level=default;
show variables like 'join_cache_level';
......
--- suite/encryption/r/innodb-checksum-algorithm.result
+++ suite/encryption/r/innodb-checksum-algorithm,32k.reject
@@ -13,9 +13,9 @@
SET GLOBAL innodb_default_encryption_key_id=4;
SET GLOBAL innodb_checksum_algorithm=crc32;
create table tce_crc32(a serial, b blob, index(b(10))) engine=innodb
-ROW_FORMAT=COMPRESSED encrypted=yes;
+ROW_FORMAT=DYNAMIC encrypted=yes;
create table tc_crc32(a serial, b blob, index(b(10))) engine=innodb
-ROW_FORMAT=COMPRESSED encrypted=no;
+ROW_FORMAT=DYNAMIC encrypted=no;
create table te_crc32(a serial, b blob, index(b(10))) engine=innodb
encrypted=yes;
create table t_crc32(a serial, b blob, index(b(10))) engine=innodb
@@ -222,9 +222,9 @@
t_crc32, tpe_crc32, tp_crc32;
SET GLOBAL innodb_checksum_algorithm=innodb;
create table tce_innodb(a serial, b blob, index(b(10))) engine=innodb
-ROW_FORMAT=COMPRESSED encrypted=yes;
+ROW_FORMAT=DYNAMIC encrypted=yes;
create table tc_innodb(a serial, b blob, index(b(10))) engine=innodb
-ROW_FORMAT=COMPRESSED encrypted=no;
+ROW_FORMAT=DYNAMIC encrypted=no;
create table te_innodb(a serial, b blob, index(b(10))) engine=innodb
encrypted=yes;
create table t_innodb(a serial, b blob, index(b(10))) engine=innodb
@@ -431,9 +431,9 @@
t_innodb, tpe_innodb, tp_innodb;
SET GLOBAL innodb_checksum_algorithm=none;
create table tce_none(a serial, b blob, index(b(10))) engine=innodb
-ROW_FORMAT=COMPRESSED encrypted=yes;
+ROW_FORMAT=DYNAMIC encrypted=yes;
create table tc_none(a serial, b blob, index(b(10))) engine=innodb
-ROW_FORMAT=COMPRESSED encrypted=no;
+ROW_FORMAT=DYNAMIC encrypted=no;
create table te_none(a serial, b blob, index(b(10))) engine=innodb
encrypted=yes;
create table t_none(a serial, b blob, index(b(10))) engine=innodb
--- suite/encryption/r/innodb-checksum-algorithm.result
+++ suite/encryption/r/innodb-checksum-algorithm,64k.reject
@@ -13,9 +13,9 @@
SET GLOBAL innodb_default_encryption_key_id=4;
SET GLOBAL innodb_checksum_algorithm=crc32;
create table tce_crc32(a serial, b blob, index(b(10))) engine=innodb
-ROW_FORMAT=COMPRESSED encrypted=yes;
+ROW_FORMAT=DYNAMIC encrypted=yes;
create table tc_crc32(a serial, b blob, index(b(10))) engine=innodb
-ROW_FORMAT=COMPRESSED encrypted=no;
+ROW_FORMAT=DYNAMIC encrypted=no;
create table te_crc32(a serial, b blob, index(b(10))) engine=innodb
encrypted=yes;
create table t_crc32(a serial, b blob, index(b(10))) engine=innodb
@@ -222,9 +222,9 @@
t_crc32, tpe_crc32, tp_crc32;
SET GLOBAL innodb_checksum_algorithm=innodb;
create table tce_innodb(a serial, b blob, index(b(10))) engine=innodb
-ROW_FORMAT=COMPRESSED encrypted=yes;
+ROW_FORMAT=DYNAMIC encrypted=yes;
create table tc_innodb(a serial, b blob, index(b(10))) engine=innodb
-ROW_FORMAT=COMPRESSED encrypted=no;
+ROW_FORMAT=DYNAMIC encrypted=no;
create table te_innodb(a serial, b blob, index(b(10))) engine=innodb
encrypted=yes;
create table t_innodb(a serial, b blob, index(b(10))) engine=innodb
@@ -431,9 +431,9 @@
t_innodb, tpe_innodb, tp_innodb;
SET GLOBAL innodb_checksum_algorithm=none;
create table tce_none(a serial, b blob, index(b(10))) engine=innodb
-ROW_FORMAT=COMPRESSED encrypted=yes;
+ROW_FORMAT=DYNAMIC encrypted=yes;
create table tc_none(a serial, b blob, index(b(10))) engine=innodb
-ROW_FORMAT=COMPRESSED encrypted=no;
+ROW_FORMAT=DYNAMIC encrypted=no;
create table te_none(a serial, b blob, index(b(10))) engine=innodb
encrypted=yes;
create table t_none(a serial, b blob, index(b(10))) engine=innodb
--innodb_checksum_algorithm=innodb
--innodb-tablespaces-encryption
--innodb-encrypt-tables=on
--innodb-encryption-threads=4
--source include/have_innodb.inc
--source include/innodb_page_size.inc
--source include/not_embedded.inc
-- echo #
......
--source include/have_innodb.inc
--source include/innodb_page_size.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc
......
#Bug#13955083 ALLOW IN-PLACE DDL OPERATIONS ON MISSING OR DISCARDED TABLESPACES
--source include/not_embedded.inc
--source include/have_innodb.inc
--source include/innodb_page_size.inc
let $MYSQLD_DATADIR=`select @@datadir`;
SET GLOBAL innodb_file_per_table=1;
......
--source include/have_innodb.inc
--source include/innodb_page_size.inc
# Save the initial number of concurrent sessions.
--source include/count_sessions.inc
......
--source include/have_innodb.inc
--source include/innodb_page_size.inc
#
# MMDEV-8386: MariaDB creates very big tmp file and hangs on xtradb
......
......@@ -10,8 +10,7 @@
# Avoid CrashReporter popup on Mac
--source include/not_crashrep.inc
# InnoDB is required
--source include/have_innodb.inc
--source include/innodb_page_size.inc
--echo #
--echo # Bug #18734396 INNODB IN-PLACE ALTER FAILURES BLOCK FUTURE ALTERS
......
DROP DATABASE IF EXISTS mysqltest_innodb_zip;
CREATE DATABASE mysqltest_innodb_zip;
USE mysqltest_innodb_zip;
SELECT table_name, row_format, data_length, index_length
......@@ -379,5 +378,4 @@ select @@innodb_file_format_max;
@@innodb_file_format_max
Barracuda
drop table normal_table, zip_table;
USE test;
DROP DATABASE mysqltest_innodb_zip;
--source include/have_innodb.inc
--source include/innodb_page_size_small.inc
# Tests for various combinations of ROW_FORMAT and KEY_BLOCK_SIZE
# Related bugs;
# Bug#54679: ALTER TABLE causes compressed row_format to revert to compact
......
-- source include/have_innodb.inc
--disable_warnings
DROP DATABASE IF EXISTS mysqltest_innodb_zip;
--enable_warnings
--source include/innodb_page_size_small.inc
CREATE DATABASE mysqltest_innodb_zip;
USE mysqltest_innodb_zip;
......@@ -13,7 +8,6 @@ SELECT table_name, row_format, data_length, index_length
let $per_table=`select @@innodb_file_per_table`;
let $format=`select @@innodb_file_format`;
let $innodb_strict_mode_orig=`select @@session.innodb_strict_mode`;
let $innodb_file_format_orig=`select @@innodb_file_format`;
let $innodb_file_format_max_orig=`select @@innodb_file_format_max`;
SET @save_innodb_stats_on_metadata=@@global.innodb_stats_on_metadata;
......@@ -363,12 +357,9 @@ drop table normal_table, zip_table;
-- disable_query_log
eval set global innodb_file_format=$format;
eval set global innodb_file_per_table=$per_table;
eval set session innodb_strict_mode=$innodb_strict_mode_orig;
eval SET GLOBAL innodb_file_format=$innodb_file_format_orig;
eval SET GLOBAL innodb_file_format_max=$innodb_file_format_max_orig;
SET @@global.innodb_stats_on_metadata=@save_innodb_stats_on_metadata;
--enable_query_log
USE test;
DROP DATABASE mysqltest_innodb_zip;
--source include/have_innodb.inc
--source include/innodb_page_size_small.inc
#
# Bug#36169 create innodb compressed table with too large row size crashed
# http://bugs.mysql.com/36169
......
--source include/have_innodb.inc
--source include/innodb_page_size_small.inc
#
# Test case for bug 36172
#
......
-- source include/have_innodb.inc
--source include/innodb_page_size_small.inc
let $file_format=`select @@innodb_file_format`;
let $file_per_table=`select @@innodb_file_per_table`;
......
-- source include/have_innodb.inc
--source include/innodb_page_size_small.inc
let $file_format=`select @@innodb_file_format`;
let $file_per_table=`select @@innodb_file_per_table`;
......
--source include/have_innodb.inc
--source include/innodb_page_size_small.inc
#
# Bug #56680 InnoDB may return wrong results from a case-insensitive index
#
......
......@@ -1882,4 +1882,86 @@ WHERE v3 = 4;
drop table t1,t2,t3;
--echo #
--echo # MDEV-11958: LEFT JOIN with stored routine produces incorrect result
--echo #
CREATE TABLE t (x INT);
INSERT INTO t VALUES(1),(NULL);
CREATE FUNCTION f (val INT, ret INT) RETURNS INT DETERMINISTIC RETURN IFNULL(val, ret);
SELECT t1.x, t2.x, IFNULL(t2.x,0), f(t2.x,0)
FROM t t1 LEFT JOIN t t2
ON t1.x = t2.x
WHERE IFNULL(t2.x,0)=0;
explain extended
SELECT t1.x, t2.x, IFNULL(t2.x,0), f(t2.x,0)
FROM t t1 LEFT JOIN t t2
ON t1.x = t2.x
WHERE IFNULL(t2.x,0)=0;
SELECT t1.x, t2.x, IFNULL(t2.x,0), f(t2.x,0)
FROM t t1 LEFT JOIN t t2
ON t1.x = t2.x
WHERE f(t2.x,0)=0;
explain extended
SELECT t1.x, t2.x, IFNULL(t2.x,0), f(t2.x,0)
FROM t t1 LEFT JOIN t t2
ON t1.x = t2.x
WHERE f(t2.x,0)=0;
drop function f;
drop table t;
CREATE TABLE t1 (
col1 DECIMAL(33,5) NULL DEFAULT NULL,
col2 DECIMAL(33,5) NULL DEFAULT NULL
);
CREATE TABLE t2 (
col1 DECIMAL(33,5) NULL DEFAULT NULL,
col2 DECIMAL(33,5) NULL DEFAULT NULL,
col3 DECIMAL(33,5) NULL DEFAULT NULL
);
INSERT INTO t1 VALUES (2, 1.1), (2, 2.1);
INSERT INTO t2 VALUES (3, 3.1, 4), (1, 1, NULL);
DELIMITER |;
CREATE FUNCTION f1 ( p_num DECIMAL(45,15), p_return DECIMAL(45,15))
RETURNS decimal(33,5)
LANGUAGE SQL
DETERMINISTIC
CONTAINS SQL
SQL SECURITY INVOKER
BEGIN
IF p_num IS NULL THEN
RETURN p_return;
ELSE
RETURN p_num;
END IF;
END |
DELIMITER ;|
let $q1=
SELECT t1.col1, t2.col1, t2.col3
FROM t1 LEFT OUTER JOIN t2 ON t1.col1 = t2.col2
WHERE IFNULL(t2.col3,0) = 0;
eval $q1;
eval EXPLAIN EXTENDED $q1;
let $q2=
SELECT t1.col1, t2.col1, t2.col3
FROM t1 LEFT OUTER JOIN t2 ON t1.col1 = t2.col2
WHERE f1(t2.col3,0) = 0;
eval $q2;
eval EXPLAIN EXTENDED $q2;
DROP FUNCTION f1;
DROP TABLE t1,t2;
--echo # end of 5.5 tests
SET optimizer_switch=@save_optimizer_switch;
......@@ -1162,7 +1162,11 @@ class Item_func_coercibility :public Item_int_func
longlong val_int();
const char *func_name() const { return "coercibility"; }
void fix_length_and_dec() { max_length=10; maybe_null= 0; }
table_map not_null_tables() const { return 0; }
bool eval_not_null_tables(uchar *)
{
not_null_tables_cache= 0;
return false;
}
Item* propagate_equal_fields(THD *thd, const Context &ctx, COND_EQUAL *cond)
{ return this; }
bool const_item() const { return true; }
......@@ -1444,7 +1448,11 @@ class Item_udf_func :public Item_func
}
void cleanup();
Item_result result_type () const { return udf.result_type(); }
table_map not_null_tables() const { return 0; }
bool eval_not_null_tables(uchar *opt_arg)
{
not_null_tables_cache= 0;
return 0;
}
bool is_expensive() { return 1; }
virtual void print(String *str, enum_query_type query_type);
};
......@@ -1940,7 +1948,11 @@ class Item_func_match :public Item_real_func
bool is_expensive_processor(uchar *arg) { return TRUE; }
enum Functype functype() const { return FT_FUNC; }
const char *func_name() const { return "match"; }
table_map not_null_tables() const { return 0; }
bool eval_not_null_tables(uchar *opt_arg)
{
not_null_tables_cache= 0;
return 0;
}
bool fix_fields(THD *thd, Item **ref);
bool eq(const Item *, bool binary_cmp) const;
/* The following should be safe, even if we compare doubles */
......@@ -2181,6 +2193,11 @@ class Item_func_sp :public Item_func
{
return TRUE;
}
bool eval_not_null_tables(uchar *opt_arg)
{
not_null_tables_cache= 0;
return 0;
}
};
......@@ -2228,7 +2245,11 @@ class Item_func_last_value :public Item_func
void fix_length_and_dec();
enum Item_result result_type () const { return last_value->result_type(); }
const char *func_name() const { return "last_value"; }
table_map not_null_tables() const { return 0; }
bool eval_not_null_tables(uchar *opt_arg)
{
not_null_tables_cache= 0;
return 0;
}
enum_field_types field_type() const { return last_value->field_type(); }
bool const_item() const { return 0; }
void evaluate_sideeffects();
......
......@@ -3386,18 +3386,12 @@ buf_page_get_gen(
goto loop;
}
fprintf(stderr,
"innodb_change_buffering_debug evict %u %u\n",
(unsigned) space, (unsigned) offset);
return(NULL);
}
mutex_enter(&fix_block->mutex);
if (buf_flush_page_try(buf_pool, fix_block)) {
fprintf(stderr,
"innodb_change_buffering_debug flush %u %u\n",
(unsigned) space, (unsigned) offset);
guess = fix_block;
goto loop;
}
......
......@@ -2507,7 +2507,7 @@ DECLARE_THREAD(srv_master_thread)(
case SRV_SHUTDOWN_CLEANUP:
if (srv_shutdown_state == SRV_SHUTDOWN_CLEANUP
&& srv_fast_shutdown < 2) {
srv_shutdown(srv_fast_shutdown == 1);
srv_shutdown(srv_fast_shutdown == 0);
}
srv_suspend_thread(slot);
my_thread_end();
......
......@@ -3446,17 +3446,10 @@ buf_page_get_gen(
goto loop;
}
fprintf(stderr,
"innodb_change_buffering_debug evict %u %u\n",
(unsigned) space, (unsigned) offset);
return(NULL);
}
if (buf_flush_page_try(buf_pool, fix_block)) {
fprintf(stderr,
"innodb_change_buffering_debug flush %u %u\n",
(unsigned) space, (unsigned) offset);
guess = fix_block;
goto loop;
}
......
......@@ -3193,7 +3193,7 @@ DECLARE_THREAD(srv_master_thread)(
case SRV_SHUTDOWN_CLEANUP:
if (srv_shutdown_state == SRV_SHUTDOWN_CLEANUP
&& srv_fast_shutdown < 2) {
srv_shutdown(srv_fast_shutdown == 1);
srv_shutdown(srv_fast_shutdown == 0);
}
srv_suspend_thread(slot);
my_thread_end();
......
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