Merge 10.1 into 10.2

Replace have_innodb_zip.inc with innodb_page_size_small.inc.
This commit is contained in:
Marko Mäkelä 2017-06-08 12:45:08 +03:00
commit 2d8fdfbde5
115 changed files with 2679 additions and 915 deletions

View File

@ -41,4 +41,3 @@ SET(WSREP_PROC_INFO ${WITH_WSREP})
IF(WITH_WSREP)
SET(WSREP_PATCH_VERSION "wsrep_${WSREP_VERSION}")
ENDIF()

View File

@ -27,13 +27,12 @@ extern pfs_os_file_t files[1000];
extern const char *innodb_checksum_algorithm_names[];
extern TYPELIB innodb_checksum_algorithm_typelib;
extern dberr_t open_or_create_data_files(
ibool* create_new_db,
bool* create_new_db,
#ifdef UNIV_LOG_ARCHIVE
lsn_t* min_arch_log_no,
lsn_t* max_arch_log_no,
#endif
lsn_t* min_flushed_lsn,
lsn_t* max_flushed_lsn,
#endif
lsn_t* flushed_lsn,
ulint* sum_of_new_sizes)
;
int

View File

@ -309,8 +309,7 @@ my_bool xtrabackup_rebuild_indexes = FALSE;
my_bool xtrabackup_incremental_force_scan = FALSE;
/* The flushed lsn which is read from data files */
lsn_t min_flushed_lsn= 0;
lsn_t max_flushed_lsn= 0;
lsn_t flushed_lsn= 0;
/* The size of archived log file */
ib_int64_t xtrabackup_arch_file_size = 0ULL;
@ -3139,7 +3138,7 @@ dberr_t
xb_load_tablespaces()
{
ulint i;
ibool create_new_db;
bool create_new_db;
dberr_t err;
ulint sum_of_new_sizes;
lsn_t min_arch_logno, max_arch_logno;
@ -3155,7 +3154,7 @@ xb_load_tablespaces()
err = open_or_create_data_files(&create_new_db,
&min_arch_logno, &max_arch_logno,
&min_flushed_lsn, &max_flushed_lsn,
&flushed_lsn,
&sum_of_new_sizes);
if (err != DB_SUCCESS) {
msg("xtrabackup: Could not open or create data files.\n"
@ -6329,13 +6328,13 @@ skip_check:
metadata_last_lsn);
xtrabackup_archived_to_lsn = metadata_last_lsn;
}
if (xtrabackup_archived_to_lsn < min_flushed_lsn) {
if (xtrabackup_archived_to_lsn < flushed_lsn) {
msg("xtrabackup: error: logs applying "
"lsn limit " UINT64PF " is less than "
"min_flushed_lsn " UINT64PF
", there is nothing to do\n",
xtrabackup_archived_to_lsn,
min_flushed_lsn);
flushed_lsn);
goto error_cleanup;
}
}
@ -6346,7 +6345,7 @@ skip_check:
*/
xtrabackup_apply_log_only = srv_apply_log_only = true;
if (!xtrabackup_arch_search_files(min_flushed_lsn)) {
if (!xtrabackup_arch_search_files(flushed_lsn)) {
goto error_cleanup;
}

View 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

View 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

View File

@ -0,0 +1,8 @@
[16k]
innodb-page-size=16K
[8k]
innodb-page-size=8K
[4k]
innodb-page-size=4K

View 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

View File

@ -2792,15 +2792,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
@ -2839,7 +2850,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
@ -3063,7 +3073,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');
@ -3104,6 +3114,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

View File

@ -885,3 +885,12 @@ SELECT 1 FROM dual WHERE ('Alpha,Bravo,Charlie,Delta,Echo,Foxtrot,StrataCentral,
1
Warnings:
Warning 1139 Got error 'pcre_exec: recursion limit of NUM exceeded' from regexp
SELECT REGEXP_INSTR('a_kollision', 'oll');
REGEXP_INSTR('a_kollision', 'oll')
4
SELECT REGEXP_INSTR('a_kollision', '(oll)');
REGEXP_INSTR('a_kollision', '(oll)')
4
SELECT REGEXP_INSTR('a_kollision', 'o([lm])\\1');
REGEXP_INSTR('a_kollision', 'o([lm])\\1')
4

View File

@ -1133,5 +1133,78 @@ where index_date_updated= 10 and index_id < 800;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 range index_date_updated index_date_updated 13 NULL # Using index condition
drop table t0,t1,t2;
set optimizer_switch=@save_ext_key_optimizer_switch;
SET SESSION STORAGE_ENGINE=DEFAULT;
#
# MDEV-11196: Error:Run-Time Check Failure #2 - Stack around the variable 'key_buff'
# was corrupted, server crashes in opt_sum_query
CREATE TABLE t1 (
pk INT,
f1 VARCHAR(3),
f2 VARCHAR(1024),
PRIMARY KEY (pk),
KEY(f2)
) ENGINE=InnoDB CHARSET utf8 ROW_FORMAT= DYNAMIC;
INSERT INTO t1 VALUES (1,'foo','abc'),(2,'bar','def');
SELECT MAX(t2.pk) FROM t1 t2 INNER JOIN t1 t3 ON t2.f1 = t3.f1 WHERE t2.pk <= 4;
MAX(t2.pk)
2
drop table t1;
CREATE TABLE t1 (
pk1 INT,
pk2 INT,
f1 VARCHAR(3),
f2 VARCHAR(1021),
PRIMARY KEY (pk1,pk2),
KEY(f2)
) ENGINE=InnoDB CHARSET utf8 ROW_FORMAT= DYNAMIC;
INSERT INTO t1 VALUES (1,2,'2','abc'),(2,3,'3','def');
explain format= json
select * from t1 force index(f2) where pk1 <= 5 and pk2 <=5 and f2 = 'abc' and f1 <= '3';
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["f2"],
"key": "f2",
"key_length": "3070",
"used_key_parts": ["f2", "pk1"],
"rows": 1,
"filtered": 100,
"index_condition": "t1.pk1 <= 5 and t1.pk2 <= 5 and t1.f2 = 'abc'",
"attached_condition": "t1.f1 <= '3'"
}
}
}
drop table t1;
CREATE TABLE t1 (
f2 INT,
pk2 INT,
f1 VARCHAR(3),
pk1 VARCHAR(1000),
PRIMARY KEY (pk1,pk2),
KEY k1(pk1,f2)
) ENGINE=InnoDB CHARSET utf8 ROW_FORMAT= DYNAMIC;
INSERT INTO t1 VALUES (1,2,'2','abc'),(2,3,'3','def');
explain format= json
select * from t1 force index(k1) where f2 <= 5 and pk2 <=5 and pk1 = 'abc' and f1 <= '3';
EXPLAIN
{
"query_block": {
"select_id": 1,
"table": {
"table_name": "t1",
"access_type": "range",
"possible_keys": ["k1"],
"key": "k1",
"key_length": "3011",
"used_key_parts": ["pk1", "f2", "pk2"],
"rows": 1,
"filtered": 100,
"index_condition": "t1.f2 <= 5 and t1.pk2 <= 5 and t1.pk1 = 'abc'",
"attached_condition": "t1.f1 <= '3'"
}
}
}
drop table t1;

View File

@ -2337,4 +2337,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;

View File

@ -2348,6 +2348,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';

View File

