Skip to content
Permalink
Browse files
Merge 10.2 into 10.3
  • Loading branch information
dr-m committed May 29, 2018
2 parents c98e6d4 + 6f96ff7 commit a3539bb
Show file tree
Hide file tree
Showing 76 changed files with 1,593 additions and 343 deletions.
@@ -949,6 +949,8 @@ pthread_handler_t connection_thread(void *arg)

end_thread:
cn->query_done= 1;
mysql_close(cn->mysql);
cn->mysql= 0;
mysql_thread_end();
pthread_exit(0);
return 0;
@@ -2175,6 +2175,66 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8
DROP TABLE t1;
#
# MDEV-15308
# Assertion `ha_alter_info->alter_info->drop_list.elements > 0' failed
# in ha_innodb::prepare_inplace_alter_table
#
CREATE TABLE t1 (a INT, b INT) ENGINE=InnoDB;
ALTER TABLE t1 DROP FOREIGN KEY IF EXISTS fk, DROP COLUMN b;
Warnings:
Note 1091 Can't DROP FOREIGN KEY `fk`; check that it exists
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a INT, b INT) ENGINE=InnoDB;
ALTER TABLE t1 DROP INDEX IF EXISTS fk, DROP COLUMN b;
Warnings:
Note 1091 Can't DROP INDEX `fk`; check that it exists
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a INT, b INT, c INT, KEY(c)) ENGINE=InnoDB;
ALTER TABLE t1 DROP FOREIGN KEY IF EXISTS fk, DROP COLUMN c;
Warnings:
Note 1091 Can't DROP FOREIGN KEY `fk`; check that it exists
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a INT, b INT, c INT, KEY c1(c)) ENGINE=InnoDB;
ALTER TABLE t1 DROP FOREIGN KEY IF EXISTS fk, DROP INDEX c1;
Warnings:
Note 1091 Can't DROP FOREIGN KEY `fk`; check that it exists
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
CREATE TABLE t1 (a INT, b INT) ENGINE=InnoDB;
ALTER TABLE t1 DROP INDEX IF EXISTS fk, DROP COLUMN IF EXISTS c;
Warnings:
Note 1091 Can't DROP INDEX `fk`; check that it exists
Note 1091 Can't DROP COLUMN `c`; check that it exists
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;
#
# End of 10.0 tests
#
#
@@ -1803,6 +1803,37 @@ ALTER TABLE t1 CONVERT TO CHARACTER SET utf8;
SHOW CREATE TABLE t1;
DROP TABLE t1;

--echo #
--echo # MDEV-15308
--echo # Assertion `ha_alter_info->alter_info->drop_list.elements > 0' failed
--echo # in ha_innodb::prepare_inplace_alter_table
--echo #

CREATE TABLE t1 (a INT, b INT) ENGINE=InnoDB;
ALTER TABLE t1 DROP FOREIGN KEY IF EXISTS fk, DROP COLUMN b;
SHOW CREATE TABLE t1;
DROP TABLE t1;

CREATE TABLE t1 (a INT, b INT) ENGINE=InnoDB;
ALTER TABLE t1 DROP INDEX IF EXISTS fk, DROP COLUMN b;
SHOW CREATE TABLE t1;
DROP TABLE t1;

CREATE TABLE t1 (a INT, b INT, c INT, KEY(c)) ENGINE=InnoDB;
ALTER TABLE t1 DROP FOREIGN KEY IF EXISTS fk, DROP COLUMN c;
SHOW CREATE TABLE t1;
DROP TABLE t1;

CREATE TABLE t1 (a INT, b INT, c INT, KEY c1(c)) ENGINE=InnoDB;
ALTER TABLE t1 DROP FOREIGN KEY IF EXISTS fk, DROP INDEX c1;
SHOW CREATE TABLE t1;
DROP TABLE t1;

CREATE TABLE t1 (a INT, b INT) ENGINE=InnoDB;
ALTER TABLE t1 DROP INDEX IF EXISTS fk, DROP COLUMN IF EXISTS c;
SHOW CREATE TABLE t1;
DROP TABLE t1;

