diff options
author | Alexey Botchkov <holyfoot@askmonty.org> | 2021-10-05 11:58:54 +0400 |
---|---|---|
committer | Alexey Botchkov <holyfoot@askmonty.org> | 2021-10-05 11:58:54 +0400 |
commit | ecd1aaa60d1af231fffa4b0788b2a2d073a66cc0 (patch) | |
tree | 8593d8e3b1e050fb9d0c67a3ee6fa02cb32daed1 | |
parent | 1d57892949eeb317a0914da0ff2d03deed45505a (diff) | |
download | mariadb-git-bb-10.3-hf.tar.gz |
MDEV-26540 Assertion `inited==RND' failed in handler::ha_rnd_end on DELETE.bb-10.3-hf
We supposed to run the ha_rnd_end() when rnd_seq is on.
Also the ha_spider::info() should not raise the error in the
mysql_delete.
-rw-r--r-- | sql/ha_partition.cc | 11 | ||||
-rw-r--r-- | storage/spider/ha_spider.cc | 4 | ||||
-rw-r--r-- | storage/spider/mysql-test/spider/r/ha_part.result | 7 | ||||
-rw-r--r-- | storage/spider/mysql-test/spider/t/ha_part.test | 9 |
4 files changed, 26 insertions, 5 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index fc1f0ebcb4e..dca17947a50 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -11664,10 +11664,13 @@ int ha_partition::direct_delete_rows(ha_rows *delete_rows_result) file->pre_direct_delete_rows() : file->ha_direct_delete_rows(&delete_rows)))) { - if (m_pre_calling) - file->ha_pre_rnd_end(); - else - file->ha_rnd_end(); + if (rnd_seq) + { + if (m_pre_calling) + file->ha_pre_rnd_end(); + else + file->ha_rnd_end(); + } DBUG_RETURN(error); } delete_rows_result+= delete_rows; diff --git a/storage/spider/ha_spider.cc b/storage/spider/ha_spider.cc index 0f222577515..a5b223e2838 100644 --- a/storage/spider/ha_spider.cc +++ b/storage/spider/ha_spider.cc @@ -8844,7 +8844,9 @@ int ha_spider::info( share->init_error = TRUE; share->init = TRUE; } - if (sql_command == SQLCOM_SHOW_CREATE) + if (sql_command == SQLCOM_SHOW_CREATE || + sql_command == SQLCOM_DELETE || + sql_command == SQLCOM_INSERT) { if (thd->is_error()) { diff --git a/storage/spider/mysql-test/spider/r/ha_part.result b/storage/spider/mysql-test/spider/r/ha_part.result index 315f37298bc..7a698388d18 100644 --- a/storage/spider/mysql-test/spider/r/ha_part.result +++ b/storage/spider/mysql-test/spider/r/ha_part.result @@ -248,6 +248,13 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s') 8 g 2011-05-05 21:33:30 9 h 2011-05-05 22:32:10 DROP TABLE ta_l2; +connection master_1; +CREATE TABLE t (c INT) PARTITION BY LIST COLUMNS (c) (PARTITION p DEFAULT ENGINE=SPIDER); +INSERT INTO t VALUES (1); +ERROR HY000: Unable to connect to foreign data source: localhost +DELETE FROM t; +ERROR HY000: Unable to connect to foreign data source: localhost +DROP TABLE t; deinit connection master_1; diff --git a/storage/spider/mysql-test/spider/t/ha_part.test b/storage/spider/mysql-test/spider/t/ha_part.test index 72ddcfd1f10..ba702815310 100644 --- a/storage/spider/mysql-test/spider/t/ha_part.test +++ b/storage/spider/mysql-test/spider/t/ha_part.test @@ -982,6 +982,15 @@ if ($HAVE_PARTITION) } } +--connection master_1 + +CREATE TABLE t (c INT) PARTITION BY LIST COLUMNS (c) (PARTITION p DEFAULT ENGINE=SPIDER); +--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE +INSERT INTO t VALUES (1); +--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE +DELETE FROM t; + +DROP TABLE t; --echo --echo deinit --disable_warnings |