Description:
Running the Random Query Generator with a grammar which works with views created with ALGORITHM=TEMPTABLE resulted in a crash when run against code implementing WL#5274 (Postpone materialization of views/subqueries in FROM clause.):
---- called from signal handler with signal 11 (SIGSEGV) ------
[8] heap_scan_init(info = (nil)), line 30 in "hp_scan.c"
[9] ha_heap::rnd_init(this = 0x65cd438, scan = true), line 372 in "ha_heap.cc"
[10] handler::ha_rnd_init(this = 0x65cd438, scan = true), line 1284 in "handler.h"
[11] subselect_uniquesubquery_engine::scan_table(this = 0x662b5f0), line 2049 in "item_subselect.cc"
[12] subselect_indexsubquery_engine::exec(this = 0x662b5f0), line 2346 in "item_subselect.cc"
[13] Item_subselect::exec(this = 0x65c7aa0), line 288 in "item_subselect.cc"
[14] Item_subselect::exec(this = 0x65c7aa0), line 293 in "item_subselect.cc"
[15] Item_in_subselect::val_bool(this = 0x65c7aa0), line 888 in "item_subselect.cc"
[16] Item::val_bool_result(this = 0x65c7aa0), line 849 in "item.h"
[17] Item_in_optimizer::val_int(this = 0x65de050), line 1833 in "item_cmpfunc.cc"
[18] Item::val_bool(this = 0x65de050), line 199 in "item.cc"
[19] Item_func_not::val_int(this = 0x65c7b98), line 289 in "item_cmpfunc.cc"
[20] Item::val_bool(this = 0x65c7b98), line 199 in "item.cc"
[21] Item_cond_and::val_int(this = 0x65eb3f8), line 4418 in "item_cmpfunc.cc"
[22] evaluate_join_record(join = 0x65e0980, join_tab = 0x65ea1d8, error = 0), line 11820 in "sql_select.cc"
[23] sub_select(join = 0x65e0980, join_tab = 0x65ea1d8, end_of_records = false), line 11771 in "sql_select.cc"
[24] do_select(join = 0x65e0980, fields = (nil), table = 0x660dbc0, procedure = (nil)), line 11523 in "sql_select.cc"
[25] JOIN::exec(this = 0x65e0980), line 1965 in "sql_select.cc"
[26] mysql_select(thd = 0x650ed60, rref_pointer_array = 0x6510e70, tables = 0x65c3ac0, wild_num = 0, fields = CLASS, conds = 0x65c8e00, og_num = 2U, order = 0x65c9328, group = (nil), having = 0x65c9088, proc_param = (nil), select_options = 2147748617ULL, result = 0x65ddbf0, unit = 0x6510670, select_lex = 0x6510ca0), line 2572 in "sql_select.cc"
[27] handle_select(thd = 0x650ed60, lex = 0x65105c8, result = 0x65ddbf0, setup_tables_done_option = 0), line 280 in "sql_select.cc"
[28] execute_sqlcom_select(thd = 0x650ed60, all_tables = 0x65c3ac0), line 4872 in "sql_parse.cc"
[29] mysql_execute_command(thd = 0x650ed60), line 2318 in "sql_parse.cc"
[30] mysql_parse(thd = 0x650ed60, inBuf = 0x6551a10 "SELECT DISTINCT SQL_SMALL_RESULT table1 . `pk` AS field1 \nFROM \n( \n( SELECT SUBQUERY1_t1 . * FROM \n( vBB_0 AS SUBQUERY1_t1 \nRIGHT OUTER JOIN C AS SUBQUERY1_t2 \nON (SUBQUERY1_t2 . `pk` = SUBQUERY1_t1 . `col_int_key` \nOR SUBQUERY1_t2 . `pk` <= ALL ( \nSELECT CHILD_SUBQUERY1_t1 . `col_int_key` AS CHILD_SUBQUERY1_field1 \nFROM CC AS CHILD_SUBQUERY1_t1 \nWHERE ( \nCHILD_SUBQUERY1_t1 . `pk` >= 4 \nOR CHILD_SUBQUERY1_t1 . `pk` != CHILD_SUBQUERY1_t1 . `col_int_key` \n)\n) \n) \n)\n) AS table1 \nSTRAIGHT_JOIN ( \n( D AS " ..., length = 1061U, parser_state = 0xfffffd7fff07da58), line 5902 in "sql_parse.cc"
[31] dispatch_command(command = COM_QUERY, thd = 0x650ed60, packet = 0x658d8b1 "SELECT DISTINCT SQL_SMALL_RESULT table1 . `pk` AS field1 \nFROM \n( \n( SELECT SUBQUERY1_t1 . * FROM \n( vBB_0 AS SUBQUERY1_t1 \nRIGHT OUTER JOIN C AS SUBQUERY1_t2 \nON (SUBQUERY1_t2 . `pk` = SUBQUERY1_t1 . `col_int_key` \nOR SUBQUERY1_t2 . `pk` <= ALL ( \nSELECT CHILD_SUBQUERY1_t1 . `col_int_key` AS CHILD_SUBQUERY1_field1 \nFROM CC AS CHILD_SUBQUERY1_t1 \nWHERE ( \nCHILD_SUBQUERY1_t1 . `pk` >= 4 \nOR CHILD_SUBQUERY1_t1 . `pk` != CHILD_SUBQUERY1_t1 . `col_int_key` \n)\n) \n) \n)\n) AS table1 \nSTRAIGHT_JOIN ( \n( D AS " ..., packet_length = 1061U), line 1135 in "sql_parse.cc"
[32] do_command(thd = 0x650ed60), line 807 in "sql_parse.cc"
[33] do_handle_one_connection(thd_arg = 0x650ed60), line 1191 in "sql_connect.cc"
[34] handle_one_connection(arg = 0x650ed60), line 1130 in "sql_connect.cc"
[35] pfs_spawn_thread(arg = 0x65a03d0), line 1015 in "pfs.cc"
[36] _thrp_setup(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7fff27acf5
[37] _lwp_start(0x0, 0x0, 0x0, 0x0, 0x0, 0x0), at 0xfffffd7fff27afb0
This issue is so far only observed with the implementation for WL#5274:
branch-nick: mysql-next-mr-wl5274
revision-id: epotemkin@mysql.com-20101028105959-s1n1cxq5iskoag3h
revno: 2986
How to repeat:
A reproducible test case will be provided later.