diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-03-12 14:26:34 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-03-12 14:26:34 +0200 |
commit | b32bc70e340b5b0d8fcb9aa48b1b875f3f2f12dc (patch) | |
tree | 4edd8565c6eb0b1139cbb37c48f4d5f5a28798be /mysql-test/main | |
parent | f010c90807da68487b1ce4c952588c6c3def2afd (diff) | |
parent | f72760df3390407c3cbe876e827818bc52849b71 (diff) | |
download | mariadb-git-b32bc70e340b5b0d8fcb9aa48b1b875f3f2f12dc.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'mysql-test/main')
-rw-r--r-- | mysql-test/main/check_constraint.result | 13 | ||||
-rw-r--r-- | mysql-test/main/check_constraint.test | 14 | ||||
-rw-r--r-- | mysql-test/main/func_json.result | 12 | ||||
-rw-r--r-- | mysql-test/main/func_json.test | 7 | ||||
-rw-r--r-- | mysql-test/main/mysqlbinlog.result | 16 | ||||
-rw-r--r-- | mysql-test/main/reopen_temp_table.result | 53 | ||||
-rw-r--r-- | mysql-test/main/reopen_temp_table.test | 40 |
7 files changed, 147 insertions, 8 deletions
diff --git a/mysql-test/main/check_constraint.result b/mysql-test/main/check_constraint.result index 8cb1066ba9a..3511af84166 100644 --- a/mysql-test/main/check_constraint.result +++ b/mysql-test/main/check_constraint.result @@ -222,3 +222,16 @@ ERROR 23000: CONSTRAINT `t.b` failed for `test`.`t` insert into t values (1,1); ERROR 23000: CONSTRAINT `b` failed for `test`.`t` drop table t; +create table t1 (a int auto_increment primary key, b int, check (b > 5)); +insert t1 (b) values (1); +ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1` +insert t1 (b) values (10); +select * from t1 where a is null; +a b +set sql_auto_is_null=1; +select * from t1 where a is null; +a b +1 10 +insert t1 (b) values (1); +ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1` +drop table t1; diff --git a/mysql-test/main/check_constraint.test b/mysql-test/main/check_constraint.test index 37fdc7203b1..93538fd1666 100644 --- a/mysql-test/main/check_constraint.test +++ b/mysql-test/main/check_constraint.test @@ -162,3 +162,17 @@ insert into t values (-1, 0); insert into t values (1,1); drop table t; + +# +# check constraints and auto_is_null typo +# +create table t1 (a int auto_increment primary key, b int, check (b > 5)); +--error ER_CONSTRAINT_FAILED +insert t1 (b) values (1); +insert t1 (b) values (10); +select * from t1 where a is null; +set sql_auto_is_null=1; +select * from t1 where a is null; +--error ER_CONSTRAINT_FAILED +insert t1 (b) values (1); +drop table t1; diff --git a/mysql-test/main/func_json.result b/mysql-test/main/func_json.result index 61dd55850ac..6222d5f1feb 100644 --- a/mysql-test/main/func_json.result +++ b/mysql-test/main/func_json.result @@ -831,6 +831,18 @@ select JSON_VALID( '{"a":1]' ); JSON_VALID( '{"a":1]' ) 0 # +# MDEV-18886 JSON_ARRAY() does not recognise JSON argument. +# +SELECT JSON_ARRAY(_UTF8 'str', JSON_OBJECT(_LATIN1 'plugin', _LATIN1'unix_socket')); +JSON_ARRAY(_UTF8 'str', JSON_OBJECT(_LATIN1 'plugin', _LATIN1'unix_socket')) +["str", {"plugin": "unix_socket"}] +SELECT CHARSET(JSON_ARRAY()); +CHARSET(JSON_ARRAY()) +latin1 +SELECT CHARSET(JSON_OBJECT()); +CHARSET(JSON_OBJECT()) +latin1 +# # End of 10.2 tests # # diff --git a/mysql-test/main/func_json.test b/mysql-test/main/func_json.test index fabca504530..bcf0fdfe3fc 100644 --- a/mysql-test/main/func_json.test +++ b/mysql-test/main/func_json.test @@ -485,6 +485,13 @@ SET sql_mode=default; select JSON_VALID( '{"a":1]' ); --echo # +--echo # MDEV-18886 JSON_ARRAY() does not recognise JSON argument. +--echo # +SELECT JSON_ARRAY(_UTF8 'str', JSON_OBJECT(_LATIN1 'plugin', _LATIN1'unix_socket')); +SELECT CHARSET(JSON_ARRAY()); +SELECT CHARSET(JSON_OBJECT()); + +--echo # --echo # End of 10.2 tests --echo # diff --git a/mysql-test/main/mysqlbinlog.result b/mysql-test/main/mysqlbinlog.result index 668952d20d7..8d7f6337c05 100644 --- a/mysql-test/main/mysqlbinlog.result +++ b/mysql-test/main/mysqlbinlog.result @@ -724,7 +724,7 @@ ROLLBACK/*!*/; use `test`/*!*/; SET TIMESTAMP=1253783037/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -778,7 +778,7 @@ DELIMITER /*!*/; ROLLBACK/*!*/; SET TIMESTAMP=1253783037/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -813,7 +813,7 @@ ROLLBACK /* added by mysqlbinlog */; DELIMITER /*!*/; SET TIMESTAMP=1266652094/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -855,7 +855,7 @@ ROLLBACK /* added by mysqlbinlog */; DELIMITER /*!*/; SET TIMESTAMP=1266652094/*!*/; SET @@session.pseudo_thread_id=999999999/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -962,7 +962,7 @@ AAAAAAAAAAAAAAAAAAAgrgJSFzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC # Event: Query thread_id=1 exec_time=0 error_code=0 SET TIMESTAMP=1375907364/*!*/; SET @@session.pseudo_thread_id=1/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -1045,7 +1045,7 @@ AAAAAAAAAAAAAAAAAAA/rQJSGzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC # Event: Query thread_id=1 exec_time=1 error_code=0 SET TIMESTAMP=1375907141/*!*/; SET @@session.pseudo_thread_id=1/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -1128,7 +1128,7 @@ AAAAAAAAAAAAAAAAAAAnrAJSHzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC # Event: Query thread_id=1 exec_time=0 error_code=0 SET TIMESTAMP=1375906879/*!*/; SET @@session.pseudo_thread_id=1/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; @@ -1211,7 +1211,7 @@ AAAAAAAAAAAAAAAAAABbsAJSEzgNAAgAEgAEBAQEEgAAUwAEGggAAAAICAgC # Event: Query thread_id=1 exec_time=0 error_code=0 SET TIMESTAMP=1375907933/*!*/; SET @@session.pseudo_thread_id=1/*!*/; -SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/; +SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/; SET @@session.sql_mode=0/*!*/; SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/; /*!\C latin1 *//*!*/; diff --git a/mysql-test/main/reopen_temp_table.result b/mysql-test/main/reopen_temp_table.result index 217aa3c8bad..ef215366db7 100644 --- a/mysql-test/main/reopen_temp_table.result +++ b/mysql-test/main/reopen_temp_table.result @@ -190,3 +190,56 @@ NULL NULL DROP TABLE t; # Cleanup DROP DATABASE temp_db; +USE test; +create temporary table t1 (f char(255), b int, index(b)) engine=MyISAM; +replace into t1 values (null,1),(null,2); +alter table t1 add fulltext key(f); +alter table t1 change if exists a b int, algorithm=inplace; +ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select * from t1; +f b +NULL 1 +NULL 2 +drop table t1; +create temporary table t1 (f char(255), b int, index(b)) engine=aria transactional=1; +replace into t1 values (null,1),(null,2); +alter table t1 add fulltext key(f); +alter table t1 change if exists a b int, algorithm=inplace; +ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select * from t1; +f b +NULL 1 +NULL 2 +drop table t1; +create temporary table t1 (f char(255), b int, index(b)) engine=aria transactional=0 row_format=page; +replace into t1 values (null,1),(null,2); +alter table t1 add fulltext key(f); +alter table t1 change if exists a b int, algorithm=inplace; +ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select * from t1; +f b +NULL 1 +NULL 2 +drop table t1; +create temporary table t1 (f char(255), b int, index(b)) engine=aria transactional=0 row_format=dynamic; +replace into t1 values (null,1),(null,2); +alter table t1 add fulltext key(f); +alter table t1 change if exists a b int, algorithm=inplace; +ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY +check table t1; +Table Op Msg_type Msg_text +test.t1 check status OK +select * from t1; +f b +NULL 1 +NULL 2 +drop table t1; diff --git a/mysql-test/main/reopen_temp_table.test b/mysql-test/main/reopen_temp_table.test index 2aa6caa1655..2b3ff3bab5e 100644 --- a/mysql-test/main/reopen_temp_table.test +++ b/mysql-test/main/reopen_temp_table.test @@ -182,3 +182,43 @@ DROP TABLE t; --echo # Cleanup DROP DATABASE temp_db; +USE test; + +# +# MDEV-17070 Table corruption or Assertion `table->file->stats.records > 0 || error' or Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed upon actions on temporary table +# +create temporary table t1 (f char(255), b int, index(b)) engine=MyISAM; +replace into t1 values (null,1),(null,2); +alter table t1 add fulltext key(f); +--error ER_ALTER_OPERATION_NOT_SUPPORTED +alter table t1 change if exists a b int, algorithm=inplace; +check table t1; +select * from t1; +drop table t1; + +create temporary table t1 (f char(255), b int, index(b)) engine=aria transactional=1; +replace into t1 values (null,1),(null,2); +alter table t1 add fulltext key(f); +--error ER_ALTER_OPERATION_NOT_SUPPORTED +alter table t1 change if exists a b int, algorithm=inplace; +check table t1; +select * from t1; +drop table t1; + +create temporary table t1 (f char(255), b int, index(b)) engine=aria transactional=0 row_format=page; +replace into t1 values (null,1),(null,2); +alter table t1 add fulltext key(f); +--error ER_ALTER_OPERATION_NOT_SUPPORTED +alter table t1 change if exists a b int, algorithm=inplace; +check table t1; +select * from t1; +drop table t1; + +create temporary table t1 (f char(255), b int, index(b)) engine=aria transactional=0 row_format=dynamic; +replace into t1 values (null,1),(null,2); +alter table t1 add fulltext key(f); +--error ER_ALTER_OPERATION_NOT_SUPPORTED +alter table t1 change if exists a b int, algorithm=inplace; +check table t1; +select * from t1; +drop table t1; |