Skip to content
Permalink
Browse files
Merge 10.3 into 10.4
  • Loading branch information
dr-m committed Mar 26, 2019
2 parents 7225bef + 2d592f7 commit 0bc4260
Show file tree
Hide file tree
Showing 23 changed files with 222 additions and 81 deletions.
@@ -1210,6 +1210,7 @@ copy_or_move_file(const char *src_file_path,

if (!directory_exists(dst_dir, true)) {
ret = false;
free(link_filepath);
goto cleanup;
}

@@ -381,6 +381,7 @@ log_online_setup_bitmap_file_range(

msg("InnoDB: Error: inconsistent bitmap file "
"directory");
os_file_closedir(bitmap_dir);
free(bitmap_files->files);
return FALSE;
}
@@ -385,6 +385,7 @@ create_worker_threads(uint n)
return threads;

err:
my_free(threads);
return NULL;
}

@@ -5246,6 +5246,7 @@ xb_process_datadir(
fileinfo.name, NULL))
{
os_file_closedir(dbdir);
os_file_closedir(dir);
return(FALSE);
}
}
@@ -1980,8 +1980,8 @@ FROM t2);
MIN(t2.pk)
NULL
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'j'
Warning 1292 Truncated incorrect INTEGER value: 'j'
Warning 1292 Truncated incorrect DOUBLE value: 'j'
Warning 1292 Truncated incorrect DOUBLE value: 'j'

EXPLAIN
SELECT MIN(t2.pk)
@@ -1994,8 +1994,8 @@ id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'j'
Warning 1292 Truncated incorrect INTEGER value: 'j'
Warning 1292 Truncated incorrect DOUBLE value: 'j'
Warning 1292 Truncated incorrect DOUBLE value: 'j'

#
# 2) Test that subquery materialization is setup for query with
@@ -14,14 +14,6 @@ FROM mysql.slow_log
WHERE sql_text NOT LIKE '%debug_dbug%';
END
$$
CREATE PROCEDURE show_slow_log_exclude_ps()
BEGIN
SELECT CONCAT('[slow] ', sql_text) AS sql_text
FROM mysql.slow_log
WHERE sql_text NOT LIKE '%debug_dbug%'
AND sql_text NOT IN ('Prepare','Close stmt');
END
$$
#
# Expect all admin statements in the slow log (ON,DEFAULT)
#
@@ -231,4 +223,3 @@ SET @@global.slow_query_log= @org_slow_query_log;
SET @@global.log_output= @org_log_output;
SET @@global.log_slow_admin_statements= @org_log_slow_admin_statements;
DROP PROCEDURE show_slow_log;
DROP PROCEDURE show_slow_log_exclude_ps;
@@ -19,14 +19,6 @@ BEGIN
WHERE sql_text NOT LIKE '%debug_dbug%';
END
$$
CREATE PROCEDURE show_slow_log_exclude_ps()
BEGIN
SELECT CONCAT('[slow] ', sql_text) AS sql_text
FROM mysql.slow_log
WHERE sql_text NOT LIKE '%debug_dbug%'
AND sql_text NOT IN ('Prepare','Close stmt');
END
$$
DELIMITER ;$$


