Assertion failure with UPDATE of view using MERGE table

The problem was caused by an assertion that is not valid anymore.
This commit is contained in:
Igor Babaev 2022-07-26 21:24:01 -07:00
parent 88ca62dc68
commit 9f79652625
3 changed files with 20 additions and 8 deletions

View File

@ -3898,9 +3898,6 @@ DROP TABLE t1;
DROP TABLE m1; DROP TABLE m1;
set global default_storage_engine=@save_default_storage_engine; 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 # 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; create table t (a int, key(a desc)) engine=myisam;
@ -3967,3 +3964,12 @@ DROP TABLE tm, t1, t2;
# #
# End of 11.0 tests # 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

View File

@ -2859,10 +2859,6 @@ set global default_storage_engine=@save_default_storage_engine;
# gone so execution of other tests won't be affected by their presence. # gone so execution of other tests won't be affected by their presence.
--source include/wait_until_count_sessions.inc --source include/wait_until_count_sessions.inc
--echo #
--echo # End of 10.0 tests
--echo #
--echo # --echo #
--echo # MDEV-27407 Different ASC/DESC index attributes on MERGE and underlying table can cause wrong results --echo # MDEV-27407 Different ASC/DESC index attributes on MERGE and underlying table can cause wrong results
--echo # --echo #
@ -2925,3 +2921,14 @@ DROP TABLE tm, t1, t2;
--echo # --echo #
--echo # End of 11.0 tests --echo # End of 11.0 tests
--echo # --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

View File

@ -4765,7 +4765,6 @@ restart:
if (tbl->file->ha_table_flags() & HA_CAN_MULTISTEP_MERGE) if (tbl->file->ha_table_flags() & HA_CAN_MULTISTEP_MERGE)
{ {
/* MERGE tables need to access parent and child TABLE_LISTs. */ /* 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)) if (tbl->file->extra(HA_EXTRA_ATTACH_CHILDREN))
{ {
error= TRUE; error= TRUE;