<multi-table> mysqld: sql_update.cc:1358: virtual int multi_update::prepare(List<Item>&, SELECT_LEX_UNIT*): Assertion `table->read_set == &table->def_read_set' failed in maria-5.3-mwl106

Bug #794890 reported by Philip Stoev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MariaDB
Fix Released
Critical
Igor Babaev

Bug Description

Not repeatable in maria-5.3.

Backtrace:

mysqld: sql_update.cc:1358: virtual int multi_update::prepare(List<Item>&, SELECT_LEX_UNIT*): Assertion `table->read_set == &table->def_read_set' failed.

#8 0x006b0d98 in __assert_fail () from /lib/libc.so.6
#9 0x0836768e in multi_update::prepare (this=0xae52a6c0, not_used_values=..., lex_unit=0xad57e4c) at sql_update.cc:1358
#10 0x0831764b in JOIN::prepare (this=0xae6365d8, rref_pointer_array=0xad58248, tables_init=0xae512680, wild_num=0, conds_init=0x0, og_num=0,
    order_init=0x0, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0xad58128, unit_arg=0xad57e4c) at sql_select.cc:742
#11 0x0831e408 in mysql_select (thd=0xad56730, rref_pointer_array=0xad58248, tables=0xae512680, wild_num=0, fields=..., conds=0x0, og_num=0, order=0x0,
    group=0x0, having=0x0, proc_param=0x0, select_options=1342177408, result=0xae52a6c0, unit=0xad57e4c, select_lex=0xad58128) at sql_select.cc:2862
#12 0x0836727f in mysql_multi_update (thd=0xad56730, table_list=0xae512680, fields=0xad581bc, values=0xad58404, conds=0x0, options=0,
    handle_duplicates=DUP_ERROR, ignore=false, unit=0xad57e4c, select_lex=0xad58128) at sql_update.cc:1281
#13 0x082ab1d9 in mysql_execute_command (thd=0xad56730) at sql_parse.cc:3119
#14 0x082b4106 in mysql_parse (thd=0xad56730, rawbuf=0xae5125e0 "UPDATE v2 SET f1 = 2", length=20, found_semicolon=0xae883228) at sql_parse.cc:6087
#15 0x082a657b in dispatch_command (command=COM_QUERY, thd=0xad56730, packet=0xadb1231 "UPDATE v2 SET f1 = 2", packet_length=20) at sql_parse.cc:1206
#16 0x082a5a01 in do_command (thd=0xad56730) at sql_parse.cc:904
#17 0x082a2a7c in handle_one_connection (arg=0xad56730) at sql_connect.cc:1177
#18 0x00821919 in start_thread () from /lib/libpthread.so.0
#19 0x0076acce in clone () from /lib/libc.so.6

test case:

CREATE TABLE t1 ( f1 INT );
CREATE TABLE t2 ( f1 INT );
CREATE ALGORITHM=TEMPTABLE VIEW v1 AS SELECT f1 FROM t1;
CREATE VIEW v2 AS SELECT t2.f1 from (t2 JOIN v1);
UPDATE v2 SET f1 = 2;

 bzr version-info
revision-id: <email address hidden>
date: 2011-06-09 00:13:00 -0700
build-date: 2011-06-09 10:53:16 +0300
revno: 3029
branch-nick: maria-5.3-mwl106

backtrace from a slightly older Revno: 3028 Revision-Id: <email address hidden>

#4 <signal handler called>
#5 0x081b6829 in st_table::set_table_map (this=0x0, map_arg=4, tablenr_arg=2) at table.h:966
#6 0x081b5a42 in st_select_lex::remap_tables (this=0xae613720, derived=0xae612f50, map=4, tablenr=2, parent_lex=0xac26128) at sql_lex.cc:3356
#7 0x081b5c1e in st_select_lex::merge_subquery (this=0xac26128, derived=0xae612f50, subq_select=0xae613720, table_no=1, map=2) at sql_lex.cc:3425
#8 0x0846a97c in mysql_derived_merge (thd=0xac24730, lex=0xac25df0, derived=0xae612f50) at sql_derived.cc:390
#9 0x0846ad72 in mysql_derived_merge_for_insert (thd=0xac24730, lex=0xac25df0, derived=0xae612f50) at sql_derived.cc:501
#10 0x0846a6cf in mysql_handle_single_derived (lex=0xac25df0, derived=0xae612f50, phases=16) at sql_derived.cc:171
#11 0x08314f7c in TABLE_LIST::handle_derived (this=0xae612f50, lex=0xac25df0, phases=16) at table.cc:5762
#12 0x0846a747 in mysql_handle_list_of_derived (lex=0xac25df0, table_list=0xae612f50, phases=16) at sql_derived.cc:202
#13 0x083667fe in mysql_multi_update_prepare (thd=0xac24730) at sql_update.cc:1041
#14 0x082ab0a8 in mysql_execute_command (thd=0xac24730) at sql_parse.cc:3081
#15 0x082b419d in mysql_parse (thd=0xac24730, rawbuf=0xae612eb0 "UPDATE v2 SET f1 = 2", length=20, found_semicolon=0xb6d55228) at sql_parse.cc:6090
#16 0x082a657b in dispatch_command (command=COM_QUERY, thd=0xac24730, packet=0xac7f231 "UPDATE v2 SET f1 = 2", packet_length=20) at sql_parse.cc:1206
#17 0x082a5a01 in do_command (thd=0xac24730) at sql_parse.cc:904
#18 0x082a2a7c in handle_one_connection (arg=0xac24730) at sql_connect.cc:1177
#19 0x00821919 in start_thread () from /lib/libpthread.so.0
#20 0x0076acce in clone () from /lib/libc.so.6

Related branches

Changed in maria:
assignee: nobody → Igor Babaev (igorb-seattle)
milestone: none → 5.3
Changed in maria:
status: New → Confirmed
importance: Undecided → Critical
Changed in maria:
status: Confirmed → In Progress
Revision history for this message
Igor Babaev (igorb-seattle) wrote :

If I remove the complaining assert and insert some rows into t1, and t2

INSERT INTO t1 VALUES (20), (7);
INSERT INTO t2 VALUES (7), (9), (7);

I get a crash on the server in fix_semijoin_strategies_for_picked_join_order

in the line:

if ((handled_tabs & s->table->map) || pos->sj_strategy == SJ_OPT_NONE).

I also have a crash in the same line for the the multi-delete statement:

DELETE t1 FROM t1,v2;

summary: - mysqld: sql_update.cc:1358: virtual int
+ <multi-table> mysqld: sql_update.cc:1358: virtual int
multi_update::prepare(List<Item>&, SELECT_LEX_UNIT*): Assertion
`table->read_set == &table->def_read_set' failed in maria-5.3-mwl106
Changed in maria:
status: In Progress → Fix Committed
Changed in maria:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.