[MDEV-10724] Assertion `vcol_table == 0 || vcol_table == table' failed in fill_record(THD*, TABLE*, List<Item>&, List<Item>&, bool, bool) Created: 2016-09-01  Updated: 2016-11-22  Resolved: 2016-11-22

Status: Closed
Project: MariaDB Server
Component/s: Views
Affects Version/s: 10.2
Fix Version/s: 10.2.3

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Oleksandr Byelkin
Resolution: Fixed Votes: 0
Labels: None


 Description   

Stack trace from 10.2 addb38f47

mysqld: /data/src/10.2/sql/sql_base.cc:7822: bool fill_record(THD*, TABLE*, List<Item>&, List<Item>&, bool, bool): Assertion `vcol_table == 0 || vcol_table == table' failed.
160902  2:46:37 [ERROR] mysqld got signal 6 ;
 
#7  0x00007ff7f2bb6312 in __GI___assert_fail (assertion=0x7ff7f5d194a0 "vcol_table == 0 || vcol_table == table", file=0x7ff7f5d17db8 "/data/src/10.2/sql/sql_base.cc", line=7822, function=0x7ff7f5d1b1c0 <fill_record(THD*, TABLE*, List<Item>&, List<Item>&, bool, bool)::__PRETTY_FUNCTION__> "bool fill_record(THD*, TABLE*, List<Item>&, List<Item>&, bool, bool)") at assert.c:101
#8  0x00007ff7f53a10b0 in fill_record (thd=0x7ff7e9852070, table_arg=0x7ff7e98a9470, fields=..., values=..., ignore_errors=false, update=false) at /data/src/10.2/sql/sql_base.cc:7822
#9  0x00007ff7f53a15be in fill_record_n_invoke_before_triggers (thd=0x7ff7e9852070, table=0x7ff7e98a9470, fields=..., values=..., ignore_errors=false, event=TRG_EVENT_INSERT) at /data/src/10.2/sql/sql_base.cc:7962
#10 0x00007ff7f53d9f4e in mysql_insert (thd=0x7ff7e9852070, table_list=0x7ff7e9921190, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_REPLACE, ignore=false) at /data/src/10.2/sql/sql_insert.cc:900
#11 0x00007ff7f53ff44c in mysql_execute_command (thd=0x7ff7e9852070) at /data/src/10.2/sql/sql_parse.cc:4307
#12 0x00007ff7f540a3d7 in mysql_parse (thd=0x7ff7e9852070, rawbuf=0x7ff7e9921088 "REPLACE INTO v (f1, f3) VALUES (1,1), (2,2)", length=43, parser_state=0x7ff7f637cdd0, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7765
#13 0x00007ff7f53f87aa in dispatch_command (command=COM_QUERY, thd=0x7ff7e9852070, packet=0x7ff7e9915071 "REPLACE INTO v (f1, f3) VALUES (1,1), (2,2)", packet_length=43, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1793
#14 0x00007ff7f53f71db in do_command (thd=0x7ff7e9852070) at /data/src/10.2/sql/sql_parse.cc:1353
#15 0x00007ff7f5531870 in do_handle_one_connection (connect=0x7ff7f206d410) at /data/src/10.2/sql/sql_connect.cc:1354
#16 0x00007ff7f55315fd in handle_one_connection (arg=0x7ff7f206d410) at /data/src/10.2/sql/sql_connect.cc:1260
#17 0x00007ff7f582663c in pfs_spawn_thread (arg=0x7ff7f20519f0) at /data/src/10.2/storage/perfschema/pfs.cc:1862
#18 0x00007ff7f4ab80a4 in start_thread (arg=0x7ff7f637e300) at pthread_create.c:309
#19 0x00007ff7f2c7087d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

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;
 
REPLACE INTO v (f1, f3) VALUES (1,1), (2,2);



 Comments   
Comment by Oleksandr Byelkin [ 2016-09-17 ]

The view f3 is not apdateable, so it should be an error.

Comment by Oleksandr Byelkin [ 2016-11-16 ]

Problem is that check_single_table do not check all types of tables, and here we have merged derived inside view, so better just check bitmap on presence not more then 1 bit.

Comment by Oleksandr Byelkin [ 2016-11-16 ]

revision-id: ebe34c40e1d4209a47173b47ae4b3ca6e9fe7a77 (mariadb-10.2.2-100-gebe34c4)
parent(s): 0838fd00e7c95d54541c2126ef933d0ae65c02f7
committer: Oleksandr Byelkin
timestamp: 2016-11-16 21:16:32 +0100
message:

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.

Comment by Igor Babaev [ 2016-11-21 ]

The fix is approved

Generated at Thu Feb 08 07:44:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.