summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/r
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-03-06 09:00:52 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-03-06 09:00:52 +0200
commit2a791c53ad93c8bc1441dd227000234bd49c4990 (patch)
tree4c52ad715c99bd3c6681771d7cb77d451a34e216 /mysql-test/suite/innodb/r
parentb5c72a843abee033e9ea6028e1a109f03afc4455 (diff)
parent723ffdb32ee785cbc511abc457eb70d41c2fcce3 (diff)
downloadmariadb-git-2a791c53ad93c8bc1441dd227000234bd49c4990.tar.gz
Merge 10.3 into 10.4
Diffstat (limited to 'mysql-test/suite/innodb/r')
-rw-r--r--mysql-test/suite/innodb/r/alter_table.result31
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-nullable.result154
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter-timestamp.result5
-rw-r--r--mysql-test/suite/innodb/r/innodb-table-online.result7
-rw-r--r--mysql-test/suite/innodb/r/instant_alter_debug.result2
5 files changed, 187 insertions, 12 deletions
diff --git a/mysql-test/suite/innodb/r/alter_table.result b/mysql-test/suite/innodb/r/alter_table.result
index 3a765a61dd2..0cfd3096f3f 100644
--- a/mysql-test/suite/innodb/r/alter_table.result
+++ b/mysql-test/suite/innodb/r/alter_table.result
@@ -22,6 +22,37 @@ alter table t1 change column id2 id4 varchar(100) not null;
select * from t1 where id4 like 'a';
id1 id4 id3
drop table t1;
+#
+# MDEV-17725 Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed in Diagnostics_area::set_ok_status upon ALTER failing due to error from engine
+#
+SET sql_mode=STRICT_ALL_TABLES;
+CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB;
+ALTER TABLE t1 ORDER BY a;
+Warnings:
+Warning 1105 ORDER BY ignored as there is a user-defined clustered index in the table 't1'
+DROP TABLE t1;
+SET sql_mode='';
+CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB;
+ALTER TABLE t1 ORDER BY a;
+Warnings:
+Warning 1105 ORDER BY ignored as there is a user-defined clustered index in the table 't1'
+DROP TABLE t1;
+SET sql_mode=DEFAULT;
+#
+# MDEV-18775 Server crashes in dict_table_t::instant_column
+# upon ADD COLUMN
+#
+CREATE TABLE tx (pk INT PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t1 (pk INT, a INT, PRIMARY KEY (pk), KEY (a), FOREIGN KEY (a) REFERENCES tx (pk)) ENGINE=InnoDB;
+SET FOREIGN_KEY_CHECKS=OFF;
+ALTER TABLE t1 DROP a;
+ERROR HY000: Cannot drop column 'a': needed in a foreign key constraint 'test/t1_ibfk_1'
+SET FOREIGN_KEY_CHECKS=ON;
+ALTER TABLE t1 ADD b INT;
+ALTER TABLE t1 DROP a;
+ERROR HY000: Cannot drop index 'a': needed in a foreign key constraint
+ALTER TABLE t1 ADD c INT;
+DROP TABLE t1, tx;
create table t1 (a int) transactional=1 engine=aria;
create table t2 (a int) transactional=1 engine=innodb;
show create table t1;
diff --git a/mysql-test/suite/innodb/r/innodb-alter-nullable.result b/mysql-test/suite/innodb/r/innodb-alter-nullable.result
index 632f7885b8e..68ad6762335 100644
--- a/mysql-test/suite/innodb/r/innodb-alter-nullable.result
+++ b/mysql-test/suite/innodb/r/innodb-alter-nullable.result
@@ -3,12 +3,9 @@ INSERT INTO t VALUES (1,2,3),(4,5,6),(7,8,9);
ALTER TABLE t CHANGE c1 c1 INT NULL FIRST, ALGORITHM=INPLACE;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
-set @old_sql_mode = @@sql_mode;
-set @@sql_mode = 'STRICT_TRANS_TABLES';
ALTER TABLE t MODIFY c3 INT NOT NULL, ALGORITHM=INPLACE;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
-set @@sql_mode = @old_sql_mode;
ALTER TABLE t CHANGE c2 c2 INT, CHANGE c2 c2 INT NOT NULL;
ERROR 42S22: Unknown column 'c2' in 't'
ALTER TABLE t MODIFY c2 INT, MODIFY c2 INT NOT NULL;
@@ -24,8 +21,6 @@ ALTER TABLE t MODIFY c2 INT NOT NULL;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
connect con1,localhost,root,,;
-connection con1;
-SET SQL_MODE='STRICT_ALL_TABLES';
UPDATE t SET c2=NULL;
ERROR 23000: Column 'c2' cannot be null
SELECT * FROM t;
@@ -61,3 +56,152 @@ CREATE TABLE t1(c1 INT) ENGINE=InnoDB;
ALTER TABLE t1 ADD CONSTRAINT UNIQUE KEY i1(c1);
ALTER TABLE t1 CHANGE c1 c1 INT NOT NULL,ADD KEY(c1);
DROP TABLE t1;
+#
+# MDEV-18732 InnoDB: ALTER IGNORE returns error for NULL
+#
+CREATE TABLE t1(c INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL);
+ALTER IGNORE TABLE t1 MODIFY c INT NOT NULL;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Warning 1265 Data truncated for column 'c' at row 1
+INSERT INTO t1 VALUES (NULL);
+ERROR 23000: Column 'c' cannot be null
+SELECT * FROM t1;
+c
+0
+DROP TABLE t1;
+CREATE TABLE t1(c INT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (NULL),(1),(1);
+ALTER IGNORE TABLE t1 ADD UNIQUE(c);
+affected rows: 3
+info: Records: 3 Duplicates: 1 Warnings: 0
+ALTER IGNORE TABLE t1 ADD PRIMARY KEY(c);
+affected rows: 2
+info: Records: 2 Duplicates: 0 Warnings: 1
+Warnings:
+Warning 1265 Data truncated for column 'c' at row 1
+SELECT * FROM t1;
+c
+0
+1
+DROP TABLE t1;
+CREATE TABLE t1(c INT, g INT AS (c) PERSISTENT) ENGINE=InnoDB;
+CREATE TABLE t2(c INT, v INT AS (c) VIRTUAL) ENGINE=InnoDB;
+CREATE TABLE t3(c INT, v INT AS (c) VIRTUAL, INDEX(v)) ENGINE=InnoDB;
+INSERT INTO t1 SET c=NULL;
+INSERT INTO t2 SET c=NULL;
+INSERT INTO t3 SET c=NULL;
+SET @old_sql_mode = @@sql_mode;
+SET sql_mode = '';
+ALTER TABLE t1 MODIFY c INT NOT NULL;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Warning 1265 Data truncated for column 'c' at row 1
+ALTER TABLE t2 MODIFY c INT NOT NULL;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Warning 1265 Data truncated for column 'c' at row 1
+ALTER TABLE t3 MODIFY c INT NOT NULL;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 1
+Warnings:
+Warning 1265 Data truncated for column 'c' at row 1
+SET sql_mode = @old_sql_mode;
+# MDEV-18819 FIXME: Wrong result g=NULL
+SELECT * FROM t1;
+c g
+0 NULL
+SELECT * FROM t2;
+c v
+0 0
+SELECT * FROM t3;
+c v
+0 0
+SELECT v FROM t3 FORCE INDEX(v);
+v
+0
+CHECK TABLE t1,t2,t3;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+test.t2 check status OK
+test.t3 check status OK
+DROP TABLE t1,t2,t3;
+CREATE TABLE t1(c INT, g INT AS (c) PERSISTENT) ENGINE=InnoDB;
+CREATE TABLE t2(c INT, v INT AS (c) VIRTUAL) ENGINE=InnoDB;
+CREATE TABLE t3(c INT, v INT AS (c) VIRTUAL, INDEX(v)) ENGINE=InnoDB;
+INSERT INTO t1 SET c=NULL;
+INSERT INTO t2 SET c=NULL;
+INSERT INTO t3 SET c=NULL;
+ALTER IGNORE TABLE t1 MODIFY c INT NOT NULL;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Warning 1265 Data truncated for column 'c' at row 1
+ALTER IGNORE TABLE t2 MODIFY c INT NOT NULL;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 1
+Warnings:
+Warning 1265 Data truncated for column 'c' at row 1
+ALTER IGNORE TABLE t3 MODIFY c INT NOT NULL;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 1
+Warnings:
+Warning 1265 Data truncated for column 'c' at row 1
+# MDEV-18819 FIXME: Wrong result g=NULL
+SELECT * FROM t1;
+c g
+0 NULL
+SELECT * FROM t2;
+c v
+0 0
+SELECT * FROM t3;
+c v
+0 0
+SELECT v FROM t3 FORCE INDEX(v);
+v
+0
+CHECK TABLE t1,t2,t3;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+test.t2 check status OK
+test.t3 check status OK
+DROP TABLE t1,t2,t3;
+CREATE TABLE t1(c INT, g INT AS (c) PERSISTENT) ENGINE=InnoDB;
+CREATE TABLE t2(c INT, v INT AS (c) VIRTUAL) ENGINE=InnoDB;
+CREATE TABLE t3(c INT, v INT AS (c) VIRTUAL, INDEX(v)) ENGINE=InnoDB;
+INSERT INTO t1 SET c=NULL;
+INSERT INTO t2 SET c=NULL;
+INSERT INTO t3 SET c=NULL;
+ALTER TABLE t1 MODIFY c INT NOT NULL;
+ERROR 01000: Data truncated for column 'c' at row 1
+ALTER TABLE t2 MODIFY c INT NOT NULL;
+ERROR 01000: Data truncated for column 'c' at row 1
+ALTER TABLE t3 MODIFY c INT NOT NULL;
+ERROR 01000: Data truncated for column 'c' at row 1
+UPDATE t1 SET c=0;
+UPDATE t2 SET c=0;
+UPDATE t3 SET c=0;
+ALTER TABLE t1 MODIFY c INT NOT NULL;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+ALTER TABLE t2 MODIFY c INT NOT NULL;
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+# MDEV-18819 FIXME: This should not require ALGORITHM=COPY.
+ALTER TABLE t3 MODIFY c INT NOT NULL;
+affected rows: 1
+info: Records: 1 Duplicates: 0 Warnings: 0
+SELECT * FROM t1;
+c g
+0 0
+SELECT * FROM t2;
+c v
+0 0
+SELECT * FROM t3;
+c v
+0 0
+DROP TABLE t1,t2,t3;
diff --git a/mysql-test/suite/innodb/r/innodb-alter-timestamp.result b/mysql-test/suite/innodb/r/innodb-alter-timestamp.result
index d4c0aa6a50e..516ac333a87 100644
--- a/mysql-test/suite/innodb/r/innodb-alter-timestamp.result
+++ b/mysql-test/suite/innodb/r/innodb-alter-timestamp.result
@@ -10,10 +10,15 @@ ALTER TABLE t1 CHANGE i1 id INT UNSIGNED NOT NULL AUTO_INCREMENT,
ADD PRIMARY KEY(id), ALGORITHM=INPLACE;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
ALTER IGNORE TABLE t1 ADD PRIMARY KEY(i1), ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Creating unique indexes with IGNORE requires COPY algorithm to remove duplicate rows. Try ALGORITHM=COPY
+SET @old_sql_mode = @@sql_mode;
+SET sql_mode = '';
+ALTER TABLE t1 ADD PRIMARY KEY(i1), ALGORITHM=INPLACE;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 1
Warnings:
Warning 1265 Data truncated for column 'i1' at row 1
+SET sql_mode = @old_sql_mode;
ALTER TABLE t1 CHANGE i1 id INT UNSIGNED NOT NULL AUTO_INCREMENT;
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 0
diff --git a/mysql-test/suite/innodb/r/innodb-table-online.result b/mysql-test/suite/innodb/r/innodb-table-online.result
index 363ca07e1bc..7872332a4a8 100644
--- a/mysql-test/suite/innodb/r/innodb-table-online.result
+++ b/mysql-test/suite/innodb/r/innodb-table-online.result
@@ -397,15 +397,11 @@ UPDATE t1 SET c3 = NULL WHERE c3 = '';
SET lock_wait_timeout = 1;
ALTER TABLE t1 DROP COLUMN c22f, ADD PRIMARY KEY c3p5(c3(5));
ERROR 42000: Key column 'c22f' doesn't exist in table
-SET @old_sql_mode = @@sql_mode;
-SET @@sql_mode = 'STRICT_TRANS_TABLES';
ALTER IGNORE TABLE t1 DROP COLUMN c22f, DROP PRIMARY KEY, ADD PRIMARY KEY c3p5(c3(5)),
ALGORITHM = INPLACE;
-ERROR 23000: Duplicate entry '' for key 'PRIMARY'
-SET @@sql_mode = @old_sql_mode;
+ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: Creating unique indexes with IGNORE requires COPY algorithm to remove duplicate rows. Try ALGORITHM=COPY
UPDATE t1 SET c3=LEFT(CONCAT(c1,REPEAT('foo',c1)),255) WHERE c3 IS NULL;
SET DEBUG_SYNC = 'row_log_table_apply1_before SIGNAL c3p5_created0 WAIT_FOR ins_done0';
-SET @@sql_mode = 'STRICT_TRANS_TABLES';
ALTER TABLE t1 MODIFY c3 CHAR(255) NOT NULL, DROP COLUMN c22f,
DROP PRIMARY KEY, ADD PRIMARY KEY(c1,c4(5)),
ADD COLUMN c5 CHAR(5) DEFAULT 'tired' FIRST;
@@ -419,7 +415,6 @@ SET DEBUG_SYNC = 'now SIGNAL ins_done0';
# session con1
connection con1;
ERROR 01000: Data truncated for column 'c3' at row 323
-SET @@sql_mode = @old_sql_mode;
# session default
connection default;
ROLLBACK;
diff --git a/mysql-test/suite/innodb/r/instant_alter_debug.result b/mysql-test/suite/innodb/r/instant_alter_debug.result
index 4989c801738..866aeb48f67 100644
--- a/mysql-test/suite/innodb/r/instant_alter_debug.result
+++ b/mysql-test/suite/innodb/r/instant_alter_debug.result
@@ -246,7 +246,7 @@ ALTER TABLE t1 ADD COLUMN d INT, ALGORITHM=INSTANT;
UPDATE t1 SET d=1;
connection ddl;
SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL copied WAIT_FOR logged';
-ALTER IGNORE TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY (a,d);
+ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY (a,d);
connection default;
SET DEBUG_SYNC = 'now WAIT_FOR copied';
BEGIN;