mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic
This problem was fixed earlier by MDEV-27653. Adding MTR tests only.
This commit is contained in:
parent
54715a1074
commit
ed2adc8c6f
5 changed files with 213 additions and 0 deletions
31
mysql-test/include/sql_mode_pad_char_to_full_length.inc
Normal file
31
mysql-test/include/sql_mode_pad_char_to_full_length.inc
Normal file
|
@ -0,0 +1,31 @@
|
|||
--echo #
|
||||
--echo # MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a INT,b CHAR(20));
|
||||
SHOW CREATE TABLE t1;
|
||||
CREATE UNIQUE INDEX bi USING HASH ON t1 (b);
|
||||
INSERT INTO t1 VALUES (0,0);
|
||||
SET sql_mode='pad_char_to_full_length';
|
||||
DELETE FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
SET sql_mode='';
|
||||
CREATE TABLE t1 (a INT,b CHAR(20));
|
||||
SHOW CREATE TABLE t1;
|
||||
CREATE UNIQUE INDEX bi USING HASH ON t1 (b);
|
||||
SET sql_mode='pad_char_to_full_length';
|
||||
INSERT INTO t1 VALUES (0,0);
|
||||
DELETE FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
|
||||
SET sql_mode='';
|
||||
CREATE OR REPLACE TABLE t1 (a CHAR(20),b CHAR(20));
|
||||
SHOW CREATE TABLE t1;
|
||||
CREATE UNIQUE INDEX bi USING HASH ON t1 (b);
|
||||
INSERT INTO t1 VALUES (0,0);
|
||||
SET sql_mode='pad_char_to_full_length';
|
||||
DELETE FROM t1;
|
||||
DROP TABLE t1;
|
94
mysql-test/main/sql_mode_pad_char_to_full_length.result
Normal file
94
mysql-test/main/sql_mode_pad_char_to_full_length.result
Normal file
|
@ -0,0 +1,94 @@
|
|||
#
|
||||
# Start of 10.4 tests
|
||||
#
|
||||
#
|
||||
# MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic
|
||||
#
|
||||
SET default_storage_engine=MyISAM;
|
||||
#
|
||||
# MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic
|
||||
#
|
||||
CREATE TABLE t1 (a INT,b CHAR(20));
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` char(20) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE UNIQUE INDEX bi USING HASH ON t1 (b);
|
||||
INSERT INTO t1 VALUES (0,0);
|
||||
SET sql_mode='pad_char_to_full_length';
|
||||
DELETE FROM t1;
|
||||
DROP TABLE t1;
|
||||
SET sql_mode='';
|
||||
CREATE TABLE t1 (a INT,b CHAR(20));
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` char(20) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE UNIQUE INDEX bi USING HASH ON t1 (b);
|
||||
SET sql_mode='pad_char_to_full_length';
|
||||
INSERT INTO t1 VALUES (0,0);
|
||||
DELETE FROM t1;
|
||||
DROP TABLE t1;
|
||||
SET sql_mode='';
|
||||
CREATE OR REPLACE TABLE t1 (a CHAR(20),b CHAR(20));
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` char(20) DEFAULT NULL,
|
||||
`b` char(20) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE UNIQUE INDEX bi USING HASH ON t1 (b);
|
||||
INSERT INTO t1 VALUES (0,0);
|
||||
SET sql_mode='pad_char_to_full_length';
|
||||
DELETE FROM t1;
|
||||
DROP TABLE t1;
|
||||
SET default_storage_engine=MEMORY;
|
||||
#
|
||||
# MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic
|
||||
#
|
||||
CREATE TABLE t1 (a INT,b CHAR(20));
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` char(20) DEFAULT NULL
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE UNIQUE INDEX bi USING HASH ON t1 (b);
|
||||
INSERT INTO t1 VALUES (0,0);
|
||||
SET sql_mode='pad_char_to_full_length';
|
||||
DELETE FROM t1;
|
||||
DROP TABLE t1;
|
||||
SET sql_mode='';
|
||||
CREATE TABLE t1 (a INT,b CHAR(20));
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` char(20) DEFAULT NULL
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE UNIQUE INDEX bi USING HASH ON t1 (b);
|
||||
SET sql_mode='pad_char_to_full_length';
|
||||
INSERT INTO t1 VALUES (0,0);
|
||||
DELETE FROM t1;
|
||||
DROP TABLE t1;
|
||||
SET sql_mode='';
|
||||
CREATE OR REPLACE TABLE t1 (a CHAR(20),b CHAR(20));
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` char(20) DEFAULT NULL,
|
||||
`b` char(20) DEFAULT NULL
|
||||
) ENGINE=MEMORY DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE UNIQUE INDEX bi USING HASH ON t1 (b);
|
||||
INSERT INTO t1 VALUES (0,0);
|
||||
SET sql_mode='pad_char_to_full_length';
|
||||
DELETE FROM t1;
|
||||
DROP TABLE t1;
|
||||
SET default_storage_engine=DEFAULT;
|
||||
#
|
||||
# End of 10.4 tests
|
||||
#
|
19
mysql-test/main/sql_mode_pad_char_to_full_length.test
Normal file
19
mysql-test/main/sql_mode_pad_char_to_full_length.test
Normal file
|
@ -0,0 +1,19 @@
|
|||
--echo #
|
||||
--echo # Start of 10.4 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic
|
||||
--echo #
|
||||
|
||||
SET default_storage_engine=MyISAM;
|
||||
--source include/sql_mode_pad_char_to_full_length.inc
|
||||
|
||||
SET default_storage_engine=MEMORY;
|
||||
--source include/sql_mode_pad_char_to_full_length.inc
|
||||
|
||||
SET default_storage_engine=DEFAULT;
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.4 tests
|
||||
--echo #
|
|
@ -0,0 +1,51 @@
|
|||
SET default_storage_engine=InnoDB;
|
||||
#
|
||||
# Start of 10.4 tests
|
||||
#
|
||||
#
|
||||
# MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic
|
||||
#
|
||||
#
|
||||
# MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic
|
||||
#
|
||||
CREATE TABLE t1 (a INT,b CHAR(20));
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` char(20) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE UNIQUE INDEX bi USING HASH ON t1 (b);
|
||||
INSERT INTO t1 VALUES (0,0);
|
||||
SET sql_mode='pad_char_to_full_length';
|
||||
DELETE FROM t1;
|
||||
DROP TABLE t1;
|
||||
SET sql_mode='';
|
||||
CREATE TABLE t1 (a INT,b CHAR(20));
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` int(11) DEFAULT NULL,
|
||||
`b` char(20) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE UNIQUE INDEX bi USING HASH ON t1 (b);
|
||||
SET sql_mode='pad_char_to_full_length';
|
||||
INSERT INTO t1 VALUES (0,0);
|
||||
DELETE FROM t1;
|
||||
DROP TABLE t1;
|
||||
SET sql_mode='';
|
||||
CREATE OR REPLACE TABLE t1 (a CHAR(20),b CHAR(20));
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` char(20) DEFAULT NULL,
|
||||
`b` char(20) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||
CREATE UNIQUE INDEX bi USING HASH ON t1 (b);
|
||||
INSERT INTO t1 VALUES (0,0);
|
||||
SET sql_mode='pad_char_to_full_length';
|
||||
DELETE FROM t1;
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 10.4 tests
|
||||
#
|
|
@ -0,0 +1,18 @@
|
|||
--source include/have_innodb.inc
|
||||
|
||||
SET default_storage_engine=InnoDB;
|
||||
|
||||
--echo #
|
||||
--echo # Start of 10.4 tests
|
||||
--echo #
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-28190 sql_mode makes MDEV-371 virtual column expressions nondeterministic
|
||||
--echo #
|
||||
|
||||
--source include/sql_mode_pad_char_to_full_length.inc
|
||||
|
||||
|
||||
--echo #
|
||||
--echo # End of 10.4 tests
|
||||
--echo #
|
Loading…
Reference in a new issue