--echo #
--echo # End of 10.0 tests
--echo #
@@ -809,10 +809,9 @@ LOAD INDEX INTO CACHE t3;
Table Op Msg_type Msg_text
mysqltest_db1.t3 preload_keys status OK
#
# RENAME (doesn't work for temporary tables, thus should fail).
# RENAME should work for temporary tables
#
RENAME TABLE t3 TO t3_1;
ERROR 42000: INSERT, CREATE command denied to user 'mysqltest_u1'@'localhost' for table 't3_1'
#
# HANDLER OPEN/READ/CLOSE.
#
@@ -873,9 +873,8 @@ CACHE INDEX t3 IN keycache1;
LOAD INDEX INTO CACHE t3;

--echo #
--echo # RENAME (doesn't work for temporary tables, thus should fail).
--echo # RENAME should work for temporary tables
--echo #
--error ER_TABLEACCESS_DENIED_ERROR
RENAME TABLE t3 TO t3_1;

--echo #
@@ -78,3 +78,69 @@ ERROR HY000: 'test.v1' is not of type 'BASE TABLE'
drop view v1;
drop table t1;
End of 5.0 tests
CREATE OR REPLACE TABLE t1 (a INT);
CREATE OR REPLACE TABLE t2 (a INT);
CREATE OR REPLACE TEMPORARY TABLE t1_tmp (b INT);
CREATE OR REPLACE TEMPORARY TABLE t2_tmp (b INT);
rename table t1 to t2;
ERROR 42S01: Table 't2' already exists
rename table t1 to tmp, tmp to t2;
ERROR 42S01: Table 't2' already exists
rename table t1_tmp to t2_tmp;
ERROR 42S01: Table 't2_tmp' already exists
rename table t1_tmp to tmp, tmp to t2_tmp;
ERROR 42S01: Table 't2_tmp' already exists
show create table t1_tmp;
Table Create Table
t1_tmp CREATE TEMPORARY TABLE `t1_tmp` (
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
show create table t2_tmp;
Table Create Table
t2_tmp CREATE TEMPORARY TABLE `t2_tmp` (
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
rename table t1 to t1_tmp;
rename table t2_tmp to t2;
rename table t2 to tmp, tmp to t2;
rename table t1_tmp to tmp, tmp to t1_tmp;
show tables;
Tables_in_test
t1_tmp
t2
SHOW CREATE TABLE t1_tmp;
Table Create Table
t1_tmp CREATE TEMPORARY TABLE `t1_tmp` (
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1_tmp;
SHOW CREATE TABLE t1_tmp;
Table Create Table
t1_tmp CREATE TABLE `t1_tmp` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1_tmp;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TEMPORARY TABLE `t2` (
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t2;
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t2;
CREATE TABLE t1 (a INT);
insert into t1 values (1);
CREATE TEMPORARY TABLE t1 (b INT);
insert into t1 values (2);
RENAME TABLE t1 TO tmp, t1 TO t2;
select * from tmp;
b
2
select * from t2;
a
1
drop table tmp,t2;
@@ -95,3 +95,49 @@ drop table t1;

--source include/wait_until_count_sessions.inc

#
# Test of rename with temporary tables
#

CREATE OR REPLACE TABLE t1 (a INT);
CREATE OR REPLACE TABLE t2 (a INT);
CREATE OR REPLACE TEMPORARY TABLE t1_tmp (b INT);
CREATE OR REPLACE TEMPORARY TABLE t2_tmp (b INT);

# Can't rename table over another one
--error ER_TABLE_EXISTS_ERROR
rename table t1 to t2;
--error ER_TABLE_EXISTS_ERROR
rename table t1 to tmp, tmp to t2;
--error ER_TABLE_EXISTS_ERROR
rename table t1_tmp to t2_tmp;
--error ER_TABLE_EXISTS_ERROR
rename table t1_tmp to tmp, tmp to t2_tmp;

show create table t1_tmp;
show create table t2_tmp;

# The following should work
rename table t1 to t1_tmp;
rename table t2_tmp to t2;
rename table t2 to tmp, tmp to t2;
rename table t1_tmp to tmp, tmp to t1_tmp;
show tables;
SHOW CREATE TABLE t1_tmp;
drop table t1_tmp;
SHOW CREATE TABLE t1_tmp;
drop table t1_tmp;
SHOW CREATE TABLE t2;
drop table t2;
SHOW CREATE TABLE t2;
drop table t2;

CREATE TABLE t1 (a INT);
insert into t1 values (1);
CREATE TEMPORARY TABLE t1 (b INT);
insert into t1 values (2);
RENAME TABLE t1 TO tmp, t1 TO t2;
select * from tmp;
select * from t2;
drop table tmp,t2;

@@ -0,0 +1,11 @@
CREATE TABLE t1 (i int);
connect con1,localhost,root,,test;
RENAME TABLE t1 TO t2;
connection default;
FLUSH TABLES;
connection con1;
disconnect con1;
connection default;
DROP TABLE IF EXISTS t1, t2;
Warnings:
Note 1051 Unknown table 'test.t1'
@@ -0,0 +1,18 @@
#
# MDEV-16123 ASAN heap-use-after-free handler::ha_index_or_rnd_end
# MDEV-13828 Segmentation fault on RENAME TABLE
#

CREATE TABLE t1 (i int);
--connect (con1,localhost,root,,test)
--send
RENAME TABLE t1 TO t2;
--connection default
FLUSH TABLES;
--connection con1
--reap

# Cleanup
--disconnect con1
--connection default
DROP TABLE IF EXISTS t1, t2;
@@ -2345,7 +2345,18 @@ CREATE TABLE t1 (i INT);
insert into t2 value (2);
DROP VIEW v1;
DROP TABLE t1,t2,t3;
End of 10.1 tests.
#
# MDEV-16093
# Assertion `global_status_var.global_memory_used == 0' failed or
# bytes lost after inserting into table with non-null blob and trigger
#
CREATE TABLE t1 (b BLOB NOT NULL);
CREATE TRIGGER tr BEFORE UPDATE ON t1 FOR EACH ROW BEGIN END;
INSERT INTO t1 VALUES ('foo');
DROP TABLE t1;
#
# End of 10.1 tests.
#
create table t1 (i int);
create trigger tr1 after insert on t1 for each row set @a=@a+1;
create trigger tr2 after insert on t1 for each row set @a=@a+1;
@@ -2665,8 +2665,20 @@ insert into t2 value (2);
DROP VIEW v1;
DROP TABLE t1,t2,t3;

--echo #
--echo # MDEV-16093
--echo # Assertion `global_status_var.global_memory_used == 0' failed or
--echo # bytes lost after inserting into table with non-null blob and trigger
--echo #

CREATE TABLE t1 (b BLOB NOT NULL);
CREATE TRIGGER tr BEFORE UPDATE ON t1 FOR EACH ROW BEGIN END;
INSERT INTO t1 VALUES ('foo');
DROP TABLE t1;

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

#
# MDEV-10915 Count number of executed triggers
@@ -18,6 +18,7 @@
# - with annotated events, default checksums and minimal binlog row image
#

--source include/have_partition.inc
--source encryption_algorithms.inc
--source include/have_innodb.inc
--enable_connect_log
@@ -9,6 +9,7 @@
# relay logs and binary logs are encrypted on slave.
#

--source include/have_partition.inc
--source encryption_algorithms.inc
--source include/have_innodb.inc

This file was deleted.

@@ -0,0 +1,37 @@
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
VARIABLE_VALUE = 'Synced'
1
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) Engine=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_2;
SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment';
VARIABLE_VALUE = 'Synced'
1
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
1
SELECT COUNT(*) = 1 FROM t1;
COUNT(*) = 1
1
DROP TABLE t1;
connection node_1;
CREATE TABLE `t1` (
`col1` int(11) NOT NULL,
`col2` varchar(64) NOT NULL DEFAULT '',
`col3` varchar(32) NOT NULL DEFAULT '0',
`col4` varchar(64) NOT NULL DEFAULT '',
`col5` tinyint(4) NOT NULL DEFAULT '0',
`col6` int(11) NOT NULL DEFAULT '0',
`col7` varchar(64) NOT NULL DEFAULT '',
`col8` tinyint(4) NOT NULL DEFAULT '0',
`col9` tinyint(4) NOT NULL DEFAULT '0',
`col10` text NOT NULL,
`col11` varchar(255) NOT NULL DEFAULT '',
`col12` tinyint(4) NOT NULL DEFAULT '1'
) ;
create table t2 (test int);
insert into t2 values (1);
drop table t1,t2;
@@ -0,0 +1,8 @@
!include ../galera_2nodes.cnf
[mysqld]

encrypt-tmp-files = 1
plugin-load-add= @ENV.FILE_KEY_MANAGEMENT_SO
file-key-management
loose-file-key-management-filename= @ENV.MYSQL_TEST_DIR/std_data/keys.txt
log-bin

0 comments on commit a3539bb

Please sign in to comment.