Assertion `table->file->stats.records > 0 || error' failed in join_read_const_table on concurrent SELECT and ALTER, constant Aria table

Bug #947474 reported by Elena Stepanova
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MariaDB
Fix Released
High
Michael Widenius

Bug Description

See also https://bugs.launchpad.net/maria/+bug/947487
The reason of both problems might be the same, as they happen with the exact same test case, but since it fails in both threads, sometimes on SELECT with the assertion and sometimes with the crash on ALTER (bug#947487), I will file both.

5.5.21-MariaDB-debug-log'
mysqld: /home/elenst/maria-5.5/sql/sql_select.cc:16119: int join_read_const_table(JOIN_TAB*, POSITION*): Assertion `table->file->stats.records > 0 || error' failed.

#6 0x00007fd0c2a67235 in __assert_fail () from /lib64/libc.so.6
#7 0x000000000067d8f0 in join_read_const_table (tab=0x31637a0, pos=0x7fd0a8152180)
    at /home/elenst/maria-5.5/sql/sql_select.cc:16119
#8 0x000000000065f0fc in make_join_statistics (join=0x7fd0a814e2b8, tables_list=..., conds=0x0,
    keyuse_array=0x7fd0a8156178) at /home/elenst/maria-5.5/sql/sql_select.cc:3288
#9 0x0000000000657c59 in JOIN::optimize (this=0x7fd0a814e2b8)
    at /home/elenst/maria-5.5/sql/sql_select.cc:1178
#10 0x000000000065e228 in mysql_select (thd=0x7fd0a8128a20, rref_pointer_array=0x7fd0a812b698,
    tables=0x31621e0, wild_num=1, fields=..., conds=0x0, og_num=0, order=0x0, group=0x0, having=0x0,
    proc_param=0x0, select_options=2147748608, result=0x3162838, unit=0x7fd0a812ad90,
    select_lex=0x7fd0a812b448) at /home/elenst/maria-5.5/sql/sql_select.cc:2960
#11 0x00000000006552c6 in handle_select (thd=0x7fd0a8128a20, lex=0x7fd0a812ace0, result=0x3162838,
    setup_tables_done_option=0) at /home/elenst/maria-5.5/sql/sql_select.cc:309
#12 0x000000000062f3d8 in execute_sqlcom_select (thd=0x7fd0a8128a20, all_tables=0x31621e0)
    at /home/elenst/maria-5.5/sql/sql_parse.cc:4616
#13 0x000000000062844f in mysql_execute_command (thd=0x7fd0a8128a20)
    at /home/elenst/maria-5.5/sql/sql_parse.cc:2185
#14 0x0000000000631bec in mysql_parse (thd=0x7fd0a8128a20, rawbuf=0x3161ff8 "SELECT * FROM `B`", length=17,
    parser_state=0x7fd0a4afe670) at /home/elenst/maria-5.5/sql/sql_parse.cc:5730
#15 0x0000000000625abd in dispatch_command (command=COM_QUERY, thd=0x7fd0a8128a20,
    packet=0x7fd0a812de81 "SELECT * FROM `B`", packet_length=17)
    at /home/elenst/maria-5.5/sql/sql_parse.cc:1056
#16 0x0000000000624d90 in do_command (thd=0x7fd0a8128a20) at /home/elenst/maria-5.5/sql/sql_parse.cc:795
#17 0x000000000071f729 in do_handle_one_connection (thd_arg=0x7fd0a8128a20)
    at /home/elenst/maria-5.5/sql/sql_connect.cc:1253
#18 0x000000000071f1ec in handle_one_connection (arg=0x7fd0a8128a20)
    at /home/elenst/maria-5.5/sql/sql_connect.cc:1168
#19 0x00007fd0c3d77a4f in start_thread () from /lib64/libpthread.so.0
#20 0x00007fd0c2b0c82d in clone () from /lib64/libc.so.6

bzr version-info
revision-id: <email address hidden>
date: 2012-03-03 13:22:49 -0800
build-date: 2012-03-05 22:41:54 +0200
revno: 3311

Could not reproduce on 5.3.
Could not convert into an MTR test, it might require a deeper insight into the root of the problem, and possibly usage of synchronization points.

# RQG grammar (test.yy):

partitions:
        ALTER TABLE _table PARTITION BY KEY() PARTITIONS part_num |
        ALTER TABLE _table REMOVE PARTITIONING;

query:
        SELECT * FROM _table ;

thread1:
        partitions ;

part_num:
        1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 ;

# End of RQG grammar

# Run as

perl runall.pl \
--threads=2 \
--duration=3600 \
--queries=100M \
--grammar=./test.yy \
--engine=Aria \
--rows=1,1,1,1,1,1,1,1,1 \
--mtr-build-thread=300 \
--basedir1=<5.5 debug basedir> \
--vardir1=<your vardir>

Related branches

Elena Stepanova (elenst)
description: updated
description: updated
Revision history for this message
Elena Stepanova (elenst) wrote :

Also filed as JIRA issue MDEV-170

Elena Stepanova (elenst)
description: updated
Elena Stepanova (elenst)
Changed in maria:
assignee: nobody → Michael Widenius (monty)
Michael Widenius (monty)
Changed in maria:
status: New → In Progress
Michael Widenius (monty)
Changed in maria:
status: In Progress → 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.