@@ -100,4 +92,3 @@ SET @@global.slow_query_log= @org_slow_query_log;
SET @@global.log_output= @org_log_output;
SET @@global.log_slow_admin_statements= @org_log_slow_admin_statements;
DROP PROCEDURE show_slow_log;
DROP PROCEDURE show_slow_log_exclude_ps;
@@ -5,9 +5,9 @@ SET SQL_MODE= 'STRICT_ALL_TABLES';
CREATE TABLE t1 (a INT);
PREPARE stmt FROM "CREATE TABLE tmp AS SELECT * FROM t1 WHERE 'foo' && 0";
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'foo'
Warning 1292 Truncated incorrect DOUBLE value: 'foo'
EXECUTE stmt;
ERROR 22007: Truncated incorrect INTEGER value: 'foo'
ERROR 22007: Truncated incorrect DOUBLE value: 'foo'
SELECT a FROM t1 GROUP BY NULL WITH ROLLUP;
a
DROP TABLE t1;
@@ -16,9 +16,9 @@ SET SQL_MODE= 'STRICT_ALL_TABLES';
CREATE TABLE t1 (a INT);
PREPARE stmt FROM "CREATE TABLE tmp AS SELECT * FROM t1 WHERE 'foo' && 0";
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'foo'
Warning 1292 Truncated incorrect DOUBLE value: 'foo'
EXECUTE stmt;
ERROR 22007: Truncated incorrect INTEGER value: 'foo'
ERROR 22007: Truncated incorrect DOUBLE value: 'foo'
SET @a = REPLACE( @@global.optimizer_switch, '=on', '=off' ) ;
DROP TABLE t1;
SET sql_mode=DEFAULT;
@@ -28,19 +28,19 @@ SET sql_mode=DEFAULT;
SET SQL_MODE='STRICT_ALL_TABLES';
PREPARE stmt FROM "CREATE TABLE ps AS SELECT 1 FROM DUAL WHERE 'foo' && 0";
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'foo'
Warning 1292 Truncated incorrect DOUBLE value: 'foo'
EXECUTE stmt;
ERROR 22007: Truncated incorrect INTEGER value: 'foo'
ERROR 22007: Truncated incorrect DOUBLE value: 'foo'
SELECT 'All done';
All done
All done
SET SQL_MODE=DEFAULT;
SET SQL_MODE='STRICT_ALL_TABLES';
PREPARE stmt FROM "CREATE TABLE ps AS SELECT 1 FROM DUAL WHERE 'foo' && 0";
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'foo'
Warning 1292 Truncated incorrect DOUBLE value: 'foo'
EXECUTE stmt;
ERROR 22007: Truncated incorrect INTEGER value: 'foo'
ERROR 22007: Truncated incorrect DOUBLE value: 'foo'
DEALLOCATE PREPARE stmt;
SELECT 'All done';
All done
@@ -50,9 +50,9 @@ SET SQL_MODE= 'STRICT_ALL_TABLES';
CREATE TABLE t1 (a INT);
PREPARE stmt FROM "CREATE TABLE tmp AS SELECT * FROM t1 WHERE 'foo' && 0";
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'foo'
Warning 1292 Truncated incorrect DOUBLE value: 'foo'
EXECUTE stmt;
ERROR 22007: Truncated incorrect INTEGER value: 'foo'
ERROR 22007: Truncated incorrect DOUBLE value: 'foo'
SELECT a FROM t1 GROUP BY a;
a
SELECT * FROM t1;
@@ -63,9 +63,9 @@ SET SQL_MODE= 'STRICT_ALL_TABLES';
CREATE TABLE t1 (a INT);
PREPARE stmt FROM "CREATE TABLE tmp AS SELECT * FROM t1 WHERE 'foo' && 0";
Warnings:
Warning 1292 Truncated incorrect INTEGER value: 'foo'
Warning 1292 Truncated incorrect DOUBLE value: 'foo'
EXECUTE stmt;
ERROR 22007: Truncated incorrect INTEGER value: 'foo'
ERROR 22007: Truncated incorrect DOUBLE value: 'foo'
SELECT a FROM t1 GROUP BY a;
a
INSERT t1 SELECT * FROM ( SELECT * FROM t1 ) sq;
@@ -1020,6 +1020,26 @@ cast('-0.0' as decimal(5,1)) < 0
# End of 5.5 tests
#
#
# Start of 10.1 tests
#
#
# MDEV-18968 Both (WHERE 0.1) and (WHERE NOT 0.1) return empty set
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (10);
SELECT CASE WHEN 0.1 THEN 'TRUE' ELSE 'FALSE' END FROM t1;
CASE WHEN 0.1 THEN 'TRUE' ELSE 'FALSE' END
TRUE
SELECT * FROM t1 WHERE 0.1;
a
10
SELECT * FROM t1 WHERE NOT 0.1;
a
DROP TABLE t1;
#
# End of 10.1 tests
#
#
# Start of 10.2 tests
#
#
@@ -613,6 +613,27 @@ select cast('-0.0' as decimal(5,1)) < 0;
--echo # End of 5.5 tests
--echo #


--echo #
--echo # Start of 10.1 tests
--echo #

--echo #
--echo # MDEV-18968 Both (WHERE 0.1) and (WHERE NOT 0.1) return empty set
--echo #

CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (10);
SELECT CASE WHEN 0.1 THEN 'TRUE' ELSE 'FALSE' END FROM t1;
SELECT * FROM t1 WHERE 0.1;
SELECT * FROM t1 WHERE NOT 0.1;
DROP TABLE t1;


--echo #
--echo # End of 10.1 tests
--echo #

--echo #
--echo # Start of 10.2 tests
--echo #
@@ -1 +1,2 @@
--innodb --innodb-data-home-dir= --innodb-data-file-path=$MYSQLTEST_VARDIR/tmp/absolute_path_ibdata1:3M;ibdata_second:1M:autoextend --innodb-undo-tablespaces=2
--innodb --innodb-data-home-dir= --innodb-data-file-path=$MYSQLTEST_VARDIR/tmp/absolute_path_ibdata1:6M;ibdata_second:1M:autoextend
--innodb-undo-tablespaces=2
@@ -2,12 +2,32 @@
# Innodb system tablespace is specified with absolute path in the .opt file
CREATE TABLE t(i INT) ENGINE INNODB;
INSERT INTO t VALUES(1);

let INNODB_PAGE_SIZE=`select @@innodb_page_size`;
let MYSQLD_DATADIR= `SELECT @@datadir`;
--source include/shutdown_mysqld.inc
perl;
my $file= "$ENV{MYSQLD_DATADIR}/ibdata_second";
open(FILE, "+<", $file) or die "Unable to open $file\n";
binmode FILE;
my $ps= $ENV{INNODB_PAGE_SIZE};
my $page;
my $pos = $ps * 0;
sysseek(FILE, $pos, 0) || die "Unable to seek $file\n";
die "Unable to read $file" unless sysread(FILE, $page, $ps) == $ps;
substr($page,26,8) = pack("NN", 1, 1);
sysseek(FILE, $pos, 0) || die "Unable to rewind $file\n";
syswrite(FILE, $page, $ps)==$ps || die "Unable to write $file\n";
close(FILE) || die "Unable to close $file\n";
EOF