@ -576,3 +576,42 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL #
2 DEPENDENT SUBQUERY t2 ref key1 key1 5 test.t1.a # Using where; Using filesort
drop table t1,t2;
#
# mdev-12931: semi-join in ON expression of STRAIGHT_JOIN
# joining a base table and a mergeable derived table
#
CREATE TABLE t1 (f1 int) ENGINE=InnoDB;
INSERT INTO t1 VALUES (3),(2);
CREATE TABLE t2 (f2 int) ENGINE=InnoDB;
INSERT INTO t2 VALUES (1),(4);
CREATE TABLE t3 (f3 int) ENGINE=InnoDB;
INSERT INTO t3 VALUES (5),(6);
CREATE TABLE t4 (f4 int) ENGINE=InnoDB;
INSERT INTO t4 VALUES (1),(8);
SELECT *
FROM t1
INNER JOIN
( t2 STRAIGHT_JOIN ( SELECT * FROM t3 ) AS sq
ON ( 1 IN ( SELECT f4 FROM t4 ) ) )
ON ( f1 >= f2 );
f1 f2 f3
3 1 5
2 1 5
3 1 6
2 1 6
EXPLAIN EXTENDED
SELECT *
FROM t1
INNER JOIN
( t2 STRAIGHT_JOIN ( SELECT * FROM t3 ) AS sq
ON ( 1 IN ( SELECT f4 FROM t4 ) ) )
ON ( f1 >= f2 );
id select_type table type possible_keys key key_len ref rows filtered Extra
1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join)
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join)
1 PRIMARY t3 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (incremental, BNL join)
3 MATERIALIZED t4 ALL NULL NULL NULL NULL 2 100.00 Using where
Warnings:
Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t2`.`f2` AS `f2`,`test`.`t3`.`f3` AS `f3` from `test`.`t1` join `test`.`t2` semi join (`test`.`t4`) join `test`.`t3` where `test`.`t4`.`f4` = 1 and `test`.`t1`.`f1` >= `test`.`t2`.`f2`
DROP TABLE t1,t2,t3,t4;

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,643 @@
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;
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|none|innodb)\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"(innodb|none|crc32)\"");
SET GLOBAL innodb_checksum_algorithm = innodb;
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;
create table tc_crc32(a serial, b blob, index(b(10))) engine=innodb
ROW_FORMAT=COMPRESSED 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
encrypted=no;
create table tpe_crc32(a serial, b blob, index(b(10))) engine=innodb
page_compressed=yes encrypted=yes;
create table tp_crc32(a serial, b blob, index(b(10))) engine=innodb
page_compressed=yes encrypted=no;
begin;
insert into tce_crc32(b) values (repeat('secret',20));
insert into tc_crc32(b) values (repeat('secret',20));
insert into te_crc32(b) values (repeat('secret',20));
insert into t_crc32(b) values (repeat('secret',20));
insert into tpe_crc32(b) values (repeat('secret',20));
insert into tp_crc32(b) values (repeat('secret',20));
commit;
FLUSH TABLES tce_crc32, tc_crc32, te_crc32,
t_crc32, tpe_crc32, tp_crc32 FOR EXPORT;
backup: tce_crc32
backup: tc_crc32
backup: te_crc32
backup: t_crc32
backup: tpe_crc32
backup: tp_crc32
t_crc32.cfg
t_crc32.frm
t_crc32.ibd
tc_crc32.cfg
tc_crc32.frm
tc_crc32.ibd
tce_crc32.cfg
tce_crc32.frm
tce_crc32.ibd
te_crc32.cfg
te_crc32.frm
te_crc32.ibd
tp_crc32.cfg
tp_crc32.frm
tp_crc32.ibd
tpe_crc32.cfg
tpe_crc32.frm
tpe_crc32.ibd
UNLOCK TABLES;
SET GLOBAL innodb_checksum_algorithm=strict_crc32;
ALTER TABLE tce_crc32 DISCARD TABLESPACE;
ALTER TABLE tc_crc32 DISCARD TABLESPACE;
ALTER TABLE te_crc32 DISCARD TABLESPACE;
ALTER TABLE t_crc32 DISCARD TABLESPACE;
ALTER TABLE tpe_crc32 DISCARD TABLESPACE;
ALTER TABLE tp_crc32 DISCARD TABLESPACE;
restore: tce_crc32 .ibd and .cfg files
restore: tc_crc32 .ibd and .cfg files
restore: te_crc32 .ibd and .cfg files
restore: t_crc32 .ibd and .cfg files
restore: tpe_crc32 .ibd and .cfg files
restore: tp_crc32 .ibd and .cfg files
ALTER TABLE tce_crc32 IMPORT TABLESPACE;
update tce_crc32 set b=substr(b,1);
ALTER TABLE tc_crc32 IMPORT TABLESPACE;
update tc_crc32 set b=substr(b,1);
ALTER TABLE te_crc32 IMPORT TABLESPACE;
update te_crc32 set b=substr(b,1);
ALTER TABLE t_crc32 IMPORT TABLESPACE;
update t_crc32 set b=substr(b,1);
ALTER TABLE tpe_crc32 IMPORT TABLESPACE;
update tpe_crc32 set b=substr(b,1);
ALTER TABLE tp_crc32 IMPORT TABLESPACE;
update tp_crc32 set b=substr(b,1);
SET GLOBAL innodb_checksum_algorithm=crc32;
ALTER TABLE tce_crc32 DISCARD TABLESPACE;
ALTER TABLE tc_crc32 DISCARD TABLESPACE;
ALTER TABLE te_crc32 DISCARD TABLESPACE;
ALTER TABLE t_crc32 DISCARD TABLESPACE;
ALTER TABLE tpe_crc32 DISCARD TABLESPACE;
ALTER TABLE tp_crc32 DISCARD TABLESPACE;
restore: tce_crc32 .ibd and .cfg files
restore: tc_crc32 .ibd and .cfg files
restore: te_crc32 .ibd and .cfg files
restore: t_crc32 .ibd and .cfg files
restore: tpe_crc32 .ibd and .cfg files
restore: tp_crc32 .ibd and .cfg files
ALTER TABLE tce_crc32 IMPORT TABLESPACE;
update tce_crc32 set b=substr(b,1);
ALTER TABLE tc_crc32 IMPORT TABLESPACE;
update tc_crc32 set b=substr(b,1);
ALTER TABLE te_crc32 IMPORT TABLESPACE;
update te_crc32 set b=substr(b,1);
ALTER TABLE t_crc32 IMPORT TABLESPACE;
update t_crc32 set b=substr(b,1);
ALTER TABLE tpe_crc32 IMPORT TABLESPACE;
update tpe_crc32 set b=substr(b,1);
ALTER TABLE tp_crc32 IMPORT TABLESPACE;
update tp_crc32 set b=substr(b,1);
SET GLOBAL innodb_checksum_algorithm=strict_innodb;
ALTER TABLE tce_crc32 DISCARD TABLESPACE;
ALTER TABLE tc_crc32 DISCARD TABLESPACE;
ALTER TABLE te_crc32 DISCARD TABLESPACE;
ALTER TABLE t_crc32 DISCARD TABLESPACE;
ALTER TABLE tpe_crc32 DISCARD TABLESPACE;
ALTER TABLE tp_crc32 DISCARD TABLESPACE;
restore: tce_crc32 .ibd and .cfg files
restore: tc_crc32 .ibd and .cfg files
restore: te_crc32 .ibd and .cfg files
restore: t_crc32 .ibd and .cfg files
restore: tpe_crc32 .ibd and .cfg files
restore: tp_crc32 .ibd and .cfg files
ALTER TABLE tce_crc32 IMPORT TABLESPACE;
update tce_crc32 set b=substr(b,1);
ALTER TABLE tc_crc32 IMPORT TABLESPACE;
update tc_crc32 set b=substr(b,1);
ALTER TABLE te_crc32 IMPORT TABLESPACE;
update te_crc32 set b=substr(b,1);
ALTER TABLE t_crc32 IMPORT TABLESPACE;
update t_crc32 set b=substr(b,1);
ALTER TABLE tpe_crc32 IMPORT TABLESPACE;
update tpe_crc32 set b=substr(b,1);
ALTER TABLE tp_crc32 IMPORT TABLESPACE;
update tp_crc32 set b=substr(b,1);
SET GLOBAL innodb_checksum_algorithm=innodb;
ALTER TABLE tce_crc32 DISCARD TABLESPACE;
ALTER TABLE tc_crc32 DISCARD TABLESPACE;
ALTER TABLE te_crc32 DISCARD TABLESPACE;
ALTER TABLE t_crc32 DISCARD TABLESPACE;
ALTER TABLE tpe_crc32 DISCARD TABLESPACE;
ALTER TABLE tp_crc32 DISCARD TABLESPACE;
restore: tce_crc32 .ibd and .cfg files
restore: tc_crc32 .ibd and .cfg files
restore: te_crc32 .ibd and .cfg files
restore: t_crc32 .ibd and .cfg files
restore: tpe_crc32 .ibd and .cfg files
restore: tp_crc32 .ibd and .cfg files
ALTER TABLE tce_crc32 IMPORT TABLESPACE;
update tce_crc32 set b=substr(b,1);
ALTER TABLE tc_crc32 IMPORT TABLESPACE;
update tc_crc32 set b=substr(b,1);
ALTER TABLE te_crc32 IMPORT TABLESPACE;
update te_crc32 set b=substr(b,1);
ALTER TABLE t_crc32 IMPORT TABLESPACE;
update t_crc32 set b=substr(b,1);
ALTER TABLE tpe_crc32 IMPORT TABLESPACE;
update tpe_crc32 set b=substr(b,1);
ALTER TABLE tp_crc32 IMPORT TABLESPACE;
update tp_crc32 set b=substr(b,1);
SET GLOBAL innodb_checksum_algorithm=strict_none;
ALTER TABLE tce_crc32 DISCARD TABLESPACE;
ALTER TABLE tc_crc32 DISCARD TABLESPACE;
ALTER TABLE te_crc32 DISCARD TABLESPACE;
ALTER TABLE t_crc32 DISCARD TABLESPACE;
ALTER TABLE tpe_crc32 DISCARD TABLESPACE;
ALTER TABLE tp_crc32 DISCARD TABLESPACE;
restore: tce_crc32 .ibd and .cfg files
restore: tc_crc32 .ibd and .cfg files
restore: te_crc32 .ibd and .cfg files
restore: t_crc32 .ibd and .cfg files
restore: tpe_crc32 .ibd and .cfg files
restore: tp_crc32 .ibd and .cfg files
ALTER TABLE tce_crc32 IMPORT TABLESPACE;
update tce_crc32 set b=substr(b,1);
ALTER TABLE tc_crc32 IMPORT TABLESPACE;
update tc_crc32 set b=substr(b,1);
ALTER TABLE te_crc32 IMPORT TABLESPACE;
update te_crc32 set b=substr(b,1);
ALTER TABLE t_crc32 IMPORT TABLESPACE;
update t_crc32 set b=substr(b,1);
ALTER TABLE tpe_crc32 IMPORT TABLESPACE;
update tpe_crc32 set b=substr(b,1);
ALTER TABLE tp_crc32 IMPORT TABLESPACE;
update tp_crc32 set b=substr(b,1);
SET GLOBAL innodb_checksum_algorithm=none;
ALTER TABLE tce_crc32 DISCARD TABLESPACE;
ALTER TABLE tc_crc32 DISCARD TABLESPACE;
ALTER TABLE te_crc32 DISCARD TABLESPACE;
ALTER TABLE t_crc32 DISCARD TABLESPACE;
ALTER TABLE tpe_crc32 DISCARD TABLESPACE;
ALTER TABLE tp_crc32 DISCARD TABLESPACE;
restore: tce_crc32 .ibd and .cfg files
restore: tc_crc32 .ibd and .cfg files
restore: te_crc32 .ibd and .cfg files
restore: t_crc32 .ibd and .cfg files
restore: tpe_crc32 .ibd and .cfg files
restore: tp_crc32 .ibd and .cfg files
ALTER TABLE tce_crc32 IMPORT TABLESPACE;
update tce_crc32 set b=substr(b,1);
ALTER TABLE tc_crc32 IMPORT TABLESPACE;
update tc_crc32 set b=substr(b,1);
ALTER TABLE te_crc32 IMPORT TABLESPACE;
update te_crc32 set b=substr(b,1);
ALTER TABLE t_crc32 IMPORT TABLESPACE;
update t_crc32 set b=substr(b,1);
ALTER TABLE tpe_crc32 IMPORT TABLESPACE;
update tpe_crc32 set b=substr(b,1);
ALTER TABLE tp_crc32 IMPORT TABLESPACE;
update tp_crc32 set b=substr(b,1);
CHECK TABLE tce_crc32, tc_crc32, te_crc32,
t_crc32, tpe_crc32, tp_crc32;
Table Op Msg_type Msg_text
test.tce_crc32 check status OK
test.tc_crc32 check status OK
test.te_crc32 check status OK
test.t_crc32 check status OK
test.tpe_crc32 check status OK
test.tp_crc32 check status OK
DROP TABLE tce_crc32, tc_crc32, te_crc32,
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;
create table tc_innodb(a serial, b blob, index(b(10))) engine=innodb
ROW_FORMAT=COMPRESSED 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
encrypted=no;
create table tpe_innodb(a serial, b blob, index(b(10))) engine=innodb
page_compressed=yes encrypted=yes;
create table tp_innodb(a serial, b blob, index(b(10))) engine=innodb
page_compressed=yes encrypted=no;
begin;
insert into tce_innodb(b) values (repeat('secret',20));
insert into tc_innodb(b) values (repeat('secret',20));
insert into te_innodb(b) values (repeat('secret',20));
insert into t_innodb(b) values (repeat('secret',20));
insert into tpe_innodb(b) values (repeat('secret',20));
insert into tp_innodb(b) values (repeat('secret',20));
commit;
FLUSH TABLES tce_innodb, tc_innodb, te_innodb,
t_innodb, tpe_innodb, tp_innodb FOR EXPORT;
backup: tce_innodb
backup: tc_innodb
backup: te_innodb
backup: t_innodb
backup: tpe_innodb
backup: tp_innodb
t_innodb.cfg
t_innodb.frm
t_innodb.ibd
tc_innodb.cfg
tc_innodb.frm
tc_innodb.ibd
tce_innodb.cfg
tce_innodb.frm
tce_innodb.ibd
te_innodb.cfg
te_innodb.frm
te_innodb.ibd
tp_innodb.cfg
tp_innodb.frm
tp_innodb.ibd
tpe_innodb.cfg
tpe_innodb.frm
tpe_innodb.ibd
UNLOCK TABLES;
SET GLOBAL innodb_checksum_algorithm=strict_crc32;
ALTER TABLE tce_innodb DISCARD TABLESPACE;
ALTER TABLE tc_innodb DISCARD TABLESPACE;
ALTER TABLE te_innodb DISCARD TABLESPACE;
ALTER TABLE t_innodb DISCARD TABLESPACE;
ALTER TABLE tpe_innodb DISCARD TABLESPACE;
ALTER TABLE tp_innodb DISCARD TABLESPACE;
restore: tce_innodb .ibd and .cfg files
restore: tc_innodb .ibd and .cfg files
restore: te_innodb .ibd and .cfg files
restore: t_innodb .ibd and .cfg files
restore: tpe_innodb .ibd and .cfg files
restore: tp_innodb .ibd and .cfg files
ALTER TABLE tce_innodb IMPORT TABLESPACE;
update tce_innodb set b=substr(b,1);
ALTER TABLE tc_innodb IMPORT TABLESPACE;
update tc_innodb set b=substr(b,1);
ALTER TABLE te_innodb IMPORT TABLESPACE;
update te_innodb set b=substr(b,1);
ALTER TABLE t_innodb IMPORT TABLESPACE;
update t_innodb set b=substr(b,1);
ALTER TABLE tpe_innodb IMPORT TABLESPACE;
update tpe_innodb set b=substr(b,1);
ALTER TABLE tp_innodb IMPORT TABLESPACE;
update tp_innodb set b=substr(b,1);
SET GLOBAL innodb_checksum_algorithm=crc32;
ALTER TABLE tce_innodb DISCARD TABLESPACE;
ALTER TABLE tc_innodb DISCARD TABLESPACE;
ALTER TABLE te_innodb DISCARD TABLESPACE;
ALTER TABLE t_innodb DISCARD TABLESPACE;
ALTER TABLE tpe_innodb DISCARD TABLESPACE;
ALTER TABLE tp_innodb DISCARD TABLESPACE;
restore: tce_innodb .ibd and .cfg files
restore: tc_innodb .ibd and .cfg files
restore: te_innodb .ibd and .cfg files
restore: t_innodb .ibd and .cfg files
restore: tpe_innodb .ibd and .cfg files
restore: tp_innodb .ibd and .cfg files
ALTER TABLE tce_innodb IMPORT TABLESPACE;
update tce_innodb set b=substr(b,1);
ALTER TABLE tc_innodb IMPORT TABLESPACE;
update tc_innodb set b=substr(b,1);
ALTER TABLE te_innodb IMPORT TABLESPACE;
update te_innodb set b=substr(b,1);
ALTER TABLE t_innodb IMPORT TABLESPACE;
update t_innodb set b=substr(b,1);
ALTER TABLE tpe_innodb IMPORT TABLESPACE;
update tpe_innodb set b=substr(b,1);
ALTER TABLE tp_innodb IMPORT TABLESPACE;
update tp_innodb set b=substr(b,1);
SET GLOBAL innodb_checksum_algorithm=strict_innodb;
ALTER TABLE tce_innodb DISCARD TABLESPACE;
ALTER TABLE tc_innodb DISCARD TABLESPACE;
ALTER TABLE te_innodb DISCARD TABLESPACE;
ALTER TABLE t_innodb DISCARD TABLESPACE;
ALTER TABLE tpe_innodb DISCARD TABLESPACE;
ALTER TABLE tp_innodb DISCARD TABLESPACE;
restore: tce_innodb .ibd and .cfg files
restore: tc_innodb .ibd and .cfg files
restore: te_innodb .ibd and .cfg files
restore: t_innodb .ibd and .cfg files
restore: tpe_innodb .ibd and .cfg files
restore: tp_innodb .ibd and .cfg files
ALTER TABLE tce_innodb IMPORT TABLESPACE;
update tce_innodb set b=substr(b,1);
ALTER TABLE tc_innodb IMPORT TABLESPACE;
update tc_innodb set b=substr(b,1);
ALTER TABLE te_innodb IMPORT TABLESPACE;
update te_innodb set b=substr(b,1);
ALTER TABLE t_innodb IMPORT TABLESPACE;
update t_innodb set b=substr(b,1);
ALTER TABLE tpe_innodb IMPORT TABLESPACE;
update tpe_innodb set b=substr(b,1);
ALTER TABLE tp_innodb IMPORT TABLESPACE;
update tp_innodb set b=substr(b,1);
SET GLOBAL innodb_checksum_algorithm=innodb;
ALTER TABLE tce_innodb DISCARD TABLESPACE;
ALTER TABLE tc_innodb DISCARD TABLESPACE;
ALTER TABLE te_innodb DISCARD TABLESPACE;
ALTER TABLE t_innodb DISCARD TABLESPACE;
ALTER TABLE tpe_innodb DISCARD TABLESPACE;
ALTER TABLE tp_innodb DISCARD TABLESPACE;
restore: tce_innodb .ibd and .cfg files
restore: tc_innodb .ibd and .cfg files
restore: te_innodb .ibd and .cfg files
restore: t_innodb .ibd and .cfg files
restore: tpe_innodb .ibd and .cfg files
restore: tp_innodb .ibd and .cfg files
ALTER TABLE tce_innodb IMPORT TABLESPACE;
update tce_innodb set b=substr(b,1);
ALTER TABLE tc_innodb IMPORT TABLESPACE;
update tc_innodb set b=substr(b,1);
ALTER TABLE te_innodb IMPORT TABLESPACE;
update te_innodb set b=substr(b,1);
ALTER TABLE t_innodb IMPORT TABLESPACE;
update t_innodb set b=substr(b,1);
ALTER TABLE tpe_innodb IMPORT TABLESPACE;
update tpe_innodb set b=substr(b,1);
ALTER TABLE tp_innodb IMPORT TABLESPACE;
update tp_innodb set b=substr(b,1);
SET GLOBAL innodb_checksum_algorithm=strict_none;
ALTER TABLE tce_innodb DISCARD TABLESPACE;
ALTER TABLE tc_innodb DISCARD TABLESPACE;
ALTER TABLE te_innodb DISCARD TABLESPACE;
ALTER TABLE t_innodb DISCARD TABLESPACE;
ALTER TABLE tpe_innodb DISCARD TABLESPACE;
ALTER TABLE tp_innodb DISCARD TABLESPACE;
restore: tce_innodb .ibd and .cfg files
restore: tc_innodb .ibd and .cfg files
restore: te_innodb .ibd and .cfg files
restore: t_innodb .ibd and .cfg files
restore: tpe_innodb .ibd and .cfg files
restore: tp_innodb .ibd and .cfg files
ALTER TABLE tce_innodb IMPORT TABLESPACE;
update tce_innodb set b=substr(b,1);
ALTER TABLE tc_innodb IMPORT TABLESPACE;
update tc_innodb set b=substr(b,1);
ALTER TABLE te_innodb IMPORT TABLESPACE;
update te_innodb set b=substr(b,1);
ALTER TABLE t_innodb IMPORT TABLESPACE;
update t_innodb set b=substr(b,1);
ALTER TABLE tpe_innodb IMPORT TABLESPACE;
update tpe_innodb set b=substr(b,1);
ALTER TABLE tp_innodb IMPORT TABLESPACE;
update tp_innodb set b=substr(b,1);
SET GLOBAL innodb_checksum_algorithm=none;
ALTER TABLE tce_innodb DISCARD TABLESPACE;
ALTER TABLE tc_innodb DISCARD TABLESPACE;
ALTER TABLE te_innodb DISCARD TABLESPACE;
ALTER TABLE t_innodb DISCARD TABLESPACE;
ALTER TABLE tpe_innodb DISCARD TABLESPACE;
ALTER TABLE tp_innodb DISCARD TABLESPACE;
restore: tce_innodb .ibd and .cfg files
restore: tc_innodb .ibd and .cfg files
restore: te_innodb .ibd and .cfg files
restore: t_innodb .ibd and .cfg files
restore: tpe_innodb .ibd and .cfg files
restore: tp_innodb .ibd and .cfg files
ALTER TABLE tce_innodb IMPORT TABLESPACE;
update tce_innodb set b=substr(b,1);
ALTER TABLE tc_innodb IMPORT TABLESPACE;
update tc_innodb set b=substr(b,1);
ALTER TABLE te_innodb IMPORT TABLESPACE;
update te_innodb set b=substr(b,1);
ALTER TABLE t_innodb IMPORT TABLESPACE;
update t_innodb set b=substr(b,1);
ALTER TABLE tpe_innodb IMPORT TABLESPACE;
update tpe_innodb set b=substr(b,1);
ALTER TABLE tp_innodb IMPORT TABLESPACE;
update tp_innodb set b=substr(b,1);
CHECK TABLE tce_innodb, tc_innodb, te_innodb,
t_innodb, tpe_innodb, tp_innodb;
Table Op Msg_type Msg_text
test.tce_innodb check status OK
test.tc_innodb check status OK
test.te_innodb check status OK
test.t_innodb check status OK
test.tpe_innodb check status OK
test.tp_innodb check status OK
DROP TABLE tce_innodb, tc_innodb, te_innodb,
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;
create table tc_none(a serial, b blob, index(b(10))) engine=innodb
ROW_FORMAT=COMPRESSED 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
encrypted=no;
create table tpe_none(a serial, b blob, index(b(10))) engine=innodb
page_compressed=yes encrypted=yes;
create table tp_none(a serial, b blob, index(b(10))) engine=innodb
page_compressed=yes encrypted=no;
begin;
insert into tce_none(b) values (repeat('secret',20));
insert into tc_none(b) values (repeat('secret',20));
insert into te_none(b) values (repeat('secret',20));
insert into t_none(b) values (repeat('secret',20));
insert into tpe_none(b) values (repeat('secret',20));
insert into tp_none(b) values (repeat('secret',20));
commit;
FLUSH TABLES tce_none, tc_none, te_none,
t_none, tpe_none, tp_none FOR EXPORT;
backup: tce_none
backup: tc_none
backup: te_none
backup: t_none
backup: tpe_none
backup: tp_none
t_none.cfg
t_none.frm
t_none.ibd
tc_none.cfg
tc_none.frm
tc_none.ibd
tce_none.cfg
tce_none.frm
tce_none.ibd
te_none.cfg
te_none.frm
te_none.ibd
tp_none.cfg
tp_none.frm
tp_none.ibd
tpe_none.cfg
tpe_none.frm
tpe_none.ibd
UNLOCK TABLES;
SET GLOBAL innodb_checksum_algorithm=strict_crc32;
ALTER TABLE tce_none DISCARD TABLESPACE;
ALTER TABLE tc_none DISCARD TABLESPACE;
ALTER TABLE te_none DISCARD TABLESPACE;
ALTER TABLE t_none DISCARD TABLESPACE;
ALTER TABLE tpe_none DISCARD TABLESPACE;
ALTER TABLE tp_none DISCARD TABLESPACE;
restore: tce_none .ibd and .cfg files
restore: tc_none .ibd and .cfg files
restore: te_none .ibd and .cfg files
restore: t_none .ibd and .cfg files
restore: tpe_none .ibd and .cfg files
restore: tp_none .ibd and .cfg files
ALTER TABLE tce_none IMPORT TABLESPACE;
update tce_none set b=substr(b,1);
ALTER TABLE tc_none IMPORT TABLESPACE;
update tc_none set b=substr(b,1);
ALTER TABLE te_none IMPORT TABLESPACE;
update te_none set b=substr(b,1);
ALTER TABLE t_none IMPORT TABLESPACE;
update t_none set b=substr(b,1);
ALTER TABLE tpe_none IMPORT TABLESPACE;
update tpe_none set b=substr(b,1);
ALTER TABLE tp_none IMPORT TABLESPACE;
update tp_none set b=substr(b,1);
SET GLOBAL innodb_checksum_algorithm=crc32;
ALTER TABLE tce_none DISCARD TABLESPACE;
ALTER TABLE tc_none DISCARD TABLESPACE;
ALTER TABLE te_none DISCARD TABLESPACE;
ALTER TABLE t_none DISCARD TABLESPACE;
ALTER TABLE tpe_none DISCARD TABLESPACE;
ALTER TABLE tp_none DISCARD TABLESPACE;
restore: tce_none .ibd and .cfg files
restore: tc_none .ibd and .cfg files
restore: te_none .ibd and .cfg files
restore: t_none .ibd and .cfg files
restore: tpe_none .ibd and .cfg files
restore: tp_none .ibd and .cfg files
ALTER TABLE tce_none IMPORT TABLESPACE;
update tce_none set b=substr(b,1);
ALTER TABLE tc_none IMPORT TABLESPACE;
update tc_none set b=substr(b,1);
ALTER TABLE te_none IMPORT TABLESPACE;
update te_none set b=substr(b,1);
ALTER TABLE t_none IMPORT TABLESPACE;
update t_none set b=substr(b,1);
ALTER TABLE tpe_none IMPORT TABLESPACE;
update tpe_none set b=substr(b,1);
ALTER TABLE tp_none IMPORT TABLESPACE;
update tp_none set b=substr(b,1);
SET GLOBAL innodb_checksum_algorithm=strict_innodb;
ALTER TABLE tce_none DISCARD TABLESPACE;
ALTER TABLE tc_none DISCARD TABLESPACE;
ALTER TABLE te_none DISCARD TABLESPACE;
ALTER TABLE t_none DISCARD TABLESPACE;
ALTER TABLE tpe_none DISCARD TABLESPACE;
ALTER TABLE tp_none DISCARD TABLESPACE;
restore: tce_none .ibd and .cfg files
restore: tc_none .ibd and .cfg files
restore: te_none .ibd and .cfg files
restore: t_none .ibd and .cfg files
restore: tpe_none .ibd and .cfg files
restore: tp_none .ibd and .cfg files
ALTER TABLE tce_none IMPORT TABLESPACE;
update tce_none set b=substr(b,1);
ALTER TABLE tc_none IMPORT TABLESPACE;
update tc_none set b=substr(b,1);
ALTER TABLE te_none IMPORT TABLESPACE;
update te_none set b=substr(b,1);
ALTER TABLE t_none IMPORT TABLESPACE;
update t_none set b=substr(b,1);
ALTER TABLE tpe_none IMPORT TABLESPACE;
update tpe_none set b=substr(b,1);
ALTER TABLE tp_none IMPORT TABLESPACE;
update tp_none set b=substr(b,1);
SET GLOBAL innodb_checksum_algorithm=innodb;
ALTER TABLE tce_none DISCARD TABLESPACE;
ALTER TABLE tc_none DISCARD TABLESPACE;
ALTER TABLE te_none DISCARD TABLESPACE;
ALTER TABLE t_none DISCARD TABLESPACE;
ALTER TABLE tpe_none DISCARD TABLESPACE;
ALTER TABLE tp_none DISCARD TABLESPACE;
restore: tce_none .ibd and .cfg files
restore: tc_none .ibd and .cfg files
restore: te_none .ibd and .cfg files
restore: t_none .ibd and .cfg files
restore: tpe_none .ibd and .cfg files
restore: tp_none .ibd and .cfg files
ALTER TABLE tce_none IMPORT TABLESPACE;
update tce_none set b=substr(b,1);
ALTER TABLE tc_none IMPORT TABLESPACE;
update tc_none set b=substr(b,1);
ALTER TABLE te_none IMPORT TABLESPACE;
update te_none set b=substr(b,1);
ALTER TABLE t_none IMPORT TABLESPACE;
update t_none set b=substr(b,1);
ALTER TABLE tpe_none IMPORT TABLESPACE;
update tpe_none set b=substr(b,1);
ALTER TABLE tp_none IMPORT TABLESPACE;
update tp_none set b=substr(b,1);
SET GLOBAL innodb_checksum_algorithm=strict_none;
ALTER TABLE tce_none DISCARD TABLESPACE;
ALTER TABLE tc_none DISCARD TABLESPACE;
ALTER TABLE te_none DISCARD TABLESPACE;
ALTER TABLE t_none DISCARD TABLESPACE;
ALTER TABLE tpe_none DISCARD TABLESPACE;
ALTER TABLE tp_none DISCARD TABLESPACE;
restore: tce_none .ibd and .cfg files
restore: tc_none .ibd and .cfg files
restore: te_none .ibd and .cfg files
restore: t_none .ibd and .cfg files
restore: tpe_none .ibd and .cfg files
restore: tp_none .ibd and .cfg files
ALTER TABLE tce_none IMPORT TABLESPACE;
update tce_none set b=substr(b,1);
ALTER TABLE tc_none IMPORT TABLESPACE;
update tc_none set b=substr(b,1);
ALTER TABLE te_none IMPORT TABLESPACE;
update te_none set b=substr(b,1);
ALTER TABLE t_none IMPORT TABLESPACE;
update t_none set b=substr(b,1);
ALTER TABLE tpe_none IMPORT TABLESPACE;
update tpe_none set b=substr(b,1);
ALTER TABLE tp_none IMPORT TABLESPACE;
update tp_none set b=substr(b,1);
SET GLOBAL innodb_checksum_algorithm=none;
ALTER TABLE tce_none DISCARD TABLESPACE;
ALTER TABLE tc_none DISCARD TABLESPACE;
ALTER TABLE te_none DISCARD TABLESPACE;
ALTER TABLE t_none DISCARD TABLESPACE;
ALTER TABLE tpe_none DISCARD TABLESPACE;
ALTER TABLE tp_none DISCARD TABLESPACE;
restore: tce_none .ibd and .cfg files
restore: tc_none .ibd and .cfg files
restore: te_none .ibd and .cfg files
restore: t_none .ibd and .cfg files
restore: tpe_none .ibd and .cfg files
restore: tp_none .ibd and .cfg files
ALTER TABLE tce_none IMPORT TABLESPACE;
update tce_none set b=substr(b,1);
ALTER TABLE tc_none IMPORT TABLESPACE;
update tc_none set b=substr(b,1);
ALTER TABLE te_none IMPORT TABLESPACE;
update te_none set b=substr(b,1);
ALTER TABLE t_none IMPORT TABLESPACE;
update t_none set b=substr(b,1);
ALTER TABLE tpe_none IMPORT TABLESPACE;
update tpe_none set b=substr(b,1);
ALTER TABLE tp_none IMPORT TABLESPACE;
update tp_none set b=substr(b,1);
CHECK TABLE tce_none, tc_none, te_none,
t_none, tpe_none, tp_none;
Table Op Msg_type Msg_text
test.tce_none check status OK
test.tc_none check status OK
test.te_none check status OK
test.t_none check status OK
test.tpe_none check status OK
test.tp_none check status OK
DROP TABLE tce_none, tc_none, te_none,
t_none, tpe_none, tp_none;
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;

View File

@ -1,4 +1,5 @@
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[123]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("InnoDB: Unable to decompress ..test.t[1-3]\\.ibd\\[page id: space=[1-9][0-9]*, page number=[0-9]+\\]");
# Restart mysqld --file-key-management-filename=keys2.txt
SET GLOBAL innodb_file_per_table = ON;
set GLOBAL innodb_default_encryption_key_id=4;

View File

@ -0,0 +1,120 @@
-- source include/innodb_page_size.inc
-- source include/have_file_key_management_plugin.inc
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;
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|none|innodb)\" but the page \\[page id: space=[0-9]+, page number=[0-9]+\\] contains a valid checksum \"(innodb|none|crc32)\"");
SET GLOBAL innodb_checksum_algorithm = innodb;
SET GLOBAL innodb_default_encryption_key_id=4;
let MYSQLD_DATADIR =`SELECT @@datadir`;
# 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`;
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;
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;
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;
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_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;

