1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

MDEV-5628: Assertion ! is_set()' or !is_set() || (m_status == DA_OK_BULK &&

is_bulk_op())' fails on UPDATE on a partitioned table with subquery
(MySQL:71630)

Analysis and fix: Error is not checked. So correct error state is not returned.
Fix: Check for error and return the error state.
This commit is contained in:
Rucha Deodhar
2020-09-17 18:55:59 +05:30
parent d36cd5f01e
commit 9fca6645f4
3 changed files with 29 additions and 0 deletions

View File

@@ -2796,5 +2796,16 @@ id
16 16
drop table t1; drop table t1;
# #
# MDEV-5628: Assertion `! is_set()' or `!is_set() ||
# (m_status == DA_OK_BULK && is_bulk_op())' fails on UPDATE on a
# partitioned table with subquery (MySQL:71630)
#
CREATE TABLE t1 (a INT) PARTITION BY HASH(a) PARTITIONS 2;
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (1),(2);
UPDATE t1 SET a = 7 WHERE a = ( SELECT b FROM t2 ) ORDER BY a LIMIT 6;
ERROR 21000: Subquery returns more than 1 row
DROP TABLE t1,t2;
#
# End of 10.1 tests # End of 10.1 tests
# #

View File

@@ -2998,6 +2998,22 @@ insert t1 values (6, 'ab'), (4, 'ab'), (5, 'ab'), (16, 'ab'), (14, 'ab'), (15, '
select id from t1 where data = 'ab' order by id; select id from t1 where data = 'ab' order by id;
drop table t1; drop table t1;
--echo #
--echo # MDEV-5628: Assertion `! is_set()' or `!is_set() ||
--echo # (m_status == DA_OK_BULK && is_bulk_op())' fails on UPDATE on a
--echo # partitioned table with subquery (MySQL:71630)
--echo #
CREATE TABLE t1 (a INT) PARTITION BY HASH(a) PARTITIONS 2;
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (1),(2);
--error ER_SUBQUERY_NO_1_ROW
UPDATE t1 SET a = 7 WHERE a = ( SELECT b FROM t2 ) ORDER BY a LIMIT 6;
DROP TABLE t1,t2;
--echo # --echo #
--echo # End of 10.1 tests --echo # End of 10.1 tests
--echo # --echo #

View File

@@ -413,6 +413,8 @@ int mysql_update(THD *thd,
query_plan.set_no_partitions(); query_plan.set_no_partitions();
if (thd->lex->describe || thd->lex->analyze_stmt) if (thd->lex->describe || thd->lex->analyze_stmt)
goto produce_explain_and_leave; goto produce_explain_and_leave;
if (thd->is_error())
DBUG_RETURN(1);
my_ok(thd); // No matching records my_ok(thd); // No matching records
DBUG_RETURN(0); DBUG_RETURN(0);