diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-07-03 10:25:38 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-07-03 10:25:38 +0300 |
commit | 186a998b5b932851d64666c92e3062c9e997e77b (patch) | |
tree | 606b064a57936b2e6f10e0b396ed6d5165a6d419 /mysql-test | |
parent | c3289d27eef39a47fed2ce1ff239013ed6870f39 (diff) | |
parent | 400cf017152c732387c89deaa082b43c8fb42d71 (diff) | |
download | mariadb-git-186a998b5b932851d64666c92e3062c9e997e77b.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/main/check_constraint.result | 37 | ||||
-rw-r--r-- | mysql-test/main/check_constraint.test | 28 | ||||
-rw-r--r-- | mysql-test/main/constraints.result | 2 | ||||
-rw-r--r-- | mysql-test/main/type_json.result | 2 | ||||
-rw-r--r-- | mysql-test/suite/mariabackup/suite.opt | 2 | ||||
-rw-r--r-- | mysql-test/suite/mariabackup/unsupported_redo.result | 3 | ||||
-rw-r--r-- | mysql-test/suite/mariabackup/unsupported_redo.test | 1 |
7 files changed, 62 insertions, 13 deletions
diff --git a/mysql-test/main/check_constraint.result b/mysql-test/main/check_constraint.result index 9a32e6f12bc..9a228f9ccc7 100644 --- a/mysql-test/main/check_constraint.result +++ b/mysql-test/main/check_constraint.result @@ -10,9 +10,9 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (100,100); insert into t1 values (1,1); -ERROR 23000: CONSTRAINT `a` failed for `test`.`t1` +ERROR 23000: CONSTRAINT `t1.a` failed for `test`.`t1` insert into t1 values (20,1); -ERROR 23000: CONSTRAINT `b` failed for `test`.`t1` +ERROR 23000: CONSTRAINT `t1.b` failed for `test`.`t1` insert into t1 values (20,30); ERROR 23000: CONSTRAINT `min` failed for `test`.`t1` insert into t1 values (500,500); @@ -60,7 +60,7 @@ t1 CREATE TABLE `t1` ( CONSTRAINT `CONSTRAINT_1` CHECK (`a` + `b` + `c` < 500) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values(105,105,105); -ERROR 23000: CONSTRAINT `c` failed for `test`.`t1` +ERROR 23000: CONSTRAINT `t1.c` failed for `test`.`t1` insert into t1 values(249,249,9); ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1` insert into t1 values(105,105,9); @@ -145,7 +145,7 @@ ERROR HY000: Function or expression '@b' cannot be used in the CHECK clause of ` create table t1 (a int check (a = 1)); insert t1 values (1); insert t1 values (2); -ERROR 23000: CONSTRAINT `a` failed for `test`.`t1` +ERROR 23000: CONSTRAINT `t1.a` failed for `test`.`t1` insert t1 values (NULL); select * from t1; a @@ -165,13 +165,13 @@ ERROR 22007: Truncated incorrect DOUBLE value: 'Ken' SHOW WARNINGS; Level Code Message Error 1292 Truncated incorrect DOUBLE value: 'Ken' -Error 4025 CONSTRAINT `FirstName` failed for `test`.`t1` +Error 4025 CONSTRAINT `t1.FirstName` failed for `test`.`t1` INSERT INTO t1 VALUES (NULL, 'Ken'),(NULL, 'Brian'); ERROR 22007: Truncated incorrect DOUBLE value: 'Ken' SHOW WARNINGS; Level Code Message Error 1292 Truncated incorrect DOUBLE value: 'Ken' -Error 4025 CONSTRAINT `FirstName` failed for `test`.`t1` +Error 4025 CONSTRAINT `t1.FirstName` failed for `test`.`t1` INSERT IGNORE INTO t1 VALUES (NULL, 'Ken'); Warnings: Warning 1292 Truncated incorrect DOUBLE value: 'Ken' @@ -197,3 +197,28 @@ EmployeeID FirstName 5 Ken 6 Brian drop table t1; +# +# MDEV-16630: Ambiguous error message when check constraint +# matches table name +# +use test; +drop table if exists t; +create table t(a int, b int check(b>0), +constraint b check(a<b), constraint a check(a>0), +constraint x check (a>10)); +show create table t; +Table Create Table +t CREATE TABLE `t` ( + `a` int(11) DEFAULT NULL, + `b` int(11) DEFAULT NULL CHECK (`b` > 0), + CONSTRAINT `b` CHECK (`a` < `b`), + CONSTRAINT `a` CHECK (`a` > 0), + CONSTRAINT `x` CHECK (`a` > 10) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +# Field constraint 'b' will fail +insert into t values (-1, 0); +ERROR 23000: CONSTRAINT `t.b` failed for `test`.`t` +# Table constraint 'b' will fail +insert into t values (1,1); +ERROR 23000: CONSTRAINT `b` failed for `test`.`t` +drop table t; diff --git a/mysql-test/main/check_constraint.test b/mysql-test/main/check_constraint.test index 02081071bd4..be06c3ec579 100644 --- a/mysql-test/main/check_constraint.test +++ b/mysql-test/main/check_constraint.test @@ -135,3 +135,31 @@ INSERT INTO t1 VALUES (NULL, 'Ken'),(NULL, 'Brian'); set sql_mode=default; select * from t1; drop table t1; + +--echo # +--echo # MDEV-16630: Ambiguous error message when check constraint +--echo # matches table name +--echo # + +use test; +--disable_warnings +drop table if exists t; +--enable_warnings + +create table t(a int, b int check(b>0), + constraint b check(a<b), constraint a check(a>0), + constraint x check (a>10)); + +show create table t; + +# Generate error when field constraint 'b' is violated +--echo # Field constraint 'b' will fail +--error ER_CONSTRAINT_FAILED +insert into t values (-1, 0); + +# Generate error when table constraint 'b' is violated. +--echo # Table constraint 'b' will fail +--error ER_CONSTRAINT_FAILED +insert into t values (1,1); + +drop table t; diff --git a/mysql-test/main/constraints.result b/mysql-test/main/constraints.result index fe9398ea8ce..57cfbfb3d37 100644 --- a/mysql-test/main/constraints.result +++ b/mysql-test/main/constraints.result @@ -7,7 +7,7 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert into t1 values (1); insert into t1 values (0); -ERROR 23000: CONSTRAINT `a` failed for `test`.`t1` +ERROR 23000: CONSTRAINT `t1.a` failed for `test`.`t1` drop table t1; create table t1 (a int, b int, check (a>b)); show create table t1; diff --git a/mysql-test/main/type_json.result b/mysql-test/main/type_json.result index 2c1fdbe2b95..0045847097b 100644 --- a/mysql-test/main/type_json.result +++ b/mysql-test/main/type_json.result @@ -20,7 +20,7 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 insert t1 values ('[]'); insert t1 values ('a'); -ERROR 23000: CONSTRAINT `a` failed for `test`.`t1` +ERROR 23000: CONSTRAINT `t1.a` failed for `test`.`t1` set timestamp=unix_timestamp('2010:11:12 13:14:15'); create or replace table t1(a json default(json_object('now', now()))); show create table t1; diff --git a/mysql-test/suite/mariabackup/suite.opt b/mysql-test/suite/mariabackup/suite.opt index 3b5cc4f4c45..de3637814b2 100644 --- a/mysql-test/suite/mariabackup/suite.opt +++ b/mysql-test/suite/mariabackup/suite.opt @@ -1 +1 @@ ---innodb --loose-changed_page_bitmaps --innodb-sys-tables +--innodb --loose-changed_page_bitmaps --innodb-sys-tables --innodb-flush-log-at-trx-commit=2 diff --git a/mysql-test/suite/mariabackup/unsupported_redo.result b/mysql-test/suite/mariabackup/unsupported_redo.result index 543e564d8a8..a1f95c099cd 100644 --- a/mysql-test/suite/mariabackup/unsupported_redo.result +++ b/mysql-test/suite/mariabackup/unsupported_redo.result @@ -5,9 +5,6 @@ call mtr.add_suppression("InnoDB: If you are installing InnoDB, remember that yo call mtr.add_suppression("InnoDB: Ignoring tablespace for `test`\\.`t21` because it could not be opened"); call mtr.add_suppression("InnoDB: Cannot open datafile for read-only: "); call mtr.add_suppression("Table .* in the InnoDB data dictionary has tablespace id .*, but tablespace with that id or name does not exist"); -SELECT @@GLOBAL.innodb_flush_log_at_trx_commit; -@@GLOBAL.innodb_flush_log_at_trx_commit -1 CREATE TABLE t1(i INT PRIMARY KEY auto_increment, a int) ENGINE INNODB; ALTER TABLE t1 FORCE, ALGORITHM=INPLACE; # Fails during full backup diff --git a/mysql-test/suite/mariabackup/unsupported_redo.test b/mysql-test/suite/mariabackup/unsupported_redo.test index 9d54c5bbe87..319ee2c7571 100644 --- a/mysql-test/suite/mariabackup/unsupported_redo.test +++ b/mysql-test/suite/mariabackup/unsupported_redo.test @@ -10,7 +10,6 @@ call mtr.add_suppression("Table .* in the InnoDB data dictionary has tablespace let $basedir=$MYSQLTEST_VARDIR/tmp/backup; let $incremental_dir=$MYSQLTEST_VARDIR/tmp/backup_inc1; -SELECT @@GLOBAL.innodb_flush_log_at_trx_commit; CREATE TABLE t1(i INT PRIMARY KEY auto_increment, a int) ENGINE INNODB; --source ../../suite/innodb/include/no_checkpoint_start.inc ALTER TABLE t1 FORCE, ALGORITHM=INPLACE; |