mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
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.
This commit is contained in:
commit
30df297c2f
32 changed files with 1194 additions and 1429 deletions
16
mysql-test/include/innodb_page_size.combinations
Normal file
16
mysql-test/include/innodb_page_size.combinations
Normal file
|
@ -0,0 +1,16 @@
|
|||
[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
|
4
mysql-test/include/innodb_page_size.inc
Normal file
4
mysql-test/include/innodb_page_size.inc
Normal file
|
@ -0,0 +1,4 @@
|
|||
# The goal of including this file is to enable innodb_page_size combinations
|
||||
# (see include/innodb_page_size.combinations)
|
||||
|
||||
--source include/have_innodb.inc
|
8
mysql-test/include/innodb_page_size_small.combinations
Normal file
8
mysql-test/include/innodb_page_size_small.combinations
Normal file
|
@ -0,0 +1,8 @@
|
|||
[16k]
|
||||
innodb-page-size=16K
|
||||
|
||||
[8k]
|
||||
innodb-page-size=8K
|
||||
|
||||
[4k]
|
||||
innodb-page-size=4K
|
4
mysql-test/include/innodb_page_size_small.inc
Normal file
4
mysql-test/include/innodb_page_size_small.inc
Normal file
|
@ -0,0 +1,4 @@
|
|||
# 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';
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
--- 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
|
|
@ -0,0 +1,38 @@
|
|||
--- 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
|
File diff suppressed because it is too large
Load diff
|
@ -1,4 +0,0 @@
|
|||
--innodb_checksum_algorithm=innodb
|
||||
--innodb-tablespaces-encryption
|
||||
--innodb-encrypt-tables=on
|
||||
--innodb-encryption-threads=4
|
|
@ -1,652 +1,123 @@
|
|||
-- source include/have_innodb.inc
|
||||
-- source include/innodb_page_size.inc
|
||||
-- source include/have_file_key_management_plugin.inc
|
||||
|
||||
# embedded does not support restart
|
||||
-- source include/not_embedded.inc
|
||||
SET @saved_file_format = @@global.innodb_file_format;
|
||||
SET @saved_file_per_table = @@global.innodb_file_per_table;
|
||||
SET @saved_checksum_algorithm = @@global.innodb_checksum_algorithm;
|
||||
SET @saved_encrypt_tables = @@global.innodb_encrypt_tables;
|
||||
SET @saved_encryption_threads = @@global.innodb_encryption_threads;
|
||||
SET @saved_encryption_key_id = @@global.innodb_default_encryption_key_id;
|
||||
|
||||
#
|
||||
# Tests:
|
||||
#
|
||||
# innodb
|
||||
# 1) innodb => crc32
|
||||
# 2) crc32 => innodb
|
||||
# 3) innodb => none
|
||||
# 4) none => innodb
|
||||
# 5) innodb => strict_innodb
|
||||
# 6) strict_innodb => innodb
|
||||
# 7) innodb => strict_none
|
||||
# 8) strict_none => innodb
|
||||
# 9) innodb => strict_crc32
|
||||
# 10) strict_crc32 => innodb
|
||||
#
|
||||
# crc32
|
||||
# 11) crc32 => strict_crc32
|
||||
# 12) strict_crc32 => crc32
|
||||
# 13) crc32 => strict_none
|
||||
# 14) strict_none => crc32
|
||||
# 15) crc32 => strict_innodb
|
||||
# 16) strict_innodb => crc32
|
||||
# 17) crc32 => none
|
||||
# 18) none => crc32
|
||||
# (note that innodb is handled on 1 and 2)
|
||||
#
|
||||
# strict_crc32
|
||||
# 19) strict_crc32 => strict_none
|
||||
# 20) strict_none => strict_crc32
|
||||
# 21) strict_crc32 => strict_innodb
|
||||
# 22) strict_innodb => strict_crc32
|
||||
# 23) strict_crc32 => none
|
||||
# 24) none => strict_crc32
|
||||
# (note that innodb is handled on 9 and 10)
|
||||
# (note that crc32 is handled on 11 and 12)
|
||||
#
|
||||
# strict_none
|
||||
# 25) strict_none => none
|
||||
# 26) none => strict_none
|
||||
# 27) strict_none = strict_innodb
|
||||
# 28) strict_innodb => strict_none
|
||||
# (note that innodb is handled on 7 and 8)
|
||||
# (note that crc32 is handled on 13 and 14)
|
||||
# (note that strict_crc32 is handled 19 and 20)
|
||||
#
|
||||
# none
|
||||
# 29) none => strict_innodb
|
||||
# 30) strict_innodb => none
|
||||
# (note that innodb is handled on 3 and 4)
|
||||
# (note that crc32 is handled on 17 and 18)
|
||||
# (note that strict_crc32 is handled on 23 and 24)
|
||||
# (note that strict_none is handled on 25 and 26)
|
||||
#
|
||||
# strict_innodb
|
||||
# (note that innodb is handled on 5 and 6)
|
||||
# (note that crc32 is handled on 15 and 16)
|
||||
# (note that strict_crc32 is handled on 21 and 22)
|
||||
# (note that strict_none is handled on 27 and 28)
|
||||
# (note that none is handled on 29 and 30)
|
||||
#
|
||||
--disable_warnings
|
||||
SET GLOBAL innodb_file_format = `Barracuda`;
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
SET GLOBAL innodb_encrypt_tables = ON;
|
||||
SET GLOBAL innodb_encryption_threads = 4;
|
||||
|
||||
call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to \"strict_crc32\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"innodb\". Accepting the page as valid. Change innodb_checksum_algorithm to \"crc32\" to silently accept such pages or rewrite all pages so that they contain \"crc32\" checksum.");
|
||||
call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to \"strict_(crc32|none|innodb)\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"(innodb|none|crc32)\"");
|
||||
|
||||
call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to \"strict_none\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"innodb\". Accepting the page as valid. Change innodb_checksum_algorithm to \"none\" to silently accept such pages or rewrite all pages so that they contain \"none\" checksum.");
|
||||
SET GLOBAL innodb_checksum_algorithm = innodb;
|
||||
SET GLOBAL innodb_default_encryption_key_id=4;
|
||||
|
||||
call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to \"strict_crc32\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"none\". Accepting the page as valid. Change innodb_checksum_algorithm to \"crc32\" to silently accept such pages or rewrite all pages so that they contain \"crc32\" checksum.");
|
||||
let MYSQLD_DATADIR =`SELECT @@datadir`;
|
||||
|
||||
call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to \"strict_innodb\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"none\". Accepting the page as valid. Change innodb_checksum_algorithm to \"innodb\" to silently accept such pages or rewrite all pages so that they contain \"innodb\" checksum.");
|
||||
# ROW_FORMAT=COMPRESSED is unavailable with innodb_page_size=32k or 64k
|
||||
let $row_format_compressed= `select case when @@global.innodb_page_size>16384
|
||||
then 'ROW_FORMAT=DYNAMIC' else 'ROW_FORMAT=COMPRESSED' end`;
|
||||
|
||||
call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to \"strict_innodb\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"crc32\". Accepting the page as valid. Change innodb_checksum_algorithm to \"innodb\" to silently accept such pages or rewrite all pages so that they contain \"innodb\" checksum.");
|
||||
let $from = 3;
|
||||
while ($from)
|
||||
{
|
||||
dec $from;
|
||||
let checksum = `select case $from
|
||||
when 0 then 'none'
|
||||
when 1 then 'innodb'
|
||||
when 2 then 'crc32'
|
||||
end`;
|
||||
eval SET GLOBAL innodb_checksum_algorithm=$checksum;
|
||||
|
||||
call mtr.add_suppression("InnoDB: innodb_checksum_algorithm is set to \"strict_none\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"crc32\". Accepting the page as valid. Change innodb_checksum_algorithm to \"none\" to silently accept such pages or rewrite all pages so that they contain \"none\" checksum.");
|
||||
|
||||
--enable_warnings
|
||||
|
||||
set GLOBAL innodb_default_encryption_key_id=4;
|
||||
create table t1(a int not null auto_increment primary key, b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes;
|
||||
create table t2(a int not null auto_increment primary key, b blob, index(b(10))) engine=innodb encrypted=yes;
|
||||
create table t3(a int not null auto_increment primary key, b blob, index(b(10))) engine=innodb row_format=compressed encrypted=no;
|
||||
create table t4(a int not null auto_increment primary key, b blob, index(b(10))) engine=innodb encrypted=no;
|
||||
create table t5(a int not null auto_increment primary key, b blob, index(b(10))) engine=innodb encrypted=yes page_compressed=yes;
|
||||
eval create table tce_$checksum(a serial, b blob, index(b(10))) engine=innodb
|
||||
$row_format_compressed encrypted=yes;
|
||||
eval create table tc_$checksum(a serial, b blob, index(b(10))) engine=innodb
|
||||
$row_format_compressed encrypted=no;
|
||||
eval create table te_$checksum(a serial, b blob, index(b(10))) engine=innodb
|
||||
encrypted=yes;
|
||||
eval create table t_$checksum(a serial, b blob, index(b(10))) engine=innodb
|
||||
encrypted=no;
|
||||
eval create table tpe_$checksum(a serial, b blob, index(b(10))) engine=innodb
|
||||
page_compressed=yes encrypted=yes;
|
||||
eval create table tp_$checksum(a serial, b blob, index(b(10))) engine=innodb
|
||||
page_compressed=yes encrypted=no;
|
||||
|
||||
begin;
|
||||
insert into t1(b) values (repeat('secret',20));
|
||||
insert into t1(b) select b from t1;
|
||||
insert into t1(b) select b from t1;
|
||||
insert into t1(b) select b from t1;
|
||||
insert into t1(b) select b from t1;
|
||||
insert into t1(b) select b from t1;
|
||||
insert into t2(b) select b from t1;
|
||||
insert into t3(b) select b from t1;
|
||||
insert into t4(b) select b from t1;
|
||||
insert into t5(b) select b from t1;
|
||||
eval insert into tce_$checksum(b) values (repeat('secret',20));
|
||||
eval insert into tc_$checksum(b) values (repeat('secret',20));
|
||||
eval insert into te_$checksum(b) values (repeat('secret',20));
|
||||
eval insert into t_$checksum(b) values (repeat('secret',20));
|
||||
eval insert into tpe_$checksum(b) values (repeat('secret',20));
|
||||
eval insert into tp_$checksum(b) values (repeat('secret',20));
|
||||
commit;
|
||||
|
||||
--echo # 1 Restart mysqld --innodb-checksum-algorithm=crc32
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=crc32
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1;
|
||||
insert into t2(b) select b from t1;
|
||||
insert into t3(b) select b from t1;
|
||||
insert into t4(b) select b from t1;
|
||||
insert into t5(b) select b from t1;
|
||||
|
||||
--echo # 2 Restart mysqld --innodb-checksum-algorithm=innodb
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=innodb
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 3 Restart mysqld --innodb-checksum-algorithm=none
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=none
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 4 Restart mysqld --innodb-checksum-algorithm=innodb
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=innodb
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 5 Restart mysqld --innodb-checksum-algorithm=strict_innodb
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=strict_innodb
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 6 Restart mysqld --innodb-checksum-algorithm=innodb
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=innodb
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 7 Restart mysqld --innodb-checksum-algorithm=strict_none
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=strict_none
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 8 Restart mysqld --innodb-checksum-algorithm=innodb
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=innodb
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 9 Restart mysqld --innodb-checksum-algorithm=strict_crc32
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=strict_crc32
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 10 Restart mysqld --innodb-checksum-algorithm=innodb
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=innodb
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # Restart mysqld --innodb-checksum-algorithm=crc32
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=crc32
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 11 Restart mysqld --innodb-checksum-algorithm=strict_crc32
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=strict_crc32
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 12 Restart mysqld --innodb-checksum-algorithm=crc32
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=crc32
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 13 Restart mysqld --innodb-checksum-algorithm=strict_none
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=strict_none
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 14 Restart mysqld --innodb-checksum-algorithm=crc32
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=crc32
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 15 Restart mysqld --innodb-checksum-algorithm=strict_innodb
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=strict_innodb
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 16 Restart mysqld --innodb-checksum-algorithm=crc32
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=crc32
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 17 Restart mysqld --innodb-checksum-algorithm=none
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=none
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 18 Restart mysqld --innodb-checksum-algorithm=crc32
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=crc32
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # Restart mysqld --innodb-checksum-algorithm=strict_crc32
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=strict_crc32
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 19 Restart mysqld --innodb-checksum-algorithm=strict_none
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=strict_none
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 20 Restart mysqld --innodb-checksum-algorithm=strict_crc32
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=strict_crc32
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 21 Restart mysqld --innodb-checksum-algorithm=strict_innodb
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=strict_innodb
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 22 Restart mysqld --innodb-checksum-algorithm=strict_crc32
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=strict_crc32
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 23 Restart mysqld --innodb-checksum-algorithm=none
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=none
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 24 Restart mysqld --innodb-checksum-algorithm=strict_crc32
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=strict_crc32
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # Restart mysqld --innodb-checksum-algorithm=strict_none
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=strict_none
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 25 Restart mysqld --innodb-checksum-algorithm=none
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=none
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 26 Restart mysqld --innodb-checksum-algorithm=strict_none
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=strict_none
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 27 Restart mysqld --innodb-checksum-algorithm=strict_innodb
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=strict_innodb
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 28 Restart mysqld --innodb-checksum-algorithm=strict_none
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=strict_none
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # Restart mysqld --innodb-checksum-algorithm=none
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=none
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 29 Restart mysqld --innodb-checksum-algorithm=strict_innodb
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=strict_innodb
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
--echo # 30 Restart mysqld --innodb-checksum-algorithm=none
|
||||
-- let $restart_parameters=--innodb-checksum-algorithm=none
|
||||
-- source include/restart_mysqld.inc
|
||||
|
||||
select count(*) from t1;
|
||||
select count(*) from t2;
|
||||
select count(*) from t3;
|
||||
select count(*) from t4;
|
||||
select count(*) from t5;
|
||||
|
||||
insert into t1(b) select b from t1 limit 100;
|
||||
insert into t2(b) select b from t1 limit 100;
|
||||
insert into t3(b) select b from t1 limit 100;
|
||||
insert into t4(b) select b from t1 limit 100;
|
||||
insert into t5(b) select b from t1 limit 100;
|
||||
|
||||
drop table t1,t2,t3,t4,t5;
|
||||
|
||||
|
||||
|
||||
eval FLUSH TABLES tce_$checksum, tc_$checksum, te_$checksum,
|
||||
t_$checksum, tpe_$checksum, tp_$checksum FOR EXPORT;
|
||||
perl;
|
||||
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
|
||||
my @tables = ("tce_", "tc_", "te_", "t_", "tpe_", "tp_");
|
||||
ib_backup_tablespaces("test", map{ $_ . $ENV{checksum} } @tables);
|
||||
EOF
|
||||
--list_files $MYSQLD_DATADIR/test
|
||||
UNLOCK TABLES;
|
||||
|
||||
let $to = 6;
|
||||
while ($to)
|
||||
{
|
||||
dec $to;
|
||||
let $tocksum = `select case $to
|
||||
when 0 then 'none'
|
||||
when 1 then 'strict_none'
|
||||
when 2 then 'innodb'
|
||||
when 3 then 'strict_innodb'
|
||||
when 4 then 'crc32'
|
||||
when 5 then 'strict_crc32'
|
||||
end`;
|
||||
|
||||
eval SET GLOBAL innodb_checksum_algorithm=$tocksum;
|
||||
|
||||
eval ALTER TABLE tce_$checksum DISCARD TABLESPACE;
|
||||
eval ALTER TABLE tc_$checksum DISCARD TABLESPACE;
|
||||
eval ALTER TABLE te_$checksum DISCARD TABLESPACE;
|
||||
eval ALTER TABLE t_$checksum DISCARD TABLESPACE;
|
||||
eval ALTER TABLE tpe_$checksum DISCARD TABLESPACE;
|
||||
eval ALTER TABLE tp_$checksum DISCARD TABLESPACE;
|
||||
|
||||
perl;
|
||||
do "$ENV{MTR_SUITE_DIR}/include/innodb-util.pl";
|
||||
my @tables = ("tce_", "tc_", "te_", "t_", "tpe_", "tp_");
|
||||
ib_restore_tablespaces("test", map{ $_ . $ENV{checksum} } @tables);
|
||||
EOF
|
||||
|
||||
eval ALTER TABLE tce_$checksum IMPORT TABLESPACE;
|
||||
eval update tce_$checksum set b=substr(b,1);
|
||||
eval ALTER TABLE tc_$checksum IMPORT TABLESPACE;
|
||||
eval update tc_$checksum set b=substr(b,1);
|
||||
eval ALTER TABLE te_$checksum IMPORT TABLESPACE;
|
||||
eval update te_$checksum set b=substr(b,1);
|
||||
eval ALTER TABLE t_$checksum IMPORT TABLESPACE;
|
||||
eval update t_$checksum set b=substr(b,1);
|
||||
eval ALTER TABLE tpe_$checksum IMPORT TABLESPACE;
|
||||
eval update tpe_$checksum set b=substr(b,1);
|
||||
eval ALTER TABLE tp_$checksum IMPORT TABLESPACE;
|
||||
eval update tp_$checksum set b=substr(b,1);
|
||||
}
|
||||
|
||||
eval CHECK TABLE tce_$checksum, tc_$checksum, te_$checksum,
|
||||
t_$checksum, tpe_$checksum, tp_$checksum;
|
||||
eval DROP TABLE tce_$checksum, tc_$checksum, te_$checksum,
|
||||
t_$checksum, tpe_$checksum, tp_$checksum;
|
||||
}
|
||||
|
||||
SET GLOBAL innodb_file_format = @saved_file_format;
|
||||
SET GLOBAL innodb_file_per_table = @saved_file_per_table;
|
||||
SET GLOBAL innodb_checksum_algorithm = @saved_checksum_algorithm;
|
||||
SET GLOBAL innodb_encrypt_tables = @saved_encrypt_tables;
|
||||
SET GLOBAL innodb_encryption_threads = @saved_encryption_threads;
|
||||
SET GLOBAL innodb_default_encryption_key_id = @saved_encryption_key_id;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
--source include/have_innodb.inc
|
||||
--source include/innodb_page_size.inc
|
||||
--source include/not_embedded.inc
|
||||
|
||||
-- echo #
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
--source include/have_innodb.inc
|
||||
--source include/innodb_page_size.inc
|
||||
--source include/have_debug.inc
|
||||
--source include/have_debug_sync.inc
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#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;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
--source include/have_innodb.inc
|
||||
--source include/innodb_page_size.inc
|
||||
|
||||
# Save the initial number of concurrent sessions.
|
||||
--source include/count_sessions.inc
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
--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
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
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;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
--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
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
-- 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;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
--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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
--source include/have_innodb.inc
|
||||
--source include/innodb_page_size_small.inc
|
||||
#
|
||||
# Test case for bug 36172
|
||||
#
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
-- 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`;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
-- 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`;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
--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 @@ public:
|
|||
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 @@ public:
|
|||
}
|
||||
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 @@ public:
|
|||
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 @@ public:
|
|||
{
|
||||
return TRUE;
|
||||
}
|
||||
bool eval_not_null_tables(uchar *opt_arg)
|
||||
{
|
||||
not_null_tables_cache= 0;
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
@ -2228,7 +2245,11 @@ public:
|
|||
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 @@ got_block:
|
|||
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 @@ suspend_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 @@ got_block:
|
|||
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 @@ suspend_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();
|
||||
|
|
Loading…
Reference in a new issue