Bug #48275 assert in check_view_insertability
Submitted: 23 Oct 2009 20:12 Modified: 10 Nov 2009 13:16
Reporter: Matthias Leich Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Views Severity:S3 (Non-critical)
Version:mysql-6.0-codebase-bugfixing OS:Any
Assigned to: Matthias Leich CPU Architecture:Any

[23 Oct 2009 20:12] Matthias Leich
Description:
The assert happens in sql_insert.cc:1042 :
   DBUG_ASSERT(view->table != 0 && view->field_translation != 0);

Backtrace from mysql-6.0-codebase-bugfixing 
revno: 3654 2009-10-15
-------------------------------------------
Thread 1 (process 8707):
#0  0x00007f6e373cc1f6 in pthread_kill () from /lib/libpthread.so.0
#1  0x0000000000b8f05c in my_write_core (sig=6) at stacktrace.c:309
#2  0x00000000006f6f17 in handle_segfault (sig=6) at mysqld.cc:2754
#3  <signal handler called>
#4  0x00007f6e36280fb5 in raise () from /lib/libc.so.6
#5  0x00007f6e36282bc3 in abort () from /lib/libc.so.6
#6  0x00007f6e36279f09 in __assert_fail () from /lib/libc.so.6
#7  0x00000000007bd509 in check_view_insertability (thd=0x7f6e30d7ef28,
    view=0x28d6340) at sql_insert.cc:1042
#8  0x00000000007bdfd0 in check_insert_fields (thd=0x7f6e30d7ef28,
    table_list=0x28d6340, fields=@0x7f6e30d81428, values=@0x7f6e30d81030,
    check_unique=false, map=0x7f6e262965e8) at sql_insert.cc:272
#9  0x00000000007be11a in select_insert::prepare (this=0x27b8070,
    values=@0x7f6e30d81030, u=0x7f6e30d80898) at sql_insert.cc:3049
#10 0x00000000007ad4a2 in JOIN::prepare (this=0x2abf610,
    rref_pointer_array=0x7f6e30d81110, tables_init=0x28d6a30, wild_num=1,
    conds_init=0x0, og_num=0, order_init=0x0, group_init=0x0, having_init=0x0,
    proc_param_init=0x0, select_lex_arg=0x7f6e30d80f28,
    unit_arg=0x7f6e30d80898) at sql_select.cc:817
#11 0x00000000007ad8cd in mysql_select (thd=0x7f6e30d7ef28,
    rref_pointer_array=0x7f6e30d81110, tables=0x28d6a30, wild_num=1,
    fields=@0x7f6e30d81030, conds=0x0, og_num=0, order=0x0, group=0x0,
    having=0x0, proc_param=0x0, select_options=3489942016, result=0x27b8070,
    unit=0x7f6e30d80898, select_lex=0x7f6e30d80f28) at sql_select.cc:3076
#12 0x00000000007b354f in handle_select (thd=0x7f6e30d7ef28,
    lex=0x7f6e30d807f8, result=0x27b8070, setup_tables_done_option=1073741824)
    at sql_select.cc:307
#13 0x000000000070d58a in mysql_execute_command (thd=0x7f6e30d7ef28)
    at sql_parse.cc:3313
#14 0x0000000000712b87 in mysql_parse (thd=0x7f6e30d7ef28,
    inBuf=0x28d61e0 "INSERT INTO testdb_N . t1_all_1_N SELECT * FROM test . table1_int_autoinc", length=73, found_semicolon=0x7f6e26298900)
parse.cc:5991
#15 0x00000000007137d2 in dispatch_command (command=COM_QUERY,
    thd=0x7f6e30d7ef28,
    packet=0x7f6e30dd5a49 " INSERT INTO testdb_N . t1_all_1_N SELECT * FROM test . table1_int_autoinc ", packet_length=75) at sql_parse.cc:1074
#16 0x0000000000714d3d in do_command (thd=0x7f6e30d7ef28) at sql_parse.cc:756
#17 0x0000000000701784 in handle_one_connection (arg=0x7f6e30d7ef28)
    at sql_connect.cc:1164
#18 0x00007f6e373c73ba in start_thread () from /lib/libpthread.so.0
#19 0x00007f6e36333fcd in clone () from /lib/libc.so.6
#20 0x0000000000000000 in ?? ()

The assert was found when running a RQG test with 30 threads
on an derivate of the grammar WL5004_sql.yy.

I will come up with a simplified testcase soon.

How to repeat:
See above
[10 Nov 2009 13:16] Matthias Leich
Any attempt to replay this bug like grammar simplification
was not successful. Therefor I set this bug to
"Can't repeat" but will restart attempts if I have the time.