summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-06-19 08:56:10 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-06-19 08:56:10 +0300
commit192aa295b4bc877d0fed24154c57304c3f789179 (patch)
tree893239effa9f3c9a7d00b324de9b4e41c63bdb4d /mysql-test
parent03f3ba2dcb07a672f9c1d87489b9ec88af62a96f (diff)
parent8acbf9c1f961aa1008ef509e059e1a09943f5ed3 (diff)
downloadmariadb-git-192aa295b4bc877d0fed24154c57304c3f789179.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/main/charset_client_win.result2
-rw-r--r--mysql-test/main/charset_client_win.test2
-rw-r--r--mysql-test/suite/maria/alter.result43
-rw-r--r--mysql-test/suite/maria/alter.test35
-rw-r--r--mysql-test/suite/maria/temporary.result23
-rw-r--r--mysql-test/suite/maria/temporary.test20
-rw-r--r--mysql-test/suite/vcol/r/vcol_misc.result42
-rw-r--r--mysql-test/suite/vcol/t/vcol_misc.test42
8 files changed, 203 insertions, 6 deletions
diff --git a/mysql-test/main/charset_client_win.result b/mysql-test/main/charset_client_win.result
new file mode 100644
index 00000000000..08a32b0b80f
--- /dev/null
+++ b/mysql-test/main/charset_client_win.result
@@ -0,0 +1,2 @@
+@@character_set_client
+cp1257
diff --git a/mysql-test/main/charset_client_win.test b/mysql-test/main/charset_client_win.test
new file mode 100644
index 00000000000..b4a21d4f0a4
--- /dev/null
+++ b/mysql-test/main/charset_client_win.test
@@ -0,0 +1,2 @@
+--source include/windows.inc
+--exec chcp 1257 > NUL && $MYSQL --default-character-set=auto -e "select @@character_set_client"
diff --git a/mysql-test/suite/maria/alter.result b/mysql-test/suite/maria/alter.result
index c63688dddd6..ea72328a38f 100644
--- a/mysql-test/suite/maria/alter.result
+++ b/mysql-test/suite/maria/alter.result
@@ -47,3 +47,46 @@ t1 CREATE TABLE `t1` (
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1 TRANSACTIONAL=1
CREATE TABLE t2 SELECT * FROM t1;
DROP TABLE t1, t2;
+#
+# MDEV-19055 Assertion `(_my_thread_var())->thr_errno != 0' failed in pagecache_read
+#
+CREATE OR REPLACE TABLE t1 (x INT) ENGINE=Aria;
+CREATE TEMPORARY TABLE t2 (a TIME) ENGINE=Aria;
+ALTER TABLE t2 ADD b DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP;
+ALTER TABLE t2 ADD CHECK (b = 4);
+INSERT IGNORE INTO t2 () VALUES (),(),(),();
+ALTER IGNORE TABLE t2 ADD c INT;
+SELECT count(a),sum(a) FROM t2;
+count(a) sum(a)
+0 NULL
+DELETE FROM t2 ORDER BY c LIMIT 1;
+INSERT IGNORE INTO t2 SELECT * FROM t2;
+OPTIMIZE TABLE t2;
+Table Op Msg_type Msg_text
+test.t2 optimize status OK
+SELECT count(a),sum(a) FROM t2;
+count(a) sum(a)
+0 NULL
+INSERT IGNORE INTO t2 SELECT * FROM t2;
+SET SQL_MODE= 'STRICT_ALL_TABLES';
+SELECT count(a),sum(a) FROM t2;
+count(a) sum(a)
+0 NULL
+ALTER TABLE t2 CHANGE IF EXISTS d c INT;
+ERROR 22007: Incorrect datetime value: '4'
+SELECT count(a),sum(a) FROM t2;
+count(a) sum(a)
+0 NULL
+ALTER IGNORE TABLE t2 ADD IF NOT EXISTS e BIT;
+ALTER TABLE t1 MODIFY IF EXISTS xx INT;
+INSERT IGNORE INTO t2 () VALUES (),(),(),();
+SELECT count(a),sum(a) FROM t2;
+count(a) sum(a)
+0 NULL
+check table t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+check table t2;
+Table Op Msg_type Msg_text
+test.t2 check status OK
+DROP TABLE t1,t2;
diff --git a/mysql-test/suite/maria/alter.test b/mysql-test/suite/maria/alter.test
index 09672cdfa3b..ef21ab2e5d2 100644
--- a/mysql-test/suite/maria/alter.test
+++ b/mysql-test/suite/maria/alter.test
@@ -42,3 +42,38 @@ ALTER TABLE t1 ORDER BY unknown_column;
SHOW CREATE TABLE t1;
CREATE TABLE t2 SELECT * FROM t1;
DROP TABLE t1, t2;
+
+--echo #
+--echo # MDEV-19055 Assertion `(_my_thread_var())->thr_errno != 0' failed in pagecache_read
+--echo #
+
+--disable_warnings
+CREATE OR REPLACE TABLE t1 (x INT) ENGINE=Aria;
+CREATE TEMPORARY TABLE t2 (a TIME) ENGINE=Aria;
+ALTER TABLE t2 ADD b DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP;
+ALTER TABLE t2 ADD CHECK (b = 4);
+INSERT IGNORE INTO t2 () VALUES (),(),(),();
+ALTER IGNORE TABLE t2 ADD c INT;
+SELECT count(a),sum(a) FROM t2;
+DELETE FROM t2 ORDER BY c LIMIT 1;
+INSERT IGNORE INTO t2 SELECT * FROM t2;
+OPTIMIZE TABLE t2;
+SELECT count(a),sum(a) FROM t2;
+INSERT IGNORE INTO t2 SELECT * FROM t2;
+SET SQL_MODE= 'STRICT_ALL_TABLES';
+SELECT count(a),sum(a) FROM t2;
+--error ER_TRUNCATED_WRONG_VALUE
+ALTER TABLE t2 CHANGE IF EXISTS d c INT;
+SELECT count(a),sum(a) FROM t2;
+ALTER IGNORE TABLE t2 ADD IF NOT EXISTS e BIT;
+ALTER TABLE t1 MODIFY IF EXISTS xx INT;
+INSERT IGNORE INTO t2 () VALUES (),(),(),();
+SELECT count(a),sum(a) FROM t2;
+--enable_warnings
+check table t1;
+check table t2;
+DROP TABLE t1,t2;
+
+#
+# End of 10.2 tests
+#
diff --git a/mysql-test/suite/maria/temporary.result b/mysql-test/suite/maria/temporary.result
new file mode 100644
index 00000000000..2592e04be2b
--- /dev/null
+++ b/mysql-test/suite/maria/temporary.result
@@ -0,0 +1,23 @@
+CREATE TABLE t1 (b INT);
+INSERT INTO t1 VALUES (5);
+CREATE TEMPORARY TABLE t1 (a INT) ENGINE=Aria ROW_FORMAT=DYNAMIC;
+INSERT INTO t1 VALUES (1);
+DELETE FROM t1 LIMIT 2;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+SELECT * FROM t1;
+a
+INSERT INTO t1 VALUES (1),(2);
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+ALTER TABLE t1 CHANGE COLUMN IF EXISTS x x INT;
+Warnings:
+Note 1054 Unknown column 'x' in 't1'
+ALTER TABLE t1;
+DROP TEMPORARY TABLE t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/maria/temporary.test b/mysql-test/suite/maria/temporary.test
new file mode 100644
index 00000000000..76f8e2526a4
--- /dev/null
+++ b/mysql-test/suite/maria/temporary.test
@@ -0,0 +1,20 @@
+#
+# MDEV-19595
+# ER_CRASHED_ON_USAGE and Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())'
+# failed upon actions on temporary Aria table with ROW_FORMAT DYNAMIC
+#
+
+CREATE TABLE t1 (b INT);
+INSERT INTO t1 VALUES (5);
+CREATE TEMPORARY TABLE t1 (a INT) ENGINE=Aria ROW_FORMAT=DYNAMIC;
+INSERT INTO t1 VALUES (1);
+DELETE FROM t1 LIMIT 2;
+OPTIMIZE TABLE t1;
+CHECK TABLE t1;
+SELECT * FROM t1;
+INSERT INTO t1 VALUES (1),(2);
+CHECK TABLE t1;
+ALTER TABLE t1 CHANGE COLUMN IF EXISTS x x INT;
+ALTER TABLE t1;
+DROP TEMPORARY TABLE t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result
index ef2e948a004..1dd2c3ea5af 100644
--- a/mysql-test/suite/vcol/r/vcol_misc.result
+++ b/mysql-test/suite/vcol/r/vcol_misc.result
@@ -203,10 +203,10 @@ drop table t1;
create table t1 (a int, b int);
insert into t1 values (3, 30), (4, 20), (1, 20);
create table t2 (c int, d int, v int as (d+1), index idx(c));
-insert into t2(c,d) values
+insert into t2(c,d) values
(20, 100), (20, 300), (30, 100), (30, 200), (40, 500),
(70, 100), (40, 300), (60, 100), (40, 100), (70, 100);
-insert into t2(c,d) values
+insert into t2(c,d) values
(120, 100), (150, 300), (130, 100), (130, 200), (140, 500),
(170, 100), (180, 300), (160, 100), (40, 100), (170, 100);
set join_cache_level=6;
@@ -423,5 +423,43 @@ ERROR HY000: Incorrect information in file: './test/t1.frm'
ALTER TABLE t1;
ERROR HY000: Incorrect information in file: './test/t1.frm'
#
+# MDEV-19771 REPLACE on table with virtual_field can cause crash in set_ok_status()
+
+create or replace table t1 (pk int primary key, col_bit bit(15) default null,
+vcol_bit bit(10) GENERATED ALWAYS AS (`col_bit`) VIRTUAL);
+replace INTO `t1` (`pk`,col_bit) VALUES (99,1000);
+select pk, col_bit+0, vcol_bit+0 from t1;
+pk col_bit+0 vcol_bit+0
+99 1000 1000
+replace INTO `t1` (`pk`,col_bit) VALUES (99,10000);
+select pk, col_bit+0, vcol_bit+0 from t1;
+pk col_bit+0 vcol_bit+0
+99 10000 1023
+REPLACE LOW_PRIORITY INTO `t1` (`pk`) VALUES (99);
+Warnings:
+Warning 1264 Out of range value for column 'vcol_bit' at row 1
+drop table t1;
+#
+# MDEV-17837 REPLACE on table with virtual_field can cause crash in set_ok_status()
+#
+SET @old_sql_mode=@@sql_mode;
+SET sql_mode= STRICT_ALL_TABLES;
+CREATE TABLE t1 (
+pk INT,
+i TINYINT,
+vi TINYINT AS (i+1) PERSISTENT,
+PRIMARY KEY(pk)
+);
+INSERT INTO t1 (pk,i) VALUES (1,1);
+TRUNCATE TABLE t1;
+INSERT IGNORE INTO t1 (pk,i) VALUES (1,127);
+Warnings:
+Warning 1264 Out of range value for column 'vi' at row 1
+REPLACE INTO t1 (pk,i) VALUES (1,2);
+Warnings:
+Warning 1264 Out of range value for column 'vi' at row 1
+DROP TABLE t1;
+SET @sql_mode=@old_sql_mode;
+#
# End of 10.2 tests
#
diff --git a/mysql-test/suite/vcol/t/vcol_misc.test b/mysql-test/suite/vcol/t/vcol_misc.test
index 255621845fb..1de2827efe6 100644
--- a/mysql-test/suite/vcol/t/vcol_misc.test
+++ b/mysql-test/suite/vcol/t/vcol_misc.test
@@ -215,12 +215,12 @@ drop table t1;
create table t1 (a int, b int);
insert into t1 values (3, 30), (4, 20), (1, 20);
create table t2 (c int, d int, v int as (d+1), index idx(c));
-insert into t2(c,d) values
+insert into t2(c,d) values
(20, 100), (20, 300), (30, 100), (30, 200), (40, 500),
- (70, 100), (40, 300), (60, 100), (40, 100), (70, 100);
-insert into t2(c,d) values
+ (70, 100), (40, 300), (60, 100), (40, 100), (70, 100);
+insert into t2(c,d) values
(120, 100), (150, 300), (130, 100), (130, 200), (140, 500),
- (170, 100), (180, 300), (160, 100), (40, 100), (170, 100);
+ (170, 100), (180, 300), (160, 100), (40, 100), (170, 100);
set join_cache_level=6;
explain
@@ -392,5 +392,39 @@ ALTER TABLE t1;
--remove_file $MYSQLD_DATADIR/test/t1.frm
--echo #
+--echo # MDEV-19771 REPLACE on table with virtual_field can cause crash in set_ok_status()
+--echo
+
+create or replace table t1 (pk int primary key, col_bit bit(15) default null,
+ vcol_bit bit(10) GENERATED ALWAYS AS (`col_bit`) VIRTUAL);
+replace INTO `t1` (`pk`,col_bit) VALUES (99,1000);
+select pk, col_bit+0, vcol_bit+0 from t1;
+replace INTO `t1` (`pk`,col_bit) VALUES (99,10000);
+select pk, col_bit+0, vcol_bit+0 from t1;
+REPLACE LOW_PRIORITY INTO `t1` (`pk`) VALUES (99);
+drop table t1;
+
+--echo #
+--echo # MDEV-17837 REPLACE on table with virtual_field can cause crash in set_ok_status()
+--echo #
+
+SET @old_sql_mode=@@sql_mode;
+SET sql_mode= STRICT_ALL_TABLES;
+
+CREATE TABLE t1 (
+ pk INT,
+ i TINYINT,
+ vi TINYINT AS (i+1) PERSISTENT,
+ PRIMARY KEY(pk)
+);
+
+INSERT INTO t1 (pk,i) VALUES (1,1);
+TRUNCATE TABLE t1;
+INSERT IGNORE INTO t1 (pk,i) VALUES (1,127);
+REPLACE INTO t1 (pk,i) VALUES (1,2);
+DROP TABLE t1;
+SET @sql_mode=@old_sql_mode;
+
+--echo #
--echo # End of 10.2 tests
--echo #