--source include/start_mysqld.inc

echo # xtrabackup backup;

let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
let $_innodb_data_file_path=`select @@innodb_data_file_path`;
let $_innodb_data_home_dir=`select @@innodb_data_home_dir`;
let $_datadir= `SELECT @@datadir`;

--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir;
@@ -16,11 +36,11 @@ exec $XTRABACKUP --prepare --target-dir=$targetdir;

--source include/shutdown_mysqld.inc
echo # remove datadir;
rmdir $_datadir;
rmdir $MYSQLD_DATADIR;
#remove out-of-datadir ibdata1
remove_file $MYSQLTEST_VARDIR/tmp/absolute_path_ibdata1;
echo # xtrabackup copy back;
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$_datadir --target-dir=$targetdir "--innodb_data_file_path=$_innodb_data_file_path" --innodb_data_home_dir=$_innodb_data_home_dir;
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --copy-back --datadir=$MYSQLD_DATADIR --target-dir=$targetdir "--innodb_data_file_path=$_innodb_data_file_path" --innodb_data_home_dir=$_innodb_data_home_dir;
echo # restart server;
--source include/start_mysqld.inc
--enable_result_log
@@ -544,5 +544,66 @@ alter table t add check (a > 0);
insert into t values (0);
ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`t`
insert into t values (2);
#
# MDEV-18869 Assertion `!((field)->vcol_info && (field)->stored_in_db())' failed in innodb_col_no upon altering table with system versioning
#
set system_versioning_alter_history= keep;
create or replace table t1 (a int, b int generated always as (0) stored) engine=innodb with system versioning;
insert into t1 (a) values (1);
alter table t1 modify a int without system versioning, algorithm=copy;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
alter table t1 modify a int with system versioning, algorithm=copy;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
alter table t1 modify a int without system versioning;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
alter table t1 modify a int with system versioning;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) GENERATED ALWAYS AS (0) STORED
) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
select * from t1;
a b
1 0
alter table t1 modify b int generated always as (0) stored without system versioning;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'without system versioning' at line 1
alter table t1 modify b int generated always as (0) stored with system versioning;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'system versioning' at line 1
alter table t1 modify b int without system versioning;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL WITHOUT SYSTEM VERSIONING
) ENGINE=InnoDB DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
select * from t1;
a b
1 0
create or replace table t1 (a int, b int generated always as (0) virtual) engine=innodb with system versioning;
insert into t1 (a) values (1);
alter table t1 modify a int without system versioning, algorithm=copy;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
alter table t1 modify a int with system versioning, algorithm=copy;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
alter table t1 modify a int without system versioning;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
alter table t1 modify a int with system versioning;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
select * from t1;
a b
1 0
affected rows: 1
drop database test;
create database test;
@@ -469,5 +469,39 @@ alter table t add check (a > 0);
insert into t values (0);
insert into t values (2);

--echo #
--echo # MDEV-18869 Assertion `!((field)->vcol_info && (field)->stored_in_db())' failed in innodb_col_no upon altering table with system versioning
--echo #
set system_versioning_alter_history= keep;
create or replace table t1 (a int, b int generated always as (0) stored) engine=innodb with system versioning;
insert into t1 (a) values (1);
--enable_info
alter table t1 modify a int without system versioning, algorithm=copy;
alter table t1 modify a int with system versioning, algorithm=copy;
alter table t1 modify a int without system versioning;
alter table t1 modify a int with system versioning;
--disable_info
show create table t1;
select * from t1;
--enable_info
--error ER_PARSE_ERROR
alter table t1 modify b int generated always as (0) stored without system versioning;
--error ER_PARSE_ERROR
alter table t1 modify b int generated always as (0) stored with system versioning;
alter table t1 modify b int without system versioning;
--disable_info
show create table t1;
select * from t1;

create or replace table t1 (a int, b int generated always as (0) virtual) engine=innodb with system versioning;
insert into t1 (a) values (1);
--enable_info
alter table t1 modify a int without system versioning, algorithm=copy;
alter table t1 modify a int with system versioning, algorithm=copy;
alter table t1 modify a int without system versioning;
alter table t1 modify a int with system versioning;
select * from t1;
--disable_info

drop database test;
create database test;
@@ -1449,6 +1449,13 @@ class Item: public Value_source,
}
virtual String *val_raw(String*) { return 0; }

bool eval_const_cond()
{
DBUG_ASSERT(const_item());
DBUG_ASSERT(!is_expensive());
return val_bool();
}

/*
save_val() is method of val_* family which stores value in the given
field.

0 comments on commit 0bc4260

Please sign in to comment.