View File

@ -0,0 +1,12 @@
[crc32]
loose-innodb-tablespaces-encryption
loose-innodb-encrypt-tables=on
loose-innodb-encryption-threads=4
max_allowed_packet=64K
loose-innodb-checksum-algorithm=crc32
[none]
loose-innodb-tablespaces-encryption
loose-innodb-encrypt-tables=on
loose-innodb-encryption-threads=4
max_allowed_packet=64K
loose-innodb-checksum-algorithm=none

View File

@ -1,4 +0,0 @@
--innodb-tablespaces-encryption
--innodb-encrypt-tables=on
--innodb-encryption-threads=2
--max_allowed_packet=64K

View File

@ -1,10 +1,11 @@
-- source include/have_innodb.inc
-- source include/innodb_page_size_small.inc
-- source include/have_file_key_management_plugin.inc
# embedded does not support restart
-- source include/not_embedded.inc
call mtr.add_suppression("InnoDB: The page \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\] in file '.*test.t[123]\\.ibd' cannot be decrypted\\.");
call mtr.add_suppression("InnoDB: Unable to decompress ..test.t[1-3]\\.ibd\\[page id: space=[1-9][0-9]*, page number=[0-9]+\\]");
--echo # Restart mysqld --file-key-management-filename=keys2.txt
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt

View File

@ -16,7 +16,7 @@ wsrep-sync-wait=7
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep-cluster-address=gcomm://
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;gcache.size=10M;evs.suspect_timeout=PT10S'
wsrep_provider_options='repl.causal_read_timeout=PT90S;base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S;gcache.size=10M'
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'

View File

@ -0,0 +1,22 @@
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
SET GLOBAL wsrep_max_ws_rows = 2;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
SELECT * FROM t1 GROUP BY f1;
f1
1
SELECT * FROM t1 GROUP BY f1;
f1
1
SELECT * FROM t1 GROUP BY f1;
f1
1
SHOW STATUS LIKE '%wsrep%';
SET GLOBAL wsrep_max_ws_rows = 0;
DROP TABLE t1;

View File

@ -0,0 +1,32 @@
#
# MW-309 Regression: wsrep_max_ws_rows limit also applies to certain SELECT queries
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
SET GLOBAL wsrep_max_ws_rows = 2;
SET AUTOCOMMIT=OFF;
START TRANSACTION;
SELECT * FROM t1 GROUP BY f1;
SELECT * FROM t1 GROUP BY f1;
--error 0
SELECT * FROM t1 GROUP BY f1;
--disable_result_log
--error 0
SHOW STATUS LIKE '%wsrep%';
--enable_result_log
SET GLOBAL wsrep_max_ws_rows = 0;
DROP TABLE t1;

View File

@ -1,9 +1,8 @@
!include ../galera_2nodes.cnf
[mysqld]
#wsrep_sst_method=xtrabackup-v2
#wsrep_sst_auth="root:"
#wsrep_debug=ON
wsrep_sst_method=xtrabackup-v2
wsrep_sst_auth="root:"
[mysqld.1]
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=1;pc.ignore_sb=true'

View File

@ -1,6 +1,6 @@
#
# Test that autoincrement works correctly while the cluster membership
# is changing and IST takes place.
# is changing and SST takes place.
#
--source include/big_test.inc

View File

