Commit 779d416a authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

MDEV-10724 Assertion `vcol_table == 0 || vcol_table == table' failed in...

MDEV-10724 Assertion `vcol_table == 0 || vcol_table == table' failed in fill_record(THD*, TABLE*, List<Item>&, List<Item>&, bool, bool)

Attempt to insert in several tables now checked just by table map.
parent 4a27ab23
......@@ -6278,5 +6278,19 @@ a
DROP VIEW v1;
DROP TABLE t1;
#
# MDEV-10724:Assertion `vcol_table == 0 || vcol_table == table'
# failed in fill_record(THD*, TABLE*, List<Item>&, List<Item>&,
# bool, bool)
#
CREATE TABLE t1 (f1 INT);
CREATE TABLE t2 (f2 INT);
CREATE TABLE t3 (f3 INT);
CREATE ALGORITHM = MERGE VIEW v AS SELECT f1, f3 FROM t1,
( SELECT f3 FROM t2, t3 ) AS sq;
INSERT INTO v (f1, f3) VALUES (1,1), (2,2);
ERROR HY000: Can not modify more than one base table through a join view 'test.v'
drop view v;
drop tables t1,t2,t3;
#
# End of 10.2 tests
#
......@@ -6019,6 +6019,26 @@ select * from v1;
DROP VIEW v1;
DROP TABLE t1;
--echo #
--echo # MDEV-10724:Assertion `vcol_table == 0 || vcol_table == table'
--echo # failed in fill_record(THD*, TABLE*, List<Item>&, List<Item>&,
--echo # bool, bool)
--echo #
CREATE TABLE t1 (f1 INT);
CREATE TABLE t2 (f2 INT);
CREATE TABLE t3 (f3 INT);
CREATE ALGORITHM = MERGE VIEW v AS SELECT f1, f3 FROM t1,
( SELECT f3 FROM t2, t3 ) AS sq;
--error ER_VIEW_MULTIUPDATE
INSERT INTO v (f1, f3) VALUES (1,1), (2,2);
drop view v;
drop tables t1,t2,t3;
--echo #
--echo # End of 10.2 tests
--echo #
......@@ -78,6 +78,7 @@
#include "sql_audit.h"
#include "sql_derived.h" // mysql_handle_derived
#include "sql_prepare.h"
#include <my_bit.h>
#include "debug_sync.h"
......@@ -127,6 +128,14 @@ static bool check_view_single_update(List<Item> &fields, List<Item> *values,
while ((item= it++))
tables|= item->used_tables();
/*
Check that table is only one
(we can not rely on check_single_table because it skips some
types of tables)
*/
if (my_count_bits(tables) > 1)
goto error;
if (values)
{
it.init(*values);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment