diff options
author | Michael Widenius <monty@mariadb.org> | 2019-06-15 14:46:25 +0300 |
---|---|---|
committer | Michael Widenius <monty@mariadb.org> | 2019-06-15 14:54:21 +0300 |
commit | c02d6164fbdd5effe758a61d9bb709c581fefef1 (patch) | |
tree | ab140d45467a1b3b456c3b4c267782f3efeaa367 /mysql-test/suite/vcol/r/vcol_misc.result | |
parent | 21eed902f3415956cb3d5a4153459acc2e299402 (diff) | |
download | mariadb-git-c02d6164fbdd5effe758a61d9bb709c581fefef1.tar.gz |
MDEV-19771 REPLACE on table with virtual_field can cause crash
Fixes also MDEV-17837
Problem was that we did not ignore warnings from virtual fields when
updated virtual fields for to-be-replaced row.
Diffstat (limited to 'mysql-test/suite/vcol/r/vcol_misc.result')
-rw-r--r-- | mysql-test/suite/vcol/r/vcol_misc.result | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/mysql-test/suite/vcol/r/vcol_misc.result b/mysql-test/suite/vcol/r/vcol_misc.result index 291a954baf6..8716e39eb82 100644 --- a/mysql-test/suite/vcol/r/vcol_misc.result +++ b/mysql-test/suite/vcol/r/vcol_misc.result @@ -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 # |