summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2022-07-26 21:24:01 -0700
committerIgor Babaev <igor@askmonty.org>2023-03-08 14:13:16 -0800
commita5e21cfdb212c484790359ba76f0107189411a7b (patch)
tree009a18ae67a1ab1cdeb5e30cbae9a228bbba917e
parentd3894e760e248ff65921c44fe56726e100cf60f6 (diff)
downloadmariadb-git-a5e21cfdb212c484790359ba76f0107189411a7b.tar.gz
Assertion failure with UPDATE of view using MERGE table
The problem was caused by an assertion that is not valid anymore.
-rw-r--r--mysql-test/main/merge.result12
-rw-r--r--mysql-test/main/merge.test15
-rw-r--r--sql/sql_base.cc1
3 files changed, 20 insertions, 8 deletions
diff --git a/mysql-test/main/merge.result b/mysql-test/main/merge.result
index 1eecb3e34ca..7144fd1d349 100644
--- a/mysql-test/main/merge.result
+++ b/mysql-test/main/merge.result
@@ -3898,9 +3898,6 @@ DROP TABLE t1;
DROP TABLE m1;
set global default_storage_engine=@save_default_storage_engine;
#
-# End of 10.0 tests
-#
-#
# MDEV-27407 Different ASC/DESC index attributes on MERGE and underlying table can cause wrong results
#
create table t (a int, key(a desc)) engine=myisam;
@@ -3967,3 +3964,12 @@ DROP TABLE tm, t1, t2;
#
# End of 11.0 tests
#
+#
+# MDEV-29174: UPDATE of view that uses MERGE table
+#
+CREATE TABLE t1 (a int) ENGINE=MERGE;
+CREATE VIEW v1 AS SELECT a FROM t1;
+UPDATE v1 SET a=0;
+DROP VIEW v1;
+DROP TABLE t1;
+# End of 11.1 tests
diff --git a/mysql-test/main/merge.test b/mysql-test/main/merge.test
index 6b88d427fb4..f8f421994e9 100644
--- a/mysql-test/main/merge.test
+++ b/mysql-test/main/merge.test
@@ -2860,10 +2860,6 @@ set global default_storage_engine=@save_default_storage_engine;
--source include/wait_until_count_sessions.inc
--echo #
---echo # End of 10.0 tests
---echo #
-
---echo #
--echo # MDEV-27407 Different ASC/DESC index attributes on MERGE and underlying table can cause wrong results
--echo #
create table t (a int, key(a desc)) engine=myisam;
@@ -2925,3 +2921,14 @@ DROP TABLE tm, t1, t2;
--echo #
--echo # End of 11.0 tests
--echo #
+--echo #
+--echo # MDEV-29174: UPDATE of view that uses MERGE table
+--echo #
+
+CREATE TABLE t1 (a int) ENGINE=MERGE;
+CREATE VIEW v1 AS SELECT a FROM t1;
+UPDATE v1 SET a=0;
+DROP VIEW v1;
+DROP TABLE t1;
+
+--echo # End of 11.1 tests
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 4019de6d36d..e37fb3bbe95 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -4765,7 +4765,6 @@ restart:
if (tbl->file->ha_table_flags() & HA_CAN_MULTISTEP_MERGE)
{
/* MERGE tables need to access parent and child TABLE_LISTs. */
- DBUG_ASSERT(tbl->pos_in_table_list == tables);
if (tbl->file->extra(HA_EXTRA_ATTACH_CHILDREN))
{
error= TRUE;