@ -76,4 +76,3 @@ CALL mtr.add_suppression("WSREP: wsrep::connect\\(gcomm://192.0.2.1\\) failed: 7
--source include/galera_end.inc
--echo # End of test

View File

@ -5,3 +5,4 @@ galera_slave_options_do :MDEV-8798
galera_slave_options_ignore : MDEV-8798
galera_pc_bootstrap : TODO: Investigate: Timeout in wait_condition.inc
galera_pc_weight : Test times out
galera_safe_to_bootstrap : I Really dont know :(

View File

@ -14,11 +14,10 @@ wsrep-causal-reads=ON
wsrep-sync-wait=7
[mysqld.1]
#galera_port=@OPT.port
#ist_port=@OPT.port
#sst_port=@OPT.port
wsrep-cluster-address=gcomm://
wsrep_provider_options='base_port=@mysqld.1.#galera_port;gcache.size=10M;evs.suspect_timeout=PT10S'
wsrep-cluster-address='gcomm://'
wsrep_provider_options='base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT10S;evs.inactive_timeout=PT30S;evs.install_timeout=PT15S'
wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'

View File

@ -231,6 +231,7 @@ set global innodb_buf_flush_list_now = 1;
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
FOUND 1 /\[ERROR\] InnoDB: .*test.t1\.ibd.*/ in mysqld.1.err
select f1, f2 from t1;
f1 f2
1 ############
@ -238,6 +239,13 @@ f1 f2
3 ////////////
4 ------------
5 ............
# Test End
# ---------------------------------------------------------------
drop table t1;
#
# MDEV-12600 crash during install_db with innodb_page_size=32K
# and ibdata1=3M
#
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /\[ERROR\] InnoDB: Cannot create doublewrite buffer/ in mysqld.1.err

View File

@ -149,10 +149,6 @@ FOUND 2 /support raw device/ in mysqld.1.err
SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /The innodb_temporary data file 'ibtmp1' must be at least/ in mysqld.1.err
SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
FOUND 1 /InnoDB: syntax error in file path/ in mysqld.1.err
SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');

View File

@ -1,4 +1,4 @@
--source include/have_innodb.inc
--source include/innodb_page_size.inc
--source include/not_embedded.inc
-- echo #

View File

@ -1,5 +1,5 @@
--source include/not_embedded.inc
--source include/have_innodb.inc
--source include/innodb_page_size.inc
--echo #
--echo # Bug#13955083 ALLOW IN-PLACE DDL OPERATIONS ON MISSING

View File

@ -4,22 +4,27 @@
--echo # PAGE OF SYSTEM TABLESPACE
--echo #
--source include/have_innodb.inc
--source include/innodb_page_size.inc
--source include/have_debug.inc
--source include/not_embedded.inc
# Slow shutdown and restart to make sure ibuf merge is finished
SET GLOBAL innodb_fast_shutdown = 0;
--disable_query_log
call mtr.add_suppression("Header page consists of zero bytes");
call mtr.add_suppression("Checksum mismatch in datafile");
call mtr.add_suppression("but the innodb_page_size start-up parameter is");
call mtr.add_suppression("adjusting FSP_SPACE_FLAGS");
call mtr.add_suppression("InnoDB: Header page consists of zero bytes");
call mtr.add_suppression("InnoDB: Checksum mismatch in datafile: .*, Space ID:0, Flags: 0");
call mtr.add_suppression("InnoDB: Data file .* uses page size .* but the innodb_page_size start-up parameter is");
call mtr.add_suppression("InnoDB: adjusting FSP_SPACE_FLAGS");
call mtr.add_suppression("InnoDB: New log files created");
call mtr.add_suppression("InnoDB: Cannot create doublewrite buffer: the first file in innodb_data_file_path must be at least (3|6|12)M\\.");
call mtr.add_suppression("InnoDB: Database creation was aborted");
call mtr.add_suppression("Plugin 'InnoDB' (init function returned error|registration as a STORAGE ENGINE failed)");
--enable_query_log
--source include/restart_mysqld.inc
let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
let MYSQLD_DATADIR=`select @@datadir`;
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
show variables like 'innodb_doublewrite';
show variables like 'innodb_fil_make_page_dirty_debug';
@ -392,9 +397,38 @@ EOF
--source include/start_mysqld.inc
check table t1;
--let SEARCH_PATTERN= \[ERROR\] InnoDB: .*test.t1\\.ibd.*
--source include/search_pattern_in_file.inc
select f1, f2 from t1;
--echo # Test End
--echo # ---------------------------------------------------------------
drop table t1;
--echo #
--echo # MDEV-12600 crash during install_db with innodb_page_size=32K
--echo # and ibdata1=3M
--echo #
let bugdir= $MYSQLTEST_VARDIR/tmp/doublewrite;
--mkdir $bugdir
let $check_no_innodb=SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
--let $ibp=--innodb-log-group-home-dir=$bugdir --innodb-data-home-dir=$bugdir
--let $ibd=$ibp --innodb-undo-tablespaces=0 --innodb-log-files-in-group=2
--let $ibp=$ibp --innodb-data-file-path=ibdata1:1M;ibdata2:1M:autoextend
--let $restart_parameters= $ibp
--source include/restart_mysqld.inc
eval $check_no_innodb;
--let SEARCH_PATTERN= \[ERROR\] InnoDB: Cannot create doublewrite buffer
--source include/search_pattern_in_file.inc
--let $restart_parameters=
--source include/restart_mysqld.inc
--remove_file $bugdir/ibdata1
--remove_file $bugdir/ibdata2
--remove_file $bugdir/ib_logfile0
--remove_file $bugdir/ib_logfile1
--rmdir $bugdir

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -1,4 +1,4 @@
--source include/have_innodb.inc
--source include/innodb_page_size.inc
--source include/not_embedded.inc
let INNODB_PAGE_SIZE=`select @@innodb_page_size`;

View File

@ -15,7 +15,6 @@ call mtr.add_suppression("The table 't1' is full");
call mtr.add_suppression("Plugin 'InnoDB' init function returned error");
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed");
call mtr.add_suppression("InnoDB: Tablespace doesn't support raw devices");
call mtr.add_suppression("InnoDB: The innodb_temporary data file 'ibtmp1' must be at least");
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
call mtr.add_suppression("innodb_temporary and innodb_system file names seem to be the same");
call mtr.add_suppression("Could not create the shared innodb_temporary");
@ -143,12 +142,6 @@ eval $check_no_innodb;
--source include/search_pattern_in_file.inc
eval $check_no_innodb;
--let $restart_parameters= --innodb_temp_data_file_path=ibtmp1:2M:autoextend
--source include/restart_mysqld.inc
--let SEARCH_PATTERN = The innodb_temporary data file 'ibtmp1' must be at least
--source include/search_pattern_in_file.inc
eval $check_no_innodb;
--let $restart_parameters= --innodb_temp_data_file_path=
--source include/restart_mysqld.inc
--let SEARCH_PATTERN = InnoDB: syntax error in file path

View File

@ -1,4 +0,0 @@
if (`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE LOWER(variable_name) = 'innodb_page_size' AND variable_value <= 16384`)
{
--skip Test with InnoDB zip requires page size not greater than 16k.
}

View File

@ -1,28 +1,13 @@
USE test;
DROP TABLE IF EXISTS tab5;
Warnings:
Note 1051 Unknown table 'test.tab5'
DROP TABLE IF EXISTS tab6;
Warnings:
Note 1051 Unknown table 'test.tab6'
#set the other madatory flags before test starts
SET GLOBAL Innodb_file_per_table=on;
#set the compression level=0 (No compress)
SET @save_innodb_compression_level = @@global.innodb_compression_level;
SET global innodb_compression_level=0;
#check the compression level and the compressed_pages is default
SELECT @@innodb_compression_level;
@@innodb_compression_level
0
SELECT @@Innodb_file_per_table;
@@Innodb_file_per_table
1
#create table with 1K block size
CREATE TABLE tab5 (col_1 CHAR (255) ,
col_2 VARCHAR (255), col_3 longtext,
col_4 longtext,col_5 longtext,
col_6 longtext , col_7 longtext ,
col_8 longtext ,col_9 longtext ,
col_10 longtext ,col_11 int auto_increment primary key)
col_10 longtext ,col_11 int auto_increment primary key)
ENGINE = innodb ROW_FORMAT=compressed key_block_size=1;
#create indexes
CREATE INDEX idx1 ON tab5(col_4(10));
@ -42,7 +27,8 @@ SET @col_7 = repeat('g', 100);
SET @col_8 = repeat('h', 100);
SET @col_9 = repeat('i', 100);
SET @col_10 = repeat('j', 100);
#insert 10 records
#insert 10 records
BEGIN;
INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
@ -63,7 +49,8 @@ INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab5(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
#set the compression level=9 (High compress)
COMMIT;
#set the compression level=9 (High compress)
SET global innodb_compression_level=9;
#create table with 1K block size
CREATE TABLE tab6 (col_1 CHAR (255) ,
@ -80,18 +67,8 @@ CREATE INDEX idx3 ON tab6(col_6(10));
CREATE INDEX idx4 ON tab6(col_7(10));
CREATE INDEX idx5 ON tab6(col_8(10));
CREATE INDEX idx6 ON tab6(col_11);
#load the with repeat function
SET @col_1 = repeat('a', 100);
SET @col_2 = repeat('b', 100);
SET @col_3 = repeat('c', 100);
SET @col_4 = repeat('d', 100);
SET @col_5 = repeat('e', 100);
SET @col_6 = repeat('f', 100);
SET @col_7 = repeat('g', 100);
SET @col_8 = repeat('h', 100);
SET @col_9 = repeat('i', 100);
SET @col_10 = repeat('j', 100);
#insert 10 records
#insert 10 records
BEGIN;
INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
@ -112,24 +89,21 @@ INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_10)
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
COMMIT;
#diff the sizes of the No compressed table and high compressed table
SET @size=(SELECT
(SELECT (SUM(DATA_LENGTH+INDEX_LENGTH)/1024/1024)
FROM INFORMATION_SCHEMA.TABLES
SET @size=(SELECT
(SELECT (SUM(DATA_LENGTH+INDEX_LENGTH)/1024/1024)
FROM INFORMATION_SCHEMA.TABLES
WHERE table_name='tab5' AND ENGINE='InnoDB' AND table_schema='test')
-
(SELECT SUM(DATA_LENGTH+INDEX_LENGTH)/1024/1024
FROM INFORMATION_SCHEMA.TABLES
(SELECT SUM(DATA_LENGTH+INDEX_LENGTH)/1024/1024
FROM INFORMATION_SCHEMA.TABLES
WHERE table_name='tab6' AND ENGINE='InnoDB' AND table_schema='test')
FROM DUAL);
#check the size of the table, it should not be Negative value
#check the size of the table, it should not be Negative value
#The results of this query Test pass = 1 and fail=0
SELECT @size >= 0;
@size >= 0
1
#
# Cleanup
#
DROP TABLE tab5;
DROP TABLE tab6;
#reset back the compression_level to default.
DROP TABLE tab5, tab6;
SET GLOBAL innodb_compression_level = @save_innodb_compression_level;

View File

@ -3,8 +3,7 @@
# http://bugs.mysql.com/36169
#
-- source include/have_innodb.inc
-- source include/have_innodb_zip.inc
-- source include/innodb_page_size_small.inc
let $file_per_table=`select @@innodb_file_per_table`;
SET GLOBAL innodb_file_per_table=ON;

View File

@ -1,5 +1,4 @@
-- source include/have_innodb.inc
-- source include/have_innodb_zip.inc
-- source include/innodb_page_size_small.inc
let $file_per_table=`select @@innodb_file_per_table`;
SET GLOBAL innodb_file_per_table=on;

View File

@ -1,5 +1,4 @@
-- source include/have_innodb.inc
-- source include/have_innodb_zip.inc
-- source include/innodb_page_size_small.inc
let $file_per_table=`select @@innodb_file_per_table`;

View File

@ -3,8 +3,7 @@
#
# Bug #56680 InnoDB may return wrong results from a case-insensitive index
#
-- source include/have_innodb.inc
-- source include/have_innodb_zip.inc
-- source include/innodb_page_size_small.inc
-- disable_query_log
SET @tx_isolation_orig = @@tx_isolation;

View File

@ -57,8 +57,7 @@
# since they are rejected for InnoDB page sizes of 8k and 16k.
# See innodb_16k and innodb_8k for those tests.
-- source include/have_innodb.inc
-- source include/have_innodb_zip.inc
--source include/innodb_page_size_small.inc
SET default_storage_engine=InnoDB;
--disable_query_log

View File

@ -1,8 +1,7 @@
#************************************************************
# WL6045:Improve Innochecksum
#************************************************************
--source include/have_innodb.inc
--source include/have_innodb_zip.inc
--source include/innodb_page_size_small.inc
--source include/no_valgrind_without_big.inc
# Embedded server does not support crashing.
--source include/not_embedded.inc

View File

@ -1,8 +1,7 @@
#************************************************************
# WL6045:Improve Innochecksum
#************************************************************
--source include/have_innodb.inc
--source include/have_innodb_zip.inc
--source include/innodb_page_size_small.inc
--source include/have_debug.inc
--source include/no_valgrind_without_big.inc
# Avoid CrashReporter popup on Mac.

View File

@ -1,8 +1,7 @@
#************************************************************
# WL6045:Improve Innochecksum
#************************************************************
--source include/have_innodb.inc
--source include/have_innodb_zip.inc
--source include/innodb_page_size_small.inc
--source include/no_valgrind_without_big.inc

View File

@ -1,4 +1,4 @@
-- source include/have_innodb.inc
--source include/innodb_page_size_small.inc
CREATE DATABASE mysqltest_innodb_zip;
USE mysqltest_innodb_zip;
@ -8,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;
@ -354,7 +353,6 @@ 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;

View File

@ -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

View File

@ -1,4 +1,4 @@
--source include/have_innodb.inc
--source include/innodb_page_size_small.inc
#
# Test case for bug 36172
#

View File

@ -1,4 +1,4 @@
-- source include/have_innodb.inc
--source include/innodb_page_size_small.inc
SET STATEMENT sql_mode = 'NO_ENGINE_SUBSTITUTION' FOR
CREATE TABLE bug52745 (

View File

@ -1,4 +1,4 @@
-- source include/have_innodb.inc
--source include/innodb_page_size_small.inc
SET GLOBAL innodb_strict_mode=on;
set old_alter_table=0;

View File

@ -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
#

View File

@ -1,9 +1,7 @@
#
# These test make sure that tables are visible after rebooting
#
--source include/have_innodb.inc
--source include/have_innodb_zip.inc
--source include/innodb_page_size_small.inc
--source include/have_partition.inc
--source include/not_embedded.inc
SET default_storage_engine=InnoDB;

View File

@ -10,8 +10,7 @@
# Avoid CrashReporter popup on Mac
--source include/not_crashrep.inc
-- source include/have_innodb.inc
-- source include/have_innodb_zip.inc
-- source include/innodb_page_size_small.inc
call mtr.add_suppression("InnoDB: Tablespace for table .* is set as discarded.");
call mtr.add_suppression("InnoDB: Cannot calculate statistics for table .* because the .ibd file is missing. Please refer to .* for how to resolve the issue.");

View File

@ -1,8 +1,7 @@
# Not supported in embedded
--source include/not_embedded.inc
-- source include/have_innodb.inc
-- source include/have_innodb_zip.inc
-- source include/innodb_page_size_small.inc
call mtr.add_suppression("InnoDB: Unable to import tablespace .* because it already exists. Please DISCARD the tablespace before IMPORT.");

View File

@ -9,31 +9,20 @@
# greater than the
# the size of the table when compression level=9
#*******************************************************************
--source include/have_innodb.inc
--source include/have_innodb_zip.inc
--source include/innodb_page_size_small.inc
USE test;
DROP TABLE IF EXISTS tab5;
DROP TABLE IF EXISTS tab6;
--echo #set the other madatory flags before test starts
SET GLOBAL Innodb_file_per_table=on;
let $innodb_compression_level = `SELECT @@global.innodb_compression_level`;
SET @save_innodb_compression_level = @@global.innodb_compression_level;
--echo #set the compression level=0 (No compress)
SET global innodb_compression_level=0;
-- echo #check the compression level and the compressed_pages is default
SELECT @@innodb_compression_level;
SELECT @@Innodb_file_per_table;
-- echo #create table with 1K block size
CREATE TABLE tab5 (col_1 CHAR (255) ,
col_2 VARCHAR (255), col_3 longtext,
col_4 longtext,col_5 longtext,
col_6 longtext , col_7 longtext ,
col_8 longtext ,col_9 longtext ,
col_10 longtext ,col_11 int auto_increment primary key)
col_10 longtext ,col_11 int auto_increment primary key)
ENGINE = innodb ROW_FORMAT=compressed key_block_size=1;
-- echo #create indexes
@ -56,7 +45,8 @@ SET @col_8 = repeat('h', 100);
SET @col_9 = repeat('i', 100);
SET @col_10 = repeat('j', 100);
--echo #insert 10 records
--echo #insert 10 records
BEGIN;
let $i = 10;
while ($i) {
@ -65,8 +55,9 @@ VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
dec $i;
}
COMMIT;
--echo #set the compression level=9 (High compress)
--echo #set the compression level=9 (High compress)
SET global innodb_compression_level=9;
-- echo #create table with 1K block size
@ -86,19 +77,8 @@ CREATE INDEX idx4 ON tab6(col_7(10));
CREATE INDEX idx5 ON tab6(col_8(10));
CREATE INDEX idx6 ON tab6(col_11);
--echo #load the with repeat function
SET @col_1 = repeat('a', 100);
SET @col_2 = repeat('b', 100);
SET @col_3 = repeat('c', 100);
SET @col_4 = repeat('d', 100);
SET @col_5 = repeat('e', 100);
SET @col_6 = repeat('f', 100);
SET @col_7 = repeat('g', 100);
SET @col_8 = repeat('h', 100);
SET @col_9 = repeat('i', 100);
SET @col_10 = repeat('j', 100);
--echo #insert 10 records
--echo #insert 10 records
BEGIN;
let $i = 10;
while ($i) {
@ -106,30 +86,23 @@ eval INSERT INTO tab6(col_1,col_2,col_3,col_4,col_5,col_6,col_7,col_8,col_9,col_
VALUES (@col_1,@col_2,@col_3,@col_4,@cl_5,@col_6,@col_7,@col_8,@col_9,@col_10);
dec $i;
}
COMMIT;
-- echo #diff the sizes of the No compressed table and high compressed table
SET @size=(SELECT
(SELECT (SUM(DATA_LENGTH+INDEX_LENGTH)/1024/1024)
FROM INFORMATION_SCHEMA.TABLES
SET @size=(SELECT
(SELECT (SUM(DATA_LENGTH+INDEX_LENGTH)/1024/1024)
FROM INFORMATION_SCHEMA.TABLES
WHERE table_name='tab5' AND ENGINE='InnoDB' AND table_schema='test')
-
(SELECT SUM(DATA_LENGTH+INDEX_LENGTH)/1024/1024
FROM INFORMATION_SCHEMA.TABLES
(SELECT SUM(DATA_LENGTH+INDEX_LENGTH)/1024/1024
FROM INFORMATION_SCHEMA.TABLES
WHERE table_name='tab6' AND ENGINE='InnoDB' AND table_schema='test')
FROM DUAL);
--echo #check the size of the table, it should not be Negative value
--echo #check the size of the table, it should not be Negative value
--echo #The results of this query Test pass = 1 and fail=0
SELECT @size >= 0;
DROP TABLE tab5, tab6;
--echo #
--echo # Cleanup
--echo #
DROP TABLE tab5;
DROP TABLE tab6;
--echo #reset back the compression_level to default.
--disable_query_log
eval SET GLOBAL innodb_compression_level=$innodb_compression_level;
--enable_query_log
SET GLOBAL innodb_compression_level = @save_innodb_compression_level;

View File

@ -0,0 +1,22 @@
!include my.cnf
[mysqld.1]
log-bin
log-slave-updates
[mysqld.2]
log-bin
log-slave-updates
[mysqld.3]
log-bin
log-slave-updates
[mysqld.4]
server-id=4
log-bin=server4-bin
log-slave-updates
[ENV]
SERVER_MYPORT_4= @mysqld.4.port
SERVER_MYSOCK_4= @mysqld.4.socket

View File

@ -0,0 +1,78 @@
create database a;
use a;
create table t1(a int);
insert into t1 values(1);
create table t2(a int);
insert into t2 values(1);
create database b;
use b;
create table t1(a int);
insert into t1 values(1);
create table t2(a int);
insert into t2 values(1);
create database c;
use c;
create table t1(a int);
insert into t1 values(1);
create table t2(a int);
insert into t2 values(1);
change master 'm1' to master_port=MYPORT_1 , master_host='127.0.0.1', master_user='root';
change master 'm2' to master_port=MYPORT_2 , master_host='127.0.0.1', master_user='root';
change master to master_port=MYPORT_3 , master_host='127.0.0.1', master_user='root';
start all slaves;
set default_master_connection = 'm1';
include/wait_for_slave_to_start.inc
set default_master_connection = 'm2';
include/wait_for_slave_to_start.inc
set default_master_connection = '';
include/wait_for_slave_to_start.inc
use a;
show tables;
Tables_in_a
t1
t2
use b;
show tables;
Tables_in_b
t1
t2
use c;
show tables;
Tables_in_c
t1
t2
#TEST
SET default_master_connection = "m1";
SET default_master_connection = "m2";
SET default_master_connection = "";
flush logs;
SET default_master_connection = "m1";
#log Rotated
mysqld-relay-bin.000002
mysqld-relay-bin.000003
mysqld-relay-bin.index
SET default_master_connection = "m2";
#log Rotated
mysqld-relay-bin-m1.000002
mysqld-relay-bin-m1.000003
mysqld-relay-bin-m1.index
SET default_master_connection = "";
#log Rotated
mysqld-relay-bin-m2.000002
mysqld-relay-bin-m2.000003
mysqld-relay-bin-m2.index
#CleanUp
drop database a;
drop database b;
drop database c;
stop all slaves;
Warnings:
Note 1938 SLAVE 'm2' stopped
Note 1938 SLAVE '' stopped
Note 1938 SLAVE 'm1' stopped
SET default_master_connection = "m1";
include/wait_for_slave_to_stop.inc
SET default_master_connection = "m2";
include/wait_for_slave_to_stop.inc
SET default_master_connection = "";
include/wait_for_slave_to_stop.inc

View File

@ -0,0 +1,116 @@
--source include/not_embedded.inc
--source include/have_innodb.inc
--source include/have_debug.inc
--connect (server_1,127.0.0.1,root,,,$SERVER_MYPORT_1)
--connect (server_2,127.0.0.1,root,,,$SERVER_MYPORT_2)
--connect (server_3,127.0.0.1,root,,,$SERVER_MYPORT_3)
--connect (server_4,127.0.0.1,root,,,$SERVER_MYPORT_4)
--connection server_1
create database a;
use a;
create table t1(a int);
insert into t1 values(1);
create table t2(a int);
insert into t2 values(1);
--save_master_pos
--connection server_2
create database b;
use b;
create table t1(a int);
insert into t1 values(1);
create table t2(a int);
insert into t2 values(1);
--save_master_pos
--connection server_3
create database c;
use c;
create table t1(a int);
insert into t1 values(1);
create table t2(a int);
insert into t2 values(1);
--save_master_pos
--connection server_4
--disable_warnings
--replace_result $SERVER_MYPORT_1 MYPORT_1
eval change master 'm1' to master_port=$SERVER_MYPORT_1 , master_host='127.0.0.1', master_user='root';
--replace_result $SERVER_MYPORT_2 MYPORT_2
eval change master 'm2' to master_port=$SERVER_MYPORT_2 , master_host='127.0.0.1', master_user='root';
--replace_result $SERVER_MYPORT_3 MYPORT_3
eval change master to master_port=$SERVER_MYPORT_3 , master_host='127.0.0.1', master_user='root';
start all slaves;
set default_master_connection = 'm1';
--source include/wait_for_slave_to_start.inc
set default_master_connection = 'm2';
--source include/wait_for_slave_to_start.inc
set default_master_connection = '';
--source include/wait_for_slave_to_start.inc
--enable_warnings
--sync_with_master 0,'m1'
--sync_with_master 0,'m2'
--sync_with_master 0,''
use a;
show tables;
use b;
show tables;
use c;
show tables;
--echo #TEST
SET default_master_connection = "m1";
--let $old_m1 = query_get_value("show relaylog events;", "Log_name",1)
SET default_master_connection = "m2";
--let $old_m2 = query_get_value("show relaylog events;", "Log_name",1)
SET default_master_connection = "";
--let $old__ = query_get_value("show relaylog events;", "Log_name",1)
flush logs;
--sleep 2
--let $MYSQLD_DATADIR = `select @@datadir`
SET default_master_connection = "m1";
--let $new_m1 = query_get_value("show relaylog events;", "Log_name",1)
--if ($new_m1 != $old_m1) {
--echo #log Rotated
--exec ls $MYSQLD_DATADIR | grep "mysqld-relay-bin\."
}
SET default_master_connection = "m2";
--let $new_m2 = query_get_value("show relaylog events;", "Log_name",1)
--if ($new_m2 != $old_m2) {
--echo #log Rotated
--exec ls $MYSQLD_DATADIR | grep "mysqld-relay-bin-m1"
}
SET default_master_connection = "";
--let $new__ = query_get_value("show relaylog events;", "Log_name",1)
--if ($new__ != $old__) {
--echo #log Rotated
--exec ls $MYSQLD_DATADIR | grep "mysqld-relay-bin-m2"
}
--echo #CleanUp
--connection server_1
drop database a;
--save_master_pos
--connection server_2
drop database b;
--save_master_pos
--connection server_3
drop database c;
--save_master_pos
--connection server_4
--sync_with_master 0,'m1'
--sync_with_master 0,'m2'
--sync_with_master 0,''
stop all slaves;
SET default_master_connection = "m1";
--source include/wait_for_slave_to_stop.inc
SET default_master_connection = "m2";
--source include/wait_for_slave_to_stop.inc
SET default_master_connection = "";
--source include/wait_for_slave_to_stop.inc

View File

@ -1 +1 @@
--performance-schema-digests-size=1
--loose-performance-schema-digests-size=1

View File

@ -12,11 +12,29 @@
--disable_query_log
eval SET @GALERA_VERSION=(SELECT CONCAT('$galera_version', '%'));
# Required Version
if (!`SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE
VARIABLE_NAME LIKE 'wsrep_provider_version' AND
VARIABLE_VALUE LIKE @GALERA_VERSION`)
eval SET @GALERA_VERSION='$galera_version';
SELECT CAST(REGEXP_REPLACE(@GALERA_VERSION,'^(\\d+)\\.(\\d+)\\.(\\d+).*','\\1') AS UNSIGNED) INTO @GALERA_MAJOR_VERSION;
SELECT CAST(REGEXP_REPLACE(@GALERA_VERSION,'^(\\d+)\\.(\\d+)\\.(\\d+).*','\\2') AS UNSIGNED) INTO @GALERA_MID_VERSION;
SELECT CAST(REGEXP_REPLACE(@GALERA_VERSION,'^(\\d+)\\.(\\d+)\\.(\\d+).*','\\3') AS UNSIGNED) INTO @GALERA_MINOR_VERSION;
# Actual
SELECT VARIABLE_VALUE INTO @ACTUAL_GALERA_VERSION FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE 'wsrep_provider_version';
SELECT CAST(REGEXP_REPLACE(@ACTUAL_GALERA_VERSION,'^(\\d+)\\.(\\d+)\\.(\\d+).*','\\1') AS UNSIGNED) INTO @ACTUAL_GALERA_MAJOR_VERSION;
SELECT CAST(REGEXP_REPLACE(@ACTUAL_GALERA_VERSION,'^(\\d+)\\.(\\d+)\\.(\\d+).*','\\2') AS UNSIGNED) INTO @ACTUAL_GALERA_MID_VERSION;
SELECT CAST(REGEXP_REPLACE(@ACTUAL_GALERA_VERSION,'^(\\d+)\\.(\\d+)\\.(\\d+).*','\\3') AS UNSIGNED) INTO @ACTUAL_GALERA_MINOR_VERSION;
# For testing
#SELECT @GALERA_MAJOR_VERSION, @GALERA_MID_VERSION, @GALERA_MINOR_VERSION;
#SELECT @ACTUAL_GALERA_VERSION;
#SELECT @ACTUAL_GALERA_MAJOR_VERSION, @ACTUAL_GALERA_MID_VERSION, @ACTUAL_GALERA_MINOR_VERSION;
if (!`SELECT (@ACTUAL_GALERA_MAJOR_VERSION > @GALERA_MAJOR_VERSION) OR
(@ACTUAL_GALERA_MAJOR_VERSION = @GALERA_MAJOR_VERSION AND @ACTUAL_GALERA_MID_VERSION > @GALERA_MID_VERSION) OR
(@ACTUAL_GALERA_MAJOR_VERSION = @GALERA_MAJOR_VERSION AND @ACTUAL_GALERA_MID_VERSION = @GALERA_MID_VERSION AND @ACTUAL_GALERA_MINOR_VERSION >= @GALERA_MINOR_VERSION)
`)
{
skip Test requires Galera library version $galera_version;
}

View File

@ -432,3 +432,10 @@ SELECT CAST(0xE001 AS BINARY) REGEXP @regCheck;
--echo # MDEV-12420: Testing recursion overflow
--replace_regex /[0-9]+ exceeded/NUM exceeded/
SELECT 1 FROM dual WHERE ('Alpha,Bravo,Charlie,Delta,Echo,Foxtrot,StrataCentral,Golf,Hotel,India,Juliet,Kilo,Lima,Mike,StrataL3,November,Oscar,StrataL2,Sand,P3,P4SwitchTest,Arsys,Poppa,ExtensionMgr,Arp,Quebec,Romeo,StrataApiV2,PtReyes,Sierra,SandAcl,Arrow,Artools,BridgeTest,Tango,SandT,PAlaska,Namespace,Agent,Qos,PatchPanel,ProjectReport,Ark,Gimp,Agent,SliceAgent,Arnet,Bgp,Ale,Tommy,Central,AsicPktTestLib,Hsc,SandL3,Abuild,Pca9555,Standby,ControllerDut,CalSys,SandLib,Sb820,PointV2,BfnLib,Evpn,BfnSdk,Sflow,ManagementActive,AutoTest,GatedTest,Bgp,Sand,xinetd,BfnAgentLib,bf-utils,Hello,BfnState,Eos,Artest,Qos,Scd,ThermoMgr,Uniform,EosUtils,Eb,FanController,Central,BfnL3,BfnL2,tcp_wrappers,Victor,Environment,Route,Failover,Whiskey,Xray,Gimp,BfnFixed,Strata,SoCal,XApi,Msrp,XpProfile,tcpdump,PatchPanel,ArosTest,FhTest,Arbus,XpAcl,MacConc,XpApi,telnet,QosTest,Alpha2,BfnVlan,Stp,VxlanControllerTest,MplsAgent,Bravo2,Lanz,BfnMbb,Intf,XCtrl,Unicast,SandTunnel,L3Unicast,Ipsec,MplsTest,Rsvp,EthIntf,StageMgr,Sol,MplsUtils,Nat,Ira,P4NamespaceDut,Counters,Charlie2,Aqlc,Mlag,Power,OpenFlow,Lag,RestApi,BfdTest,strongs,Sfa,CEosUtils,Adt746,MaintenanceMode,MlagDut,EosImage,IpEth,MultiProtocol,Launcher,Max3179,Snmp,Acl,IpEthTest,PhyEee,bf-syslibs,tacc,XpL2,p4-ar-switch,p4-bf-switch,LdpTest,BfnPhy,Mirroring,Phy6,Ptp' REGEXP '^((?!\b(Strata|StrataApi|StrataApiV2)\b).)*$');
#
# MDEV-12942 REGEXP_INSTR returns 1 when using brackets
#
SELECT REGEXP_INSTR('a_kollision', 'oll');
SELECT REGEXP_INSTR('a_kollision', '(oll)');
SELECT REGEXP_INSTR('a_kollision', 'o([lm])\\1');

View File

@ -778,5 +778,46 @@ where index_date_updated= 10 and index_id < 800;
drop table t0,t1,t2;
set optimizer_switch=@save_ext_key_optimizer_switch;
SET SESSION STORAGE_ENGINE=DEFAULT;
--echo #
--echo # MDEV-11196: Error:Run-Time Check Failure #2 - Stack around the variable 'key_buff'
--echo # was corrupted, server crashes in opt_sum_query
CREATE TABLE t1 (
pk INT,
f1 VARCHAR(3),
f2 VARCHAR(1024),
PRIMARY KEY (pk),
KEY(f2)
) ENGINE=InnoDB CHARSET utf8 ROW_FORMAT= DYNAMIC;
INSERT INTO t1 VALUES (1,'foo','abc'),(2,'bar','def');
SELECT MAX(t2.pk) FROM t1 t2 INNER JOIN t1 t3 ON t2.f1 = t3.f1 WHERE t2.pk <= 4;
drop table t1;
CREATE TABLE t1 (
pk1 INT,
pk2 INT,
f1 VARCHAR(3),
f2 VARCHAR(1021),
PRIMARY KEY (pk1,pk2),
KEY(f2)
) ENGINE=InnoDB CHARSET utf8 ROW_FORMAT= DYNAMIC;
INSERT INTO t1 VALUES (1,2,'2','abc'),(2,3,'3','def');
explain format= json
select * from t1 force index(f2) where pk1 <= 5 and pk2 <=5 and f2 = 'abc' and f1 <= '3';
drop table t1;
CREATE TABLE t1 (
f2 INT,
pk2 INT,
f1 VARCHAR(3),
pk1 VARCHAR(1000),
PRIMARY KEY (pk1,pk2),
KEY k1(pk1,f2)
) ENGINE=InnoDB CHARSET utf8 ROW_FORMAT= DYNAMIC;
INSERT INTO t1 VALUES (1,2,'2','abc'),(2,3,'3','def');
explain format= json
select * from t1 force index(k1) where f2 <= 5 and pk2 <=5 and pk1 = 'abc' and f1 <= '3';
drop table t1;

View File

@ -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;

View File

@ -576,3 +576,38 @@ from
t1;
drop table t1,t2;
--echo #
--echo # mdev-12931: semi-join in ON expression of STRAIGHT_JOIN
--echo # joining a base table and a mergeable derived table
--echo #
CREATE TABLE t1 (f1 int) ENGINE=InnoDB;
INSERT INTO t1 VALUES (3),(2);
CREATE TABLE t2 (f2 int) ENGINE=InnoDB;
INSERT INTO t2 VALUES (1),(4);
CREATE TABLE t3 (f3 int) ENGINE=InnoDB;
INSERT INTO t3 VALUES (5),(6);
CREATE TABLE t4 (f4 int) ENGINE=InnoDB;
INSERT INTO t4 VALUES (1),(8);
SELECT *
FROM t1
INNER JOIN
( t2 STRAIGHT_JOIN ( SELECT * FROM t3 ) AS sq
ON ( 1 IN ( SELECT f4 FROM t4 ) ) )
ON ( f1 >= f2 );
EXPLAIN EXTENDED
SELECT *
FROM t1
INNER JOIN
( t2 STRAIGHT_JOIN ( SELECT * FROM t3 ) AS sq
ON ( 1 IN ( SELECT f4 FROM t4 ) ) )
ON ( f1 >= f2 );
DROP TABLE t1,t2,t3,t4;

View File

@ -5,7 +5,7 @@
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
if [ "${1}" == "-h" -o "${1}" == "--help" ]; then
if [ "${1}" = "-h" ] || [ "${1}" = "--help" ]; then
cat <<EOF
Usage: ${0}

View File

@ -5668,6 +5668,20 @@ bool handler::check_table_binlog_row_based_internal(bool binlog_row)
table->file->partition_ht()->db_type != DB_TYPE_INNODB) ||
(thd->wsrep_ignore_table == true)))
return 0;
/* enforce wsrep_max_ws_rows */
if (WSREP(thd) && table->s->tmp_table == NO_TMP_TABLE)
{
thd->wsrep_affected_rows++;
if (wsrep_max_ws_rows &&
thd->wsrep_exec_mode != REPL_RECV &&
thd->wsrep_affected_rows > wsrep_max_ws_rows)
{
trans_rollback_stmt(thd) || trans_rollback(thd);
my_message(ER_ERROR_DURING_COMMIT, "wsrep_max_ws_rows exceeded", MYF(0));
return ER_ERROR_DURING_COMMIT;
}
}
#endif
return (table->s->cached_row_logging_check &&

View File

@ -5566,7 +5566,7 @@ int Regexp_processor_pcre::pcre_exec_with_warn(const pcre *code,
bool Regexp_processor_pcre::exec(const char *str, int length, int offset)
{
m_pcre_exec_rc= pcre_exec_with_warn(m_pcre, &m_pcre_extra, str, length, offset, 0,
m_SubStrVec, m_subpatterns_needed * 3);
m_SubStrVec, array_elements(m_SubStrVec));
return false;
}
@ -5579,7 +5579,7 @@ bool Regexp_processor_pcre::exec(String *str, int offset,
m_pcre_exec_rc= pcre_exec_with_warn(m_pcre, &m_pcre_extra,
str->c_ptr_safe(), str->length(),
offset, 0,
m_SubStrVec, m_subpatterns_needed * 3);
m_SubStrVec, array_elements(m_SubStrVec));
if (m_pcre_exec_rc > 0)
{
uint i;
@ -5637,7 +5637,7 @@ Item_func_regex::fix_length_and_dec()
if (agg_arg_charsets_for_comparison(cmp_collation, args, 2))
return;
re.init(cmp_collation.collation, 0, 0);
re.init(cmp_collation.collation, 0);
re.fix_owner(this, args[0], args[1]);
}
@ -5661,7 +5661,7 @@ Item_func_regexp_instr::fix_length_and_dec()
if (agg_arg_charsets_for_comparison(cmp_collation, args, 2))
return;
re.init(cmp_collation.collation, 0, 1);
re.init(cmp_collation.collation, 0);
re.fix_owner(this, args[0], args[1]);
}

View File

@ -2020,7 +2020,6 @@ class Regexp_processor_pcre
String m_prev_pattern;
int m_pcre_exec_rc;
int m_SubStrVec[30];
uint m_subpatterns_needed;
void pcre_exec_warn(int rc) const;
int pcre_exec_with_warn(const pcre *code, const pcre_extra *extra,
const char *subject, int length, int startoffset,
@ -2034,15 +2033,14 @@ public:
m_pcre(NULL), m_conversion_is_needed(true), m_is_const(0),
m_library_flags(0),
m_data_charset(&my_charset_utf8_general_ci),
m_library_charset(&my_charset_utf8_general_ci),
m_subpatterns_needed(0)
m_library_charset(&my_charset_utf8_general_ci)
{
m_pcre_extra.flags= PCRE_EXTRA_MATCH_LIMIT_RECURSION;
m_pcre_extra.match_limit_recursion= 100L;
}
int default_regex_flags();
void set_recursion_limit(THD *);
void init(CHARSET_INFO *data_charset, int extra_flags, uint nsubpatterns_arg)
void init(CHARSET_INFO *data_charset, int extra_flags)
{
m_library_flags= default_regex_flags() | extra_flags |
(data_charset != &my_charset_bin ?
@ -2056,7 +2054,6 @@ public:
m_conversion_is_needed= (data_charset != &my_charset_bin) &&
!my_charset_same(data_charset, m_library_charset);
m_subpatterns_needed= nsubpatterns_arg;
}
void fix_owner(Item_func *owner, Item *subject_arg, Item *pattern_arg);
bool compile(String *pattern, bool send_error);

View File

@ -1270,7 +1270,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(void *)
{
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; }
@ -1588,7 +1592,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(void *opt_arg)
{
not_null_tables_cache= 0;
return 0;
}
bool is_expensive() { return 1; }
virtual void print(String *str, enum_query_type query_type);
bool check_vcol_func_processor(void *arg)
@ -2118,7 +2126,11 @@ public:
bool is_expensive_processor(void *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(void *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 */
@ -2401,6 +2413,11 @@ public:
clone->sp_result_field= NULL;
return clone;
}
bool eval_not_null_tables(void *opt_arg)
{
not_null_tables_cache= 0;
return 0;
}
};
@ -2453,7 +2470,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(void *)
{
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();

View File

@ -1277,7 +1277,7 @@ void Item_func_regexp_replace::fix_length_and_dec()
if (agg_arg_charsets_for_string_result_with_comparison(collation, args, 3))
return;
max_length= MAX_BLOB_WIDTH;
re.init(collation.collation, 0, 10);
re.init(collation.collation, 0);
re.fix_owner(this, args[0], args[1]);
}
@ -1412,7 +1412,7 @@ void Item_func_regexp_substr::fix_length_and_dec()
if (agg_arg_charsets_for_string_result_with_comparison(collation, args, 2))
return;
fix_char_length(args[0]->max_char_length());
re.init(collation.collation, 0, 10);
re.init(collation.collation, 0);
re.fix_owner(this, args[0], args[1]);
}

View File

@ -8402,7 +8402,6 @@ int Xid_log_event::do_apply_event(rpl_group_info *rgi)
consistent.
*/
#ifdef WITH_WSREP
/*Set wsrep_affected_rows = 0 */
thd->wsrep_affected_rows= 0;
#endif

View File

@ -41,7 +41,7 @@ Master_info::Master_info(LEX_STRING *connection_name_arg,
master_id(0), prev_master_id(0),
using_gtid(USE_GTID_NO), events_queued_since_last_gtid(0),
gtid_reconnect_event_skip_count(0), gtid_event_seen(false),
in_start_all_slaves(0), in_stop_all_slaves(0),
in_start_all_slaves(0), in_stop_all_slaves(0), in_flush_all_relay_logs(0),
users(0), killed(0)
{
host[0] = 0; user[0] = 0; password[0] = 0;
@ -1980,4 +1980,53 @@ void prot_store_ids(THD *thd, DYNAMIC_ARRAY *ids)
return;
}
bool Master_info_index::flush_all_relay_logs()
{
DBUG_ENTER("flush_all_relay_logs");
bool result= false;
int error= 0;
mysql_mutex_lock(&LOCK_active_mi);
for (uint i= 0; i< master_info_hash.records; i++)
{
Master_info *mi;
mi= (Master_info *) my_hash_element(&master_info_hash, i);
mi->in_flush_all_relay_logs= 0;
}
for (uint i=0; i < master_info_hash.records;)
{
Master_info *mi;
mi= (Master_info *)my_hash_element(&master_info_hash, i);
DBUG_ASSERT(mi);
if (mi->in_flush_all_relay_logs)
{
i++;
continue;
}
mi->in_flush_all_relay_logs= 1;
mysql_mutex_lock(&mi->sleep_lock);
mi->users++; // Mark used
mysql_mutex_unlock(&mi->sleep_lock);
mysql_mutex_unlock(&LOCK_active_mi);
mysql_mutex_lock(&mi->data_lock);
error= rotate_relay_log(mi);
mysql_mutex_unlock(&mi->data_lock);
mi->release();
mysql_mutex_lock(&LOCK_active_mi);
if (error)
{
result= true;
break;
}
/* Restart from first element as master_info_hash may have changed */
i= 0;
continue;
}
mysql_mutex_unlock(&LOCK_active_mi);
DBUG_RETURN(result);
}
#endif /* HAVE_REPLICATION */

View File

@ -302,6 +302,7 @@ class Master_info : public Slave_reporting_capability
/* gtid_event_seen is false until we receive first GTID event from master. */
bool gtid_event_seen;
bool in_start_all_slaves, in_stop_all_slaves;
bool in_flush_all_relay_logs;
uint users; /* Active user for object */
uint killed;
@ -354,6 +355,7 @@ public:
bool start_all_slaves(THD *thd);
bool stop_all_slaves(THD *thd);
void free_connections();
bool flush_all_relay_logs();
};

View File

@ -181,8 +181,12 @@ bool reload_acl_and_cache(THD *thd, unsigned long long options,
slave is not likely to have the same connection names.
*/
tmp_write_to_binlog= 0;
if (!(mi= (get_master_info(&connection_name,
if (connection_name.length == 0)
{
if (master_info_index->flush_all_relay_logs())
*write_to_binlog= -1;
}
else if (!(mi= (get_master_info(&connection_name,
Sql_condition::WARN_LEVEL_ERROR))))
{
result= 1;

View File

@ -14552,7 +14552,8 @@ simplify_joins(JOIN *join, List<TABLE_LIST> *join_list, COND *conds, bool top,
table->table->maybe_null= FALSE;
table->outer_join= 0;
if (!(straight_join || table->straight))
table->dep_tables= table->embedding? table->embedding->dep_tables: 0;
table->dep_tables= table->embedding && !table->embedding->sj_subq_pred ?
table->embedding->dep_tables : 0;
if (table->on_expr)
{
/* Add ON expression to the WHERE or upper-level ON condition. */

View File

@ -2039,6 +2039,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
keyinfo= share->key_info;
uint primary_key= my_strcasecmp(system_charset_info, share->keynames.type_names[0],
primary_key_name) ? MAX_KEY : 0;
KEY* key_first_info;
if (primary_key >= MAX_KEY && keyinfo->flags & HA_NOSAME)
{
@ -2118,19 +2119,38 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
keyinfo->name_length+1);
}
if (!key)
key_first_info= keyinfo;
if (ext_key_parts > share->key_parts && key)
{
KEY_PART_INFO *new_key_part= (keyinfo-1)->key_part +
(keyinfo-1)->ext_key_parts;
uint add_keyparts_for_this_key= add_first_key_parts;
uint length_bytes= 0, len_null_byte= 0, ext_key_length= 0;
Field *field;
/*
Do not extend the key that contains a component
defined over the beginning of a field.
*/
for (i= 0; i < keyinfo->user_defined_key_parts; i++)
{
{
uint fieldnr= keyinfo->key_part[i].fieldnr;
field= share->field[keyinfo->key_part[i].fieldnr-1];
if (field->null_ptr)
len_null_byte= HA_KEY_NULL_LENGTH;
if (field->type() == MYSQL_TYPE_BLOB ||
field->real_type() == MYSQL_TYPE_VARCHAR ||
field->type() == MYSQL_TYPE_GEOMETRY)
{
length_bytes= HA_KEY_BLOB_LENGTH;
}
ext_key_length+= keyinfo->key_part[i].length + len_null_byte
+ length_bytes;
if (share->field[fieldnr-1]->key_length() !=
keyinfo->key_part[i].length)
{
@ -2139,6 +2159,23 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
}
}
if (add_keyparts_for_this_key)
{
for (i= 0; i < add_keyparts_for_this_key; i++)
{
uint pk_part_length= key_first_info->key_part[i].store_length;
if (keyinfo->ext_key_part_map & 1<<i)
{
if (ext_key_length + pk_part_length > MAX_KEY_LENGTH)
{
add_keyparts_for_this_key= i;
break;
}
ext_key_length+= pk_part_length;
}
}
}
if (add_keyparts_for_this_key < (keyinfo->ext_key_parts -
keyinfo->user_defined_key_parts))
{

View File

@ -1133,9 +1133,7 @@ btr_create(
const btr_create_t* btr_redo_create_info,
mtr_t* mtr)
{
ulint page_no;
buf_block_t* block;
buf_frame_t* frame;
page_t* page;
page_zip_des_t* page_zip;
@ -1170,33 +1168,28 @@ btr_create(
+ IBUF_HEADER + IBUF_TREE_SEG_HEADER,
IBUF_TREE_ROOT_PAGE_NO,
FSP_UP, mtr);
if (block == NULL) {
return(FIL_NULL);
}
ut_ad(block->page.id.page_no() == IBUF_TREE_ROOT_PAGE_NO);
buf_block_dbg_add_level(block, SYNC_IBUF_TREE_NODE_NEW);
flst_init(block->frame + PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST,
mtr);
} else {
block = fseg_create(space, 0,
PAGE_HEADER + PAGE_BTR_SEG_TOP, mtr);
}
if (block == NULL) {
if (block == NULL) {
return(FIL_NULL);
}
return(FIL_NULL);
}
page_no = block->page.id.page_no();
frame = buf_block_get_frame(block);
if (type & DICT_IBUF) {
/* It is an insert buffer tree: initialize the free list */
buf_block_dbg_add_level(block, SYNC_IBUF_TREE_NODE_NEW);
ut_ad(page_no == IBUF_TREE_ROOT_PAGE_NO);
flst_init(frame + PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST, mtr);
} else {
/* It is a non-ibuf tree: create a file segment for leaf
pages */
buf_block_dbg_add_level(block, SYNC_TREE_NODE_NEW);
if (!fseg_create(space, page_no,
if (!fseg_create(space, block->page.id.page_no(),
PAGE_HEADER + PAGE_BTR_SEG_LEAF, mtr)) {
/* Not enough space for new segment, free root
segment before return. */
@ -1287,7 +1280,7 @@ btr_create(
ut_ad(page_get_max_insert_size(page, 2) > 2 * BTR_PAGE_MAX_REC_SIZE);
return(page_no);
return(block->page.id.page_no());
}
/** Free a B-tree except the root page. The root page MUST be freed after

View File

@ -3872,14 +3872,25 @@ buf_zip_decompress(
{
const byte* frame = block->page.zip.data;
ulint size = page_zip_get_size(&block->page.zip);
/* The tablespace will not be found if this function is called
during IMPORT. */
fil_space_t* space = fil_space_acquire_for_io(block->page.id.space());
const unsigned key_version = mach_read_from_4(
frame + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION);
fil_space_crypt_t* crypt_data = space ? space->crypt_data : NULL;
const bool encrypted = crypt_data
&& crypt_data->type != CRYPT_SCHEME_UNENCRYPTED
&& (!crypt_data->is_default_encryption()
|| srv_encrypt_tables);
ut_ad(block->page.size.is_compressed());
ut_a(block->page.id.space() != 0);
if (UNIV_UNLIKELY(check && !page_zip_verify_checksum(frame, size))) {
ib::error() << "Compressed page checksum mismatch "
<< block->page.id << "): stored: "
ib::error() << "Compressed page checksum mismatch for "
<< (space ? space->chain.start->name : "")
<< block->page.id << ": stored: "
<< mach_read_from_4(frame + FIL_PAGE_SPACE_OR_CHKSUM)
<< ", crc32: "
<< page_zip_calc_checksum(
@ -3895,7 +3906,7 @@ buf_zip_decompress(
<< page_zip_calc_checksum(
frame, size, SRV_CHECKSUM_ALGORITHM_NONE);
return(FALSE);
goto err_exit;
}
switch (fil_page_get_type(frame)) {
@ -3903,15 +3914,16 @@ buf_zip_decompress(
case FIL_PAGE_RTREE:
if (page_zip_decompress(&block->page.zip,
block->frame, TRUE)) {
if (space) {
fil_space_release_for_io(space);
}
return(TRUE);
}
ib::error() << "Unable to decompress space "
<< block->page.id.space()
<< " page " << block->page.id.page_no();
return(FALSE);
ib::error() << "Unable to decompress "
<< (space ? space->chain.start->name : "")
<< block->page.id;
goto err_exit;
case FIL_PAGE_TYPE_ALLOCATED:
case FIL_PAGE_INODE:
case FIL_PAGE_IBUF_BITMAP:
@ -3921,11 +3933,31 @@ buf_zip_decompress(
case FIL_PAGE_TYPE_ZBLOB2:
/* Copy to uncompressed storage. */
memcpy(block->frame, frame, block->page.size.physical());
if (space) {
fil_space_release_for_io(space);
}
return(TRUE);
}
ib::error() << "Unknown compressed page type "
<< fil_page_get_type(frame);
<< fil_page_get_type(frame)
<< " in " << (space ? space->chain.start->name : "")
<< block->page.id;
err_exit:
if (encrypted) {
ib::info() << "Row compressed page could be encrypted"
" with key_version " << key_version;
block->page.encrypted = true;
dict_set_encrypted_by_space(block->page.id.space());
} else {
dict_set_corrupted_by_space(block->page.id.space());
}
if (space) {
fil_space_release_for_io(space);
}
return(FALSE);
}
@ -4526,12 +4558,21 @@ got_block:
/* Decompress the page while not holding
buf_pool->mutex or block->mutex. */
/* Page checksum verification is already done when
the page is read from disk. Hence page checksum
verification is not necessary when decompressing the page. */
{
bool success = buf_zip_decompress(block, FALSE);
ut_a(success);
bool success = buf_zip_decompress(block, TRUE);
if (!success) {
buf_pool_mutex_enter(buf_pool);
buf_page_mutex_enter(fix_block);
buf_block_set_io_fix(fix_block, BUF_IO_NONE);
buf_page_mutex_exit(fix_block);
--buf_pool->n_pend_unzip;
buf_block_unfix(fix_block);
buf_pool_mutex_exit(buf_pool);
rw_lock_x_unlock(&fix_block->lock);
return NULL;
}
}
if (!recv_no_ibuf_operations) {
@ -4634,19 +4675,12 @@ got_block:
goto loop;
}
ib::info() << "innodb_change_buffering_debug evict "
<< page_id;
return(NULL);
}
buf_page_mutex_enter(fix_block);
if (buf_flush_page_try(buf_pool, fix_block)) {
ib::info() << "innodb_change_buffering_debug flush "
<< page_id;
guess = fix_block;
goto loop;
@ -5563,15 +5597,11 @@ buf_page_create(
memset(frame + FIL_PAGE_NEXT, 0xff, 4);
mach_write_to_2(frame + FIL_PAGE_TYPE, FIL_PAGE_TYPE_ALLOCATED);
/* These 8 bytes are also repurposed for PageIO compression and must
be reset when the frame is assigned to a new page id. See fil0fil.h.
FIL_PAGE_FILE_FLUSH_LSN is used on the following pages:
/* FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION is only used on the
following pages:
(1) The first page of the InnoDB system tablespace (page 0:0)
(2) FIL_RTREE_SPLIT_SEQ_NUM on R-tree pages .
Therefore we don't transparently compress such pages. */
(2) FIL_RTREE_SPLIT_SEQ_NUM on R-tree pages
(3) key_version on encrypted pages (not page 0:0) */
memset(frame + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION, 0, 8);

View File

@ -162,11 +162,11 @@ buf_dblwr_init(
ut_zalloc_nokey(buf_size * sizeof(void*)));
}
/****************************************************************//**
Creates the doublewrite buffer to a new InnoDB installation. The header of the
doublewrite buffer is placed on the trx system header page.
@return true if successful, false if not. */
MY_ATTRIBUTE((warn_unused_result))
/** Create the doublewrite buffer if the doublewrite buffer header
is not present in the TRX_SYS page.
@return whether the operation succeeded
@retval true if the doublewrite buffer exists or was created
@retval false if the creation failed (too small first data file) */
bool
buf_dblwr_create()
{
@ -181,12 +181,11 @@ buf_dblwr_create()
if (buf_dblwr) {
/* Already inited */
return(true);
}
start_again:
mtr_start(&mtr);
mtr.start();
buf_dblwr_being_created = TRUE;
doublewrite = buf_dblwr_get(&mtr);
@ -198,33 +197,49 @@ start_again:
buf_dblwr_init(doublewrite);
mtr_commit(&mtr);
mtr.commit();
buf_dblwr_being_created = FALSE;
return(true);
}
} else {
fil_space_t* space = fil_space_acquire(TRX_SYS_SPACE);
const bool fail = UT_LIST_GET_FIRST(space->chain)->size
< 3 * FSP_EXTENT_SIZE;
fil_space_release(space);
ib::info() << "Doublewrite buffer not found: creating new";
if (fail) {
goto too_small;
}
}
block2 = fseg_create(TRX_SYS_SPACE, TRX_SYS_PAGE_NO,
TRX_SYS_DOUBLEWRITE
+ TRX_SYS_DOUBLEWRITE_FSEG, &mtr);
if (block2 == NULL) {
too_small:
ib::error()
<< "Cannot create doublewrite buffer: "
"the first file in innodb_data_file_path"
" must be at least "
<< (3 * (FSP_EXTENT_SIZE * UNIV_PAGE_SIZE) >> 20)
<< "M.";
mtr.commit();
return(false);
}
ib::info() << "Doublewrite buffer not found: creating new";
/* FIXME: After this point, the doublewrite buffer creation
is not atomic. The doublewrite buffer should not exist in
the InnoDB system tablespace file in the first place.
It could be located in separate optional file(s) in a
user-specified location. */
/* fseg_create acquires a second latch on the page,
therefore we must declare it: */
buf_block_dbg_add_level(block2, SYNC_NO_ORDER_CHECK);
if (block2 == NULL) {
ib::error() << "Cannot create doublewrite buffer: you must"
" increase your tablespace size."
" Cannot continue operation.";
/* The mini-transaction did not write anything yet;
we merely failed to allocate a page. */
mtr.commit();
return(false);
}
fseg_header = doublewrite + TRX_SYS_DOUBLEWRITE_FSEG;
prev_page_no = 0;
@ -516,6 +531,10 @@ buf_dblwr_process()
byte* unaligned_read_buf;
recv_dblwr_t& recv_dblwr = recv_sys->dblwr;
if (!buf_dblwr) {
return;
}
unaligned_read_buf = static_cast<byte*>(
ut_malloc_nokey(2 * UNIV_PAGE_SIZE));

View File

@ -460,14 +460,9 @@ dict_build_tablespace_for_table(
mtr_start(&mtr);
mtr.set_named_space(table->space);
bool ret = fsp_header_init(table->space,
FIL_IBD_FILE_INITIAL_SIZE,
&mtr);
fsp_header_init(table->space, FIL_IBD_FILE_INITIAL_SIZE, &mtr);
mtr_commit(&mtr);
if (!ret) {
return(DB_ERROR);
}
} else {
ut_ad(dict_tf_get_rec_format(table->flags)
!= REC_FORMAT_COMPRESSED);

View File

@ -831,7 +831,7 @@ fil_space_decrypt(
Calculate post encryption checksum
@param[in] page_size page size
@param[in] dst_frame Block where checksum is calculated
@return page checksum or BUF_NO_CHECKSUM_MAGIC
@return page checksum
not needed. */
UNIV_INTERN
uint32_t
@ -839,34 +839,11 @@ fil_crypt_calculate_checksum(
const page_size_t& page_size,
const byte* dst_frame)
{
uint32_t checksum = 0;
srv_checksum_algorithm_t algorithm =
static_cast<srv_checksum_algorithm_t>(srv_checksum_algorithm);
if (!page_size.is_compressed()) {
switch (algorithm) {
case SRV_CHECKSUM_ALGORITHM_CRC32:
case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32:
checksum = buf_calc_page_crc32(dst_frame);
break;
case SRV_CHECKSUM_ALGORITHM_INNODB:
case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB:
checksum = (ib_uint32_t) buf_calc_page_new_checksum(
dst_frame);
break;
case SRV_CHECKSUM_ALGORITHM_NONE:
case SRV_CHECKSUM_ALGORITHM_STRICT_NONE:
checksum = BUF_NO_CHECKSUM_MAGIC;
break;
/* no default so the compiler will emit a warning
* if new enum is added and not handled here */
}
} else {
checksum = page_zip_calc_checksum(dst_frame, page_size.physical(),
algorithm);
}
return checksum;
/* For encrypted tables we use only crc32 and strict_crc32 */
return page_size.is_compressed()
? page_zip_calc_checksum(dst_frame, page_size.physical(),
SRV_CHECKSUM_ALGORITHM_CRC32)
: buf_calc_page_crc32(dst_frame);
}
/***********************************************************************/
@ -2492,15 +2469,8 @@ fil_space_verify_crypt_checksum(
return false;
}
srv_checksum_algorithm_t algorithm =
static_cast<srv_checksum_algorithm_t>(srv_checksum_algorithm);
/* If no checksum is used, can't continue checking. */
if (algorithm == SRV_CHECKSUM_ALGORITHM_NONE) {
return(true);
}
/* Read stored post encryption checksum. */
ib_uint32_t checksum = mach_read_from_4(
uint32_t checksum = mach_read_from_4(
page + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION + 4);
/* Declare empty pages non-corrupted */

View File

@ -4282,12 +4282,14 @@ fil_ibd_open(
df_default.close();
tablespaces_found--;
}
if (df_dict.is_open() && !df_dict.is_valid()) {
df_dict.close();
/* Leave dict.filepath so that SYS_DATAFILES
can be corrected below. */
tablespaces_found--;
}
if (df_remote.is_open() && !df_remote.is_valid()) {
df_remote.close();
tablespaces_found--;
@ -5151,23 +5153,16 @@ fil_report_invalid_page_access(
ulint len, /*!< in: I/O length */
bool is_read) /*!< in: I/O type */
{
ib::error()
<< "Trying to access page number " << block_offset << " in"
ib::fatal()
<< "Trying to " << (is_read ? "read" : "write")
<< " page number " << block_offset << " in"
" space " << space_id << ", space name " << space_name << ","
" which is outside the tablespace bounds. Byte offset "
<< byte_offset << ", len " << len << ", i/o type " <<
(is_read ? "read" : "write")
<< ". If you get this error at mysqld startup, please check"
" that your my.cnf matches the ibdata files that you have in"
" the MySQL server.";
ib::error() << "Server exits"
#ifdef UNIV_DEBUG
<< " at " << __FILE__ << "[" << __LINE__ << "]"
#endif
<< ".";
_exit(1);
<< byte_offset << ", len " << len <<
(space_id == 0 && !srv_was_started
? "Please check that the configuration matches"
" the InnoDB system tablespace location (ibdata files)"
: "");
}
/** Reads or writes data. This operation could be asynchronous (aio).

View File

@ -690,17 +690,12 @@ fsp_header_init_fields(
flags);
}
/** Initializes the space header of a new created space and creates also the
insert buffer tree root if space == 0.
/** Initialize a tablespace header.
@param[in] space_id space id
@param[in] size current size in blocks
@param[in,out] mtr min-transaction
@return true on success, otherwise false. */
bool
fsp_header_init(
ulint space_id,
ulint size,
mtr_t* mtr)
@param[in,out] mtr mini-transaction */
void
fsp_header_init(ulint space_id, ulint size, mtr_t* mtr)
{
fsp_header_t* header;
buf_block_t* block;
@ -752,19 +747,9 @@ fsp_header_init(
fsp_fill_free_list(!is_system_tablespace(space_id),
space, header, mtr);
if (space_id == srv_sys_space.space_id()) {
if (btr_create(DICT_CLUSTERED | DICT_UNIVERSAL | DICT_IBUF,
0, univ_page_size, DICT_IBUF_ID_MIN + space_id,
dict_ind_redundant, NULL, mtr) == FIL_NULL) {
return(false);
}
}
if (space->crypt_data) {
space->crypt_data->write_page0(space, page, mtr);
}
return(true);
}
/**********************************************************************//**
@ -2096,7 +2081,6 @@ fseg_create_general(
inode = fsp_alloc_seg_inode(space, space_header, mtr);
if (inode == NULL) {
goto funct_exit;
}

View File

@ -834,17 +834,6 @@ SysTablespace::check_file_spec(
}
}
/* We assume doublewirte blocks in the first data file. */
if (err == DB_SUCCESS && *create_new_db
&& begin->m_size < TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * 3) {
ib::error() << "The " << name() << " data file "
<< "'" << begin->name() << "' must be at least "
<< TRX_SYS_DOUBLEWRITE_BLOCK_SIZE * 3 * UNIV_PAGE_SIZE
/ (1024 * 1024) << " MB";
err = DB_ERROR;
}
return(err);
}

View File

@ -38,10 +38,11 @@ extern buf_dblwr_t* buf_dblwr;
/** Set to TRUE when the doublewrite buffer is being created */
extern ibool buf_dblwr_being_created;
/****************************************************************//**
Creates the doublewrite buffer to a new InnoDB installation. The header of the
doublewrite buffer is placed on the trx system header page.
@return true if successful, false if not. */
/** Create the doublewrite buffer if the doublewrite buffer header
is not present in the TRX_SYS page.
@return whether the operation succeeded
@retval true if the doublewrite buffer exists or was created
@retval false if the creation failed (too small first data file) */
MY_ATTRIBUTE((warn_unused_result))
bool
buf_dblwr_create();

View File

@ -397,18 +397,12 @@ fsp_header_init_fields(
ulint space_id, /*!< in: space id */
ulint flags); /*!< in: tablespace flags (FSP_SPACE_FLAGS):
0, or table->flags if newer than COMPACT */
/** Initializes the space header of a new created space and creates also the
insert buffer tree root if space == 0.
/** Initialize a tablespace header.
@param[in] space_id space id
@param[in] size current size in blocks
@param[in,out] mtr min-transaction
@return true on success, otherwise false. */
bool
fsp_header_init(
ulint space_id,
ulint size,
mtr_t* mtr);
@param[in,out] mtr mini-transaction */
void
fsp_header_init(ulint space_id, ulint size, mtr_t* mtr);
/**********************************************************************//**
Increases the space size field of a space. */

View File

@ -110,9 +110,12 @@ void
trx_rseg_mem_free(trx_rseg_t* rseg);
/** Create a persistent rollback segment.
@param[in] space_id system or undo tablespace id */
@param[in] space_id system or undo tablespace id
@return pointer to new rollback segment
@retval NULL on failure */
trx_rseg_t*
trx_rseg_create(ulint space_id);
trx_rseg_create(ulint space_id)
MY_ATTRIBUTE((warn_unused_result));
/** Create the temporary rollback segments. */
void

View File

@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2016, 2017, MariaDB Corporation.
Copyright (c) 2015, 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software

View File

@ -2537,7 +2537,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();

View File

@ -1334,7 +1334,7 @@ srv_init_abort_low(
dberr_t err)
{
if (create_new_db) {
ib::error() << "InnoDB Database creation was aborted"
ib::error() << "Database creation was aborted"
#ifdef UNIV_DEBUG
" at " << innobase_basename(file) << "[" << line << "]"
#endif /* UNIV_DEBUG */
@ -2131,14 +2131,24 @@ files_checked:
mtr_start(&mtr);
bool ret = fsp_header_init(0, sum_of_new_sizes, &mtr);
fsp_header_init(0, sum_of_new_sizes, &mtr);
compile_time_assert(TRX_SYS_SPACE == 0);
compile_time_assert(IBUF_SPACE_ID == 0);
ulint ibuf_root = btr_create(
DICT_CLUSTERED | DICT_UNIVERSAL | DICT_IBUF,
0, univ_page_size, DICT_IBUF_ID_MIN,
dict_ind_redundant, NULL, &mtr);
mtr_commit(&mtr);
if (!ret) {
if (ibuf_root == FIL_NULL) {
return(srv_init_abort(DB_ERROR));
}
ut_ad(ibuf_root == IBUF_TREE_ROOT_PAGE_NO);
/* To maintain backward compatibility we create only
the first rollback segment before the double write buffer.
All the remaining rollback segments will be created later,
@ -2286,7 +2296,7 @@ files_checked:
const ulint sum_of_data_file_sizes
= srv_sys_space.get_sum_of_sizes();
/* Compare the system tablespace file size to what is
stored in FSP_SIZE. In open_or_create_data_files()
stored in FSP_SIZE. In srv_sys_space.open_or_create()
we already checked that the file sizes match the
innodb_data_file_path specification. */
if (srv_read_only_mode
@ -2393,7 +2403,6 @@ files_checked:
}
}
/* Validate a few system page types that were left
uninitialized by older versions of MySQL. */
if (!high_level_read_only) {

View File

@ -263,7 +263,9 @@ trx_rseg_array_init()
}
/** Create a persistent rollback segment.
@param[in] space_id system or undo tablespace id */
@param[in] space_id system or undo tablespace id
@return pointer to new rollback segment
@retval NULL on failure */
trx_rseg_t*
trx_rseg_create(ulint space_id)
{

View File

@ -2,7 +2,7 @@
Copyright (c) 1994, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
Copyright (c) 2014, 2017, MariaDB Corporation
Copyright (c) 2014, 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@ -1703,9 +1703,7 @@ btr_create(
dict_index_t* index, /*!< in: index */
mtr_t* mtr) /*!< in: mini-transaction handle */
{
ulint page_no;
buf_block_t* block;
buf_frame_t* frame;
page_t* page;
page_zip_des_t* page_zip;
@ -1720,6 +1718,10 @@ btr_create(
space, 0,
IBUF_HEADER + IBUF_TREE_SEG_HEADER, mtr);
if (ibuf_hdr_block == NULL) {
return(FIL_NULL);
}
buf_block_dbg_add_level(
ibuf_hdr_block, SYNC_IBUF_TREE_NODE_NEW);
@ -1733,7 +1735,17 @@ btr_create(
+ IBUF_HEADER + IBUF_TREE_SEG_HEADER,
IBUF_TREE_ROOT_PAGE_NO,
FSP_UP, mtr);
if (block == NULL) {
return(FIL_NULL);
}
ut_ad(buf_block_get_page_no(block) == IBUF_TREE_ROOT_PAGE_NO);
buf_block_dbg_add_level(block, SYNC_IBUF_TREE_NODE_NEW);
flst_init(block->frame + PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST,
mtr);
} else {
#ifdef UNIV_BLOB_DEBUG
if ((type & DICT_CLUSTERED) && !index->blobs) {
@ -1745,34 +1757,19 @@ btr_create(
#endif /* UNIV_BLOB_DEBUG */
block = fseg_create(space, 0,
PAGE_HEADER + PAGE_BTR_SEG_TOP, mtr);
}
if (block == NULL) {
if (block == NULL) {
return(FIL_NULL);
}
return(FIL_NULL);
}
page_no = buf_block_get_page_no(block);
frame = buf_block_get_frame(block);
if (type & DICT_IBUF) {
/* It is an insert buffer tree: initialize the free list */
buf_block_dbg_add_level(block, SYNC_IBUF_TREE_NODE_NEW);
ut_ad(page_no == IBUF_TREE_ROOT_PAGE_NO);
flst_init(frame + PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST, mtr);
} else {
/* It is a non-ibuf tree: create a file segment for leaf
pages */
buf_block_dbg_add_level(block, SYNC_TREE_NODE_NEW);
if (!fseg_create(space, page_no,
if (!fseg_create(space, buf_block_get_page_no(block),
PAGE_HEADER + PAGE_BTR_SEG_LEAF, mtr)) {
/* Not enough space for new segment, free root
segment before return. */
btr_free_root(space, zip_size, page_no, mtr);
btr_free_root(space, zip_size,
buf_block_get_page_no(block), mtr);
return(FIL_NULL);
}
@ -1816,7 +1813,7 @@ btr_create(
ut_ad(page_get_max_insert_size(page, 2) > 2 * BTR_PAGE_MAX_REC_SIZE);
return(page_no);
return(buf_block_get_page_no(block));
}
/************************************************************//**

View File

@ -86,6 +86,15 @@ bool
buf_page_decrypt_after_read(buf_page_t* bpage, fil_space_t* space)
MY_ATTRIBUTE((nonnull));
/********************************************************************//**
Mark a table with the specified space pointed by bpage->space corrupted.
Also remove the bpage from LRU list.
@param[in,out] bpage Block */
static
void
buf_mark_space_corrupt(
buf_page_t* bpage);
/* prototypes for new functions added to ha_innodb.cc */
trx_t* innobase_get_trx();
@ -2541,17 +2550,26 @@ buf_zip_decompress(
{
const byte* frame = block->page.zip.data;
ulint size = page_zip_get_size(&block->page.zip);
/* Space is not found if this function is called during IMPORT */
fil_space_t* space = fil_space_acquire_for_io(block->page.space);
const unsigned key_version = mach_read_from_4(frame +
FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION);
fil_space_crypt_t* crypt_data = space ? space->crypt_data : NULL;
const bool encrypted = crypt_data
&& crypt_data->type != CRYPT_SCHEME_UNENCRYPTED
&& (!crypt_data->is_default_encryption()
|| srv_encrypt_tables);
ut_ad(buf_block_get_zip_size(block));
ut_a(buf_block_get_space(block) != 0);
if (UNIV_UNLIKELY(check && !page_zip_verify_checksum(frame, size))) {
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: compressed page checksum mismatch"
" (space %u page %u): stored: %lu, crc32: %lu "
"innodb: %lu, none: %lu\n",
ib_logf(IB_LOG_LEVEL_ERROR,
"Compressed page checksum mismatch"
" for %s [%u:%u]: stored: " ULINTPF ", crc32: " ULINTPF
" innodb: " ULINTPF ", none: " ULINTPF ".",
space ? space->chain.start->name : "N/A",
block->page.space, block->page.offset,
mach_read_from_4(frame + FIL_PAGE_SPACE_OR_CHKSUM),
page_zip_calc_checksum(frame, size,
@ -2560,22 +2578,28 @@ buf_zip_decompress(
SRV_CHECKSUM_ALGORITHM_INNODB),
page_zip_calc_checksum(frame, size,
SRV_CHECKSUM_ALGORITHM_NONE));
return(FALSE);
goto err_exit;
}
switch (fil_page_get_type(frame)) {
case FIL_PAGE_INDEX:
case FIL_PAGE_INDEX: {
if (page_zip_decompress(&block->page.zip,
block->frame, TRUE)) {
if (space) {
fil_space_release_for_io(space);
}
return(TRUE);
}
fprintf(stderr,
"InnoDB: unable to decompress space %u page %u\n",
ib_logf(IB_LOG_LEVEL_ERROR,
"Unable to decompress space %s [%u:%u]",
space ? space->chain.start->name : "N/A",
block->page.space,
block->page.offset);
return(FALSE);
goto err_exit;
}
case FIL_PAGE_TYPE_ALLOCATED:
case FIL_PAGE_INODE:
case FIL_PAGE_IBUF_BITMAP:
@ -2586,14 +2610,36 @@ buf_zip_decompress(
/* Copy to uncompressed storage. */
memcpy(block->frame, frame,
buf_block_get_zip_size(block));
if (space) {
fil_space_release_for_io(space);
}
return(TRUE);
}
ut_print_timestamp(stderr);
fprintf(stderr,
" InnoDB: unknown compressed page"
" type %lu\n",
fil_page_get_type(frame));
ib_logf(IB_LOG_LEVEL_ERROR,
"Unknown compressed page in %s [%u:%u]"
" type %s [" ULINTPF "].",
space ? space->chain.start->name : "N/A",
block->page.space, block->page.offset,
fil_get_page_type_name(fil_page_get_type(frame)), fil_page_get_type(frame));
err_exit:
if (encrypted) {
ib_logf(IB_LOG_LEVEL_INFO,
"Row compressed page could be encrypted with key_version %u.",
key_version);
block->page.encrypted = true;
dict_set_encrypted_by_space(block->page.space);
} else {
dict_set_corrupted_by_space(block->page.space);
}
if (space) {
fil_space_release_for_io(space);
}
return(FALSE);
}
@ -3076,9 +3122,9 @@ loop:
}
ib_logf(IB_LOG_LEVEL_FATAL, "Unable"
" to read tablespace %lu page no"
" %lu into the buffer pool after"
" %lu attempts"
" to read tablespace " ULINTPF " page no "
ULINTPF " into the buffer pool after "
ULINTPF " attempts."
" The most probable cause"
" of this error may be that the"
" table has been corrupted."
@ -3291,12 +3337,21 @@ got_block:
/* Decompress the page while not holding
any buf_pool or block->mutex. */
/* Page checksum verification is already done when
the page is read from disk. Hence page checksum
verification is not necessary when decompressing the page. */
{
bool success = buf_zip_decompress(block, FALSE);
ut_a(success);
bool success = buf_zip_decompress(block, TRUE);
if (!success) {
buf_block_mutex_enter(fix_block);
buf_block_set_io_fix(fix_block, BUF_IO_NONE);
buf_block_mutex_exit(fix_block);
os_atomic_decrement_ulint(&buf_pool->n_pend_unzip, 1);
rw_lock_x_unlock(&fix_block->lock);
mutex_enter(&buf_pool->LRU_list_mutex);
buf_block_unfix(fix_block);
mutex_exit(&buf_pool->LRU_list_mutex);
return NULL;
}
}
if (!recv_no_ibuf_operations) {
@ -3394,16 +3449,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;
}
@ -4374,11 +4423,11 @@ buf_page_create(
memset(frame + FIL_PAGE_NEXT, 0xff, 4);
mach_write_to_2(frame + FIL_PAGE_TYPE, FIL_PAGE_TYPE_ALLOCATED);
/* Reset to zero the file flush lsn field in the page; if the first
page of an ibdata file is 'created' in this function into the buffer
pool then we lose the original contents of the file flush lsn stamp.
Then InnoDB could in a crash recovery print a big, false, corruption
warning if the stamp contains an lsn bigger than the ib_logfile lsn. */
/* FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION is only used on the
following pages:
(1) The first page of the InnoDB system tablespace (page 0:0)
(2) FIL_RTREE_SPLIT_SEQ_NUM on R-tree pages
(3) key_version on encrypted pages (not page 0:0) */
memset(frame + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION, 0, 8);

View File

@ -175,13 +175,14 @@ buf_dblwr_init(
mem_zalloc(buf_size * sizeof(void*)));
}
/****************************************************************//**
Creates the doublewrite buffer to a new InnoDB installation. The header of the
doublewrite buffer is placed on the trx system header page. */
/** Create the doublewrite buffer if the doublewrite buffer header
is not present in the TRX_SYS page.
@return whether the operation succeeded
@retval true if the doublewrite buffer exists or was created
@retval false if the creation failed (too small first data file) */
UNIV_INTERN
void
buf_dblwr_create(void)
/*==================*/
bool
buf_dblwr_create()
{
buf_block_t* block2;
buf_block_t* new_block;
@ -194,8 +195,7 @@ buf_dblwr_create(void)
if (buf_dblwr) {
/* Already inited */
return;
return(true);
}
start_again:
@ -213,39 +213,59 @@ start_again:
mtr_commit(&mtr);
buf_dblwr_being_created = FALSE;
return;
return(true);
}
ib_logf(IB_LOG_LEVEL_INFO,
"Doublewrite buffer not found: creating new");
if (buf_pool_get_curr_size()
< ((TRX_SYS_DOUBLEWRITE_BLOCKS * TRX_SYS_DOUBLEWRITE_BLOCK_SIZE
+ FSP_EXTENT_SIZE / 2 + 100)
* UNIV_PAGE_SIZE)) {
ib_logf(IB_LOG_LEVEL_FATAL,
"Cannot create doublewrite buffer: you must "
"increase your buffer pool size. Cannot continue "
"operation.");
ib_logf(IB_LOG_LEVEL_ERROR,
"Cannot create doublewrite buffer: "
"innodb_buffer_pool_size is too small.");
mtr_commit(&mtr);
return(false);
} else {
fil_space_t* space = fil_space_acquire(TRX_SYS_SPACE);
const bool fail = UT_LIST_GET_FIRST(space->chain)->size
< 3 * FSP_EXTENT_SIZE;
fil_space_release(space);
if (fail) {
goto too_small;
}
}
block2 = fseg_create(TRX_SYS_SPACE, TRX_SYS_PAGE_NO,
TRX_SYS_DOUBLEWRITE
+ TRX_SYS_DOUBLEWRITE_FSEG, &mtr);
if (block2 == NULL) {
too_small:
ib_logf(IB_LOG_LEVEL_ERROR,
"Cannot create doublewrite buffer: "
"the first file in innodb_data_file_path"
" must be at least %luM.",
3 * (FSP_EXTENT_SIZE * UNIV_PAGE_SIZE) >> 20);
mtr_commit(&mtr);
return(false);
}
ib_logf(IB_LOG_LEVEL_INFO,
"Doublewrite buffer not found: creating new");
/* FIXME: After this point, the doublewrite buffer creation
is not atomic. The doublewrite buffer should not exist in
the InnoDB system tablespace file in the first place.
It could be located in separate optional file(s) in a
user-specified location. */
/* fseg_create acquires a second latch on the page,
therefore we must declare it: */
buf_block_dbg_add_level(block2, SYNC_NO_ORDER_CHECK);
if (block2 == NULL) {
ib_logf(IB_LOG_LEVEL_FATAL,
"Cannot create doublewrite buffer: you must "
"increase your tablespace size. "
"Cannot continue operation.");
}
fseg_header = doublewrite + TRX_SYS_DOUBLEWRITE_FSEG;
prev_page_no = 0;
@ -482,6 +502,14 @@ buf_dblwr_process()
byte* unaligned_read_buf;
recv_dblwr_t& recv_dblwr = recv_sys->dblwr;
if (!buf_dblwr) {
return;
}
ib_logf(IB_LOG_LEVEL_INFO,
"Restoring possible half-written data pages "
"from the doublewrite buffer...");
unaligned_read_buf = static_cast<byte*>(ut_malloc(2 * UNIV_PAGE_SIZE));
read_buf = static_cast<byte*>(

View File

@ -887,7 +887,7 @@ fil_space_decrypt(
Calculate post encryption checksum
@param[in] zip_size zip_size or 0
@param[in] dst_frame Block where checksum is calculated
@return page checksum or BUF_NO_CHECKSUM_MAGIC
@return page checksum
not needed. */
UNIV_INTERN
ulint
@ -896,30 +896,13 @@ fil_crypt_calculate_checksum(
const byte* dst_frame)
{
ib_uint32_t checksum = 0;
srv_checksum_algorithm_t algorithm =
static_cast<srv_checksum_algorithm_t>(srv_checksum_algorithm);
/* For encrypted tables we use only crc32 and strict_crc32 */
if (zip_size == 0) {
switch (algorithm) {
case SRV_CHECKSUM_ALGORITHM_CRC32:
case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32:
checksum = buf_calc_page_crc32(dst_frame);
break;
case SRV_CHECKSUM_ALGORITHM_INNODB:
case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB:
checksum = (ib_uint32_t) buf_calc_page_new_checksum(
dst_frame);
break;
case SRV_CHECKSUM_ALGORITHM_NONE:
case SRV_CHECKSUM_ALGORITHM_STRICT_NONE:
checksum = BUF_NO_CHECKSUM_MAGIC;
break;
/* no default so the compiler will emit a warning
* if new enum is added and not handled here */
}
checksum = buf_calc_page_crc32(dst_frame);
} else {
checksum = page_zip_calc_checksum(dst_frame, zip_size,
algorithm);
SRV_CHECKSUM_ALGORITHM_CRC32);
}
return checksum;
@ -953,14 +936,6 @@ fil_space_verify_crypt_checksum(
return(false);
}
srv_checksum_algorithm_t algorithm =
static_cast<srv_checksum_algorithm_t>(srv_checksum_algorithm);
/* If no checksum is used, can't continue checking. */
if (algorithm == SRV_CHECKSUM_ALGORITHM_NONE) {
return(true);
}
/* Read stored post encryption checksum. */
ib_uint32_t checksum = mach_read_from_4(
page + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION + 4);
@ -1044,7 +1019,6 @@ fil_space_verify_crypt_checksum(
checksum1 = mach_read_from_4(
page + UNIV_PAGE_SIZE - FIL_PAGE_END_LSN_OLD_CHKSUM);
valid = (buf_page_is_checksum_valid_crc32(page,checksum1,checksum2)
|| buf_page_is_checksum_valid_none(page,checksum1,checksum2)
|| buf_page_is_checksum_valid_innodb(page,checksum1, checksum2));
}

Some files were not shown because too many files have changed in this diff Show More