summaryrefslogtreecommitdiff
path: root/mysql-test/suite
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-10-18 14:11:55 +0400
committerAlexander Barkov <bar@mariadb.org>2017-10-18 14:11:55 +0400
commit30e7d6709f7fb0f70a07c80a1a06614ca23da5f4 (patch)
tree9ba11fd32d82ac5c1364a537532ac896c4dd2058 /mysql-test/suite
parent75aabd03d57f85d63d57b25a239b4f930a3ae3c0 (diff)
parent3bc094d32a360b7d51600cf11bc4ce24117ecb78 (diff)
downloadmariadb-git-30e7d6709f7fb0f70a07c80a1a06614ca23da5f4.tar.gz
Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext
Diffstat (limited to 'mysql-test/suite')
-rw-r--r--mysql-test/suite/innodb/disabled.def9
-rw-r--r--mysql-test/suite/innodb/r/innodb-alter.result30
-rw-r--r--mysql-test/suite/innodb/r/innodb-online-alter-gis.result10
-rw-r--r--mysql-test/suite/innodb/r/innodb_defrag_concurrent.result17
-rw-r--r--mysql-test/suite/innodb/r/log_file_size.result8
-rw-r--r--mysql-test/suite/innodb/t/innodb-alter.test28
-rw-r--r--mysql-test/suite/innodb/t/innodb-online-alter-gis.test10
-rw-r--r--mysql-test/suite/innodb/t/innodb_defrag_concurrent.test28
-rw-r--r--mysql-test/suite/innodb/t/log_file_size.test25
-rw-r--r--mysql-test/suite/innodb_gis/r/alter_spatial_index.result16
-rw-r--r--mysql-test/suite/innodb_gis/t/alter_spatial_index.test20
-rw-r--r--mysql-test/suite/mariabackup/xb_file_key_management.result1
-rw-r--r--mysql-test/suite/mariabackup/xb_file_key_management.test1
13 files changed, 183 insertions, 20 deletions
diff --git a/mysql-test/suite/innodb/disabled.def b/mysql-test/suite/innodb/disabled.def
index 9a92e99df2e..c435de278b9 100644
--- a/mysql-test/suite/innodb/disabled.def
+++ b/mysql-test/suite/innodb/disabled.def
@@ -10,14 +10,5 @@
#
##############################################################################
-innodb_defragment_fill_factor : MDEV-11336 Fix and enable innodb_defragment
-innodb.defrag_mdl-9155 : MDEV-11336 Fix and enable innodb_defragment
-innodb.innodb_defrag_concurrent : MDEV-11336 Fix and enable innodb_defragment
-innodb.innodb_defrag_stats : MDEV-11336 Fix and enable innodb_defragment
-innodb.innodb_defrag_stats_many_tables : MDEV-11336 Fix and enable innodb_defragment
-innodb.innodb_defragment : MDEV-11336 Fix and enable innodb_defragment
-innodb.innodb_defragment_fill_factor : MDEV-11336 Fix and enable innodb_defragment
-innodb.innodb_defragment_small : MDEV-11336 Fix and enable innodb_defragment
-innodb.innodb_defrag_binlog : MDEV-11336 Fix and enable innodb_defragment
innodb-wl5980-alter : MDEV-9469 / MDEV-13668 extra crash in 10.2
create-index-debug : MDEV-13680 InnoDB may crash when btr_page_alloc() fails
diff --git a/mysql-test/suite/innodb/r/innodb-alter.result b/mysql-test/suite/innodb/r/innodb-alter.result
index aa78f55c78f..b06c6060375 100644
--- a/mysql-test/suite/innodb/r/innodb-alter.result
+++ b/mysql-test/suite/innodb/r/innodb-alter.result
@@ -857,3 +857,33 @@ DROP TABLE dest_db.t1;
DROP TABLE source_db.t1;
DROP DATABASE source_db;
DROP DATABASE dest_db;
+USE test;
+#
+# MDEV-14038 ALTER TABLE does not exit on error with InnoDB + bad default function
+#
+CREATE TABLE t1 (a INT NOT NULL DEFAULT 0) ENGINE=InnoDB;
+iNSERT INTO t1 VALUES (10);
+ALTER TABLE t1 ADD b TINYINT NOT NULL DEFAULT if(unix_timestamp()>1,1000,0);
+ERROR 22003: Out of range value for column 'b' at row 1
+SELECT * FROM t1;
+a
+10
+DROP TABLE t1;
+CREATE TABLE t1 (a INT NOT NULL DEFAULT 0) ENGINE=InnoDB;
+iNSERT INTO t1 VALUES (10);
+ALTER TABLE t1 ADD b DATE NOT NULL DEFAULT if(unix_timestamp()>1,TIMESTAMP'2001-01-01 10:20:30',0);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT * FROM t1;
+a b
+10 2001-01-01
+DROP TABLE t1;
+CREATE TABLE t1 (a INT NOT NULL DEFAULT 0) ENGINE=InnoDB;
+iNSERT INTO t1 VALUES (10);
+ALTER TABLE t1 ADD b TIME NOT NULL DEFAULT if(unix_timestamp()>1,TIMESTAMP'2001-01-01 10:20:30',0);
+affected rows: 0
+info: Records: 0 Duplicates: 0 Warnings: 0
+SELECT * FROM t1;
+a b
+10 10:20:30
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb-online-alter-gis.result b/mysql-test/suite/innodb/r/innodb-online-alter-gis.result
index c7daac48e48..79c0f2386aa 100644
--- a/mysql-test/suite/innodb/r/innodb-online-alter-gis.result
+++ b/mysql-test/suite/innodb/r/innodb-online-alter-gis.result
@@ -37,3 +37,13 @@ Level Code Message
show errors;
Level Code Message
drop table t1;
+#
+# MDEV-14038 ALTER TABLE does not exit on error with InnoDB + bad default function
+#
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+ALTER TABLE t1 ADD COLUMN b LINESTRING DEFAULT POINT(1,1);
+ERROR 22007: Incorrect LINESTRING value: 'POINT' for column 'b' at row 1
+DESCRIBE t1;
+Field Type Null Key Default Extra
+a int(11) YES NULL
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb_defrag_concurrent.result b/mysql-test/suite/innodb/r/innodb_defrag_concurrent.result
index ff32bf694cb..d10727b95b4 100644
--- a/mysql-test/suite/innodb/r/innodb_defrag_concurrent.result
+++ b/mysql-test/suite/innodb/r/innodb_defrag_concurrent.result
@@ -3,7 +3,15 @@ select @@global.innodb_stats_persistent;
@@global.innodb_stats_persistent
0
set global innodb_defragment_stats_accuracy = 80;
-CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), c INT, KEY second(a, b),KEY third(c)) ENGINE=INNODB;
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+b VARCHAR(256),
+c INT,
+g GEOMETRY NOT NULL,
+t VARCHAR(256),
+KEY second(a, b),
+KEY third(c),
+SPATIAL gk(g),
+FULLTEXT INDEX fti(t)) ENGINE=INNODB;
connect con1,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect con2,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
connect con3,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
@@ -40,9 +48,9 @@ count(stat_value) > 0
connection con1;
optimize table t1;;
connection default;
-INSERT INTO t1 VALUES (400000, REPEAT('A', 256),300000);;
+INSERT INTO t1 VALUES (400000, REPEAT('A', 256),300000, Point(1,1),'More like a test but different.');;
connection con2;
-INSERT INTO t1 VALUES (500000, REPEAT('A', 256),400000);;
+INSERT INTO t1 VALUES (500000, REPEAT('A', 256),400000, Point(1,1),'Totally different text book.');;
connection con3;
DELETE FROM t1 where a between 1 and 100;;
connection con4;
@@ -59,6 +67,9 @@ disconnect con4;
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
+check table t1 extended;
+Table Op Msg_type Msg_text
+test.t1 check status OK
select count(*) from t1;
count(*)
15723
diff --git a/mysql-test/suite/innodb/r/log_file_size.result b/mysql-test/suite/innodb/r/log_file_size.result
index b576061e74b..e049b34ad81 100644
--- a/mysql-test/suite/innodb/r/log_file_size.result
+++ b/mysql-test/suite/innodb/r/log_file_size.result
@@ -1,4 +1,12 @@
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
+SELECT * FROM INFORMATION_SCHEMA.ENGINES
+WHERE engine = 'innodb'
+AND support IN ('YES', 'DEFAULT', 'ENABLED');
+ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
+FOUND 1 /InnoDB: Log file .*ib_logfile0 size 0 is too small/ in mysqld.1.err
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
BEGIN;
INSERT INTO t1 VALUES (42);
SELECT * FROM t1;
diff --git a/mysql-test/suite/innodb/t/innodb-alter.test b/mysql-test/suite/innodb/t/innodb-alter.test
index 5e681f96b4a..d936dcad15c 100644
--- a/mysql-test/suite/innodb/t/innodb-alter.test
+++ b/mysql-test/suite/innodb/t/innodb-alter.test
@@ -494,6 +494,34 @@ eval ALTER TABLE $source_db.t1 DROP INDEX index2, algorithm=inplace;
eval DROP TABLE $source_db.t1;
eval DROP DATABASE $source_db;
eval DROP DATABASE $dest_db;
+USE test;
+--echo #
+--echo # MDEV-14038 ALTER TABLE does not exit on error with InnoDB + bad default function
+--echo #
+CREATE TABLE t1 (a INT NOT NULL DEFAULT 0) ENGINE=InnoDB;
+iNSERT INTO t1 VALUES (10);
+--error ER_WARN_DATA_OUT_OF_RANGE
+ALTER TABLE t1 ADD b TINYINT NOT NULL DEFAULT if(unix_timestamp()>1,1000,0);
+SELECT * FROM t1;
+DROP TABLE t1;
+
+# DATETIME-to-DATE truncation is OK
+CREATE TABLE t1 (a INT NOT NULL DEFAULT 0) ENGINE=InnoDB;
+iNSERT INTO t1 VALUES (10);
+--enable_info
+ALTER TABLE t1 ADD b DATE NOT NULL DEFAULT if(unix_timestamp()>1,TIMESTAMP'2001-01-01 10:20:30',0);
+--disable_info
+SELECT * FROM t1;
+DROP TABLE t1;
+
+# DATETIME-to-TIME truncation is OK
+CREATE TABLE t1 (a INT NOT NULL DEFAULT 0) ENGINE=InnoDB;
+iNSERT INTO t1 VALUES (10);
+--enable_info
+ALTER TABLE t1 ADD b TIME NOT NULL DEFAULT if(unix_timestamp()>1,TIMESTAMP'2001-01-01 10:20:30',0);
+--disable_info
+SELECT * FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb-online-alter-gis.test b/mysql-test/suite/innodb/t/innodb-online-alter-gis.test
index 64d07ba23aa..2cb88d398bb 100644
--- a/mysql-test/suite/innodb/t/innodb-online-alter-gis.test
+++ b/mysql-test/suite/innodb/t/innodb-online-alter-gis.test
@@ -19,3 +19,13 @@ ALTER ONLINE TABLE t1 ADD PRIMARY KEY(a),DROP INDEX d, LOCK=SHARED;
show warnings;
show errors;
drop table t1;
+
+--echo #
+--echo # MDEV-14038 ALTER TABLE does not exit on error with InnoDB + bad default function
+--echo #
+
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+ALTER TABLE t1 ADD COLUMN b LINESTRING DEFAULT POINT(1,1);
+DESCRIBE t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb_defrag_concurrent.test b/mysql-test/suite/innodb/t/innodb_defrag_concurrent.test
index f596fab2a15..bbcd72f1a3a 100644
--- a/mysql-test/suite/innodb/t/innodb_defrag_concurrent.test
+++ b/mysql-test/suite/innodb/t/innodb_defrag_concurrent.test
@@ -16,7 +16,26 @@ select @@global.innodb_stats_persistent;
set global innodb_defragment_stats_accuracy = 80;
# Create table.
-CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), c INT, KEY second(a, b),KEY third(c)) ENGINE=INNODB;
+#
+# TODO: Currently we do not defragment spatial indexes,
+# because doing it properly would require
+# appropriate logic around the SSN (split
+# sequence number).
+#
+# Also do not defragment auxiliary tables related to FULLTEXT INDEX.
+#
+# Both types added to this test to make sure they do not cause
+# problems.
+#
+CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
+b VARCHAR(256),
+c INT,
+g GEOMETRY NOT NULL,
+t VARCHAR(256),
+KEY second(a, b),
+KEY third(c),
+SPATIAL gk(g),
+FULLTEXT INDEX fti(t)) ENGINE=INNODB;
connect (con1,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connect (con2,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
@@ -36,7 +55,7 @@ let $i = $data_size;
while ($i)
{
eval
- INSERT INTO t1 VALUES ($data_size + 1 - $i, REPEAT('A', 256), $i);
+ INSERT INTO t1 VALUES ($data_size + 1 - $i, REPEAT('A', 256), $i, Point($i,$i), 'This is a test message.');
dec $i;
}
--enable_query_log
@@ -69,10 +88,10 @@ connection con1;
--send optimize table t1;
connection default;
---send INSERT INTO t1 VALUES (400000, REPEAT('A', 256),300000);
+--send INSERT INTO t1 VALUES (400000, REPEAT('A', 256),300000, Point(1,1),'More like a test but different.');
connection con2;
---send INSERT INTO t1 VALUES (500000, REPEAT('A', 256),400000);
+--send INSERT INTO t1 VALUES (500000, REPEAT('A', 256),400000, Point(1,1),'Totally different text book.');
connection con3;
--send DELETE FROM t1 where a between 1 and 100;
@@ -103,6 +122,7 @@ disconnect con3;
disconnect con4;
optimize table t1;
+check table t1 extended;
select count(*) from t1;
select count(*) from t1 force index (second);
diff --git a/mysql-test/suite/innodb/t/log_file_size.test b/mysql-test/suite/innodb/t/log_file_size.test
index 206444115fc..140198de4ab 100644
--- a/mysql-test/suite/innodb/t/log_file_size.test
+++ b/mysql-test/suite/innodb/t/log_file_size.test
@@ -23,14 +23,33 @@ call mtr.add_suppression("InnoDB: Log file .*ib_logfile[01].* size");
call mtr.add_suppression("InnoDB: Unable to open .*ib_logfile0. to check native AIO read support");
FLUSH TABLES;
--enable_query_log
+let MYSQLD_DATADIR= `select @@datadir`;
+CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
+
+--source include/shutdown_mysqld.inc
+--move_file $MYSQLD_DATADIR/ib_logfile0 $MYSQLD_DATADIR/ib_logfile.old
+write_file $MYSQLD_DATADIR/ib_logfile0;
+EOF
+let $check_no_innodb=SELECT * FROM INFORMATION_SCHEMA.ENGINES
+WHERE engine = 'innodb'
+AND support IN ('YES', 'DEFAULT', 'ENABLED');
--let $restart_parameters= --innodb-thread-concurrency=1 --innodb-log-file-size=1m --innodb-log-files-in-group=2
---source include/restart_mysqld.inc
+--source include/start_mysqld.inc
+
+eval $check_no_innodb;
+--remove_file $MYSQLD_DATADIR/ib_logfile0
+--move_file $MYSQLD_DATADIR/ib_logfile.old $MYSQLD_DATADIR/ib_logfile.0
+--source include/shutdown_mysqld.inc
+let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
+let SEARCH_PATTERN= InnoDB: Log file .*ib_logfile0 size 0 is too small;
+--source include/search_pattern_in_file.inc
+--source include/start_mysqld.inc
+CHECK TABLE t1;
--let $restart_parameters= --innodb-thread-concurrency=100 --innodb-log-file-size=10M --innodb-log-files-in-group=2
--source include/restart_mysqld.inc
-CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
BEGIN;
INSERT INTO t1 VALUES (42);
@@ -52,9 +71,7 @@ SELECT * FROM t1;
INSERT INTO t1 VALUES (0),(123);
-let MYSQLD_DATADIR= `select @@datadir`;
let SEARCH_ABORT = NOT FOUND;
-let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
BEGIN;
DELETE FROM t1 WHERE a>0;
diff --git a/mysql-test/suite/innodb_gis/r/alter_spatial_index.result b/mysql-test/suite/innodb_gis/r/alter_spatial_index.result
index 17f1f7e1b06..a945e68aeb1 100644
--- a/mysql-test/suite/innodb_gis/r/alter_spatial_index.result
+++ b/mysql-test/suite/innodb_gis/r/alter_spatial_index.result
@@ -743,3 +743,19 @@ ALTER TABLE t1 ADD SPATIAL INDEX(p);
ALTER TABLE t1 FORCE, LOCK=NONE;
ERROR 0A000: LOCK=NONE is not supported. Reason: Do not support online operation on table with GIS index. Try LOCK=SHARED
DROP TABLE t1;
+create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),LineString(Point(0,0),Point(1,1)))) ENGINE=innodb;
+set timestamp=10;
+insert into t1 values(default);
+ERROR 22007: Incorrect POINT value: 'GEOMETRYCOLLECTION' for column 'p' at row 1
+drop table t1;
+SET timestamp=default;
+create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),LineString(Point(0,0),Point(1,1)))) ENGINE=innodb;
+set timestamp=10;
+alter table t1 add column i int;
+ERROR 22007: Incorrect POINT value: 'GEOMETRYCOLLECTION' for column 'p' at row 1
+drop table t1;
+SET timestamp=default;
+CREATE OR REPLACE TABLE t1 (a INT) ENGINE=InnoDB;
+ALTER TABLE t1 ADD COLUMN b POINT DEFAULT '0';
+ERROR 22003: Cannot get geometry object from data you send to the GEOMETRY field
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb_gis/t/alter_spatial_index.test b/mysql-test/suite/innodb_gis/t/alter_spatial_index.test
index 2b834ac69a6..703a89b4065 100644
--- a/mysql-test/suite/innodb_gis/t/alter_spatial_index.test
+++ b/mysql-test/suite/innodb_gis/t/alter_spatial_index.test
@@ -743,3 +743,23 @@ ALTER TABLE t1 ADD SPATIAL INDEX(p);
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER TABLE t1 FORCE, LOCK=NONE;
DROP TABLE t1;
+
+create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),LineString(Point(0,0),Point(1,1)))) ENGINE=innodb;
+set timestamp=10;
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+insert into t1 values(default);
+drop table t1;
+SET timestamp=default;
+
+create table t1 (p point not null default if(unix_timestamp()>10,POINT(1,1),LineString(Point(0,0),Point(1,1)))) ENGINE=innodb;
+set timestamp=10;
+--error ER_TRUNCATED_WRONG_VALUE_FOR_FIELD
+alter table t1 add column i int;
+drop table t1;
+SET timestamp=default;
+
+CREATE OR REPLACE TABLE t1 (a INT) ENGINE=InnoDB;
+--error ER_CANT_CREATE_GEOMETRY_OBJECT
+ALTER TABLE t1 ADD COLUMN b POINT DEFAULT '0';
+DROP TABLE t1;
+
diff --git a/mysql-test/suite/mariabackup/xb_file_key_management.result b/mysql-test/suite/mariabackup/xb_file_key_management.result
index 8972da32f8b..721d10a9d91 100644
--- a/mysql-test/suite/mariabackup/xb_file_key_management.result
+++ b/mysql-test/suite/mariabackup/xb_file_key_management.result
@@ -9,6 +9,7 @@ INSERT INTO t VALUES('foobar2');
# remove datadir
# xtrabackup move back
# restart server
+ib_logfile0
SELECT * FROM t;
c
foobar1
diff --git a/mysql-test/suite/mariabackup/xb_file_key_management.test b/mysql-test/suite/mariabackup/xb_file_key_management.test
index 3887a889aaa..2a176952053 100644
--- a/mysql-test/suite/mariabackup/xb_file_key_management.test
+++ b/mysql-test/suite/mariabackup/xb_file_key_management.test
@@ -24,6 +24,7 @@ exec $XTRABACKUP --prepare --target-dir=$targetdir;
--enable_result_log
--list_files $targetdir ib_logfile*
+--cat_file $targetdir/ib_logfile0
SELECT * FROM t;
DROP TABLE t;