diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2017-09-14 22:22:21 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2017-09-14 22:22:21 +0200 |
commit | efd9e5f7c600f39ac6a0a993d3812a35065183da (patch) | |
tree | e6d2e8827ae45eee6c486e1549fc2ef2f061a9d1 | |
parent | fa2701c6f7b028782cf231565f578b2fc0f10d51 (diff) | |
download | mariadb-git-bb-10.1-MDEV-13290.tar.gz |
MDEV-13290: Assertion Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' or `! is_set()' failedbb-10.1-MDEV-13290
Check error status which can be set by conversion procedures.
-rw-r--r-- | mysql-test/r/insert.result | 11 | ||||
-rw-r--r-- | mysql-test/t/insert.test | 16 | ||||
-rw-r--r-- | sql/sql_insert.cc | 3 |
3 files changed, 29 insertions, 1 deletions
diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result index 59be24dbddc..1a343931a7a 100644 --- a/mysql-test/r/insert.result +++ b/mysql-test/r/insert.result @@ -717,3 +717,14 @@ insert ignore into t1 values (1,12); Warnings: Warning 1062 Duplicate entry '1' for key 'f1' DROP TABLE t1; +# +# MDEV-13290 Assertion Assertion `!is_set() || (m_status == DA_OK_BULK +# && is_bulk_op())' or `! is_set()' failed +# +SET sql_mode= 'STRICT_ALL_TABLES'; +CREATE TABLE t1 (f1 INT DEFAULT 0, f2 INT); +CREATE ALGORITHM = MERGE VIEW v1 AS SELECT f1, f2 FROM t1 WHERE f1 = '' WITH CHECK OPTION; +REPLACE INTO v1 SET f2 = 1; +ERROR 22007: Truncated incorrect DOUBLE value: '' +DROP VIEW v1; +DROP TABLE t1; diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test index 2d95dffa17a..f3277923001 100644 --- a/mysql-test/t/insert.test +++ b/mysql-test/t/insert.test @@ -573,3 +573,19 @@ insert ignore into t1 values (1,12) on duplicate key update f2=13; set @@old_mode=""; insert ignore into t1 values (1,12); DROP TABLE t1; + +--echo # +--echo # MDEV-13290 Assertion Assertion `!is_set() || (m_status == DA_OK_BULK +--echo # && is_bulk_op())' or `! is_set()' failed +--echo # + +SET sql_mode= 'STRICT_ALL_TABLES'; +CREATE TABLE t1 (f1 INT DEFAULT 0, f2 INT); +CREATE ALGORITHM = MERGE VIEW v1 AS SELECT f1, f2 FROM t1 WHERE f1 = '' WITH CHECK OPTION; + +--error ER_TRUNCATED_WRONG_VALUE +REPLACE INTO v1 SET f2 = 1; + +# Cleanup +DROP VIEW v1; +DROP TABLE t1; diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 721fff389e0..66837caf293 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -1180,7 +1180,8 @@ values_loop_end: (!table->triggers || !table->triggers->has_delete_triggers())) table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE); - if (error) + /* We check thd->error() because it can be set by conversion problem. */ + if (error || thd->is_error()) goto abort; if (thd->lex->analyze_stmt) { |