mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 20:12:31 +01:00
MDEV-11240: Server crashes in check_view_single_update or Assertion `derived->table' failed in mysql_derived_merge_for_insert
Before "merge" view shoud be inited to maintaing transitive attributes like "multitable".
This commit is contained in:
parent
e866e4cdbe
commit
bcc1ba9218
3 changed files with 3 additions and 9 deletions
|
@ -5626,9 +5626,6 @@ CREATE TABLE t3 (a INT);
|
|||
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT t2.a FROM t3 AS t1, t3 AS t2;
|
||||
CREATE ALGORITHM = MERGE VIEW v2 AS SELECT * FROM v1;
|
||||
PREPARE stmt FROM 'REPLACE INTO v2 SELECT a FROM t3';
|
||||
EXECUTE stmt;
|
||||
ERROR HY000: Can not insert into join view 'test.v2' without fields list
|
||||
EXECUTE stmt;
|
||||
ERROR HY000: Can not insert into join view 'test.v2' without fields list
|
||||
drop view v1,v2;
|
||||
drop table t3;
|
||||
|
|
|
@ -5573,11 +5573,8 @@ drop table t1,t2,t3;
|
|||
CREATE TABLE t3 (a INT);
|
||||
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT t2.a FROM t3 AS t1, t3 AS t2;
|
||||
CREATE ALGORITHM = MERGE VIEW v2 AS SELECT * FROM v1;
|
||||
--error ER_VIEW_NO_INSERT_FIELD_LIST
|
||||
PREPARE stmt FROM 'REPLACE INTO v2 SELECT a FROM t3';
|
||||
--error ER_VIEW_NO_INSERT_FIELD_LIST
|
||||
EXECUTE stmt;
|
||||
--error ER_VIEW_NO_INSERT_FIELD_LIST
|
||||
EXECUTE stmt;
|
||||
drop view v1,v2;
|
||||
drop table t3;
|
||||
|
||||
|
|
|
@ -510,6 +510,8 @@ bool mysql_derived_merge_for_insert(THD *thd, LEX *lex, TABLE_LIST *derived)
|
|||
DBUG_ENTER("mysql_derived_merge_for_insert");
|
||||
if (derived->merged_for_insert)
|
||||
DBUG_RETURN(FALSE);
|
||||
if (derived->init_derived(thd, FALSE))
|
||||
DBUG_RETURN(TRUE);
|
||||
if (derived->is_materialized_derived())
|
||||
DBUG_RETURN(mysql_derived_prepare(thd, lex, derived));
|
||||
if ((thd->lex->sql_command == SQLCOM_UPDATE_MULTI ||
|
||||
|
@ -526,8 +528,6 @@ bool mysql_derived_merge_for_insert(THD *thd, LEX *lex, TABLE_LIST *derived)
|
|||
derived->merged_for_insert= TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
derived->table= derived->merge_underlying_list->table;
|
||||
DBUG_RETURN(FALSE);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue