Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5
Description
CREATE TABLE t1 (k1 varchar(10) DEFAULT 5); |
CREATE TABLE t2 (i1 int); |
|
ALTER TABLE t1 ALTER COLUMN k1 SET DEFAULT (SELECT 1 FROM t2 limit 1); |
10.2 0c20b247de0c1cc7f993e1eba6 |
#3 <signal handler called>
|
#4 0x00007f3aea115428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
|
#5 0x00007f3aea11702a in __GI_abort () at abort.c:89
|
#6 0x00007f3aea10dbd7 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x558024fcdfe0 "table_share->tmp_table != NO_TMP_TABLE || m_lock_type != 2", file=file@entry=0x558024fcd078 "/git/10.2/sql/handler.cc", line=line@entry=2576, function=function@entry=0x558024fcf620 <handler::ha_rnd_next(unsigned char*)::__PRETTY_FUNCTION__> "int handler::ha_rnd_next(uchar*)") at assert.c:92
|
#7 0x00007f3aea10dc82 in __GI___assert_fail (assertion=0x558024fcdfe0 "table_share->tmp_table != NO_TMP_TABLE || m_lock_type != 2", file=0x558024fcd078 "/git/10.2/sql/handler.cc", line=2576, function=0x558024fcf620 <handler::ha_rnd_next(unsigned char*)::__PRETTY_FUNCTION__> "int handler::ha_rnd_next(uchar*)") at assert.c:101
|
#8 0x00005580246ebec5 in handler::ha_rnd_next (this=0x7f3a9408cd38, buf=0x7f3a9408c8e0 "\377") at /git/10.2/sql/handler.cc:2575
|
#9 0x00005580246ed734 in handler::read_first_row (this=0x7f3a9408cd38, buf=0x7f3a9408c8e0 "\377", primary_key=64) at /git/10.2/sql/handler.cc:2815
|
#10 0x00005580244f62fd in handler::ha_read_first_row (this=0x7f3a9408cd38, buf=0x7f3a9408c8e0 "\377", primary_key=64) at /git/10.2/sql/sql_class.h:5829
|
#11 0x00005580244de453 in join_read_system (tab=0x7f3a94015320) at /git/10.2/sql/sql_select.cc:19296
|
#12 0x00005580244de010 in join_read_const_table (thd=0x7f3a94000b00, tab=0x7f3a94015320, pos=0x7f3a940158d8) at /git/10.2/sql/sql_select.cc:19192
|
#13 0x00005580244b8a8e in make_join_statistics (join=0x7f3a94014b10, tables_list=..., keyuse_array=0x7f3a94014e00) at /git/10.2/sql/sql_select.cc:4144
|
#14 0x00005580244afeb6 in JOIN::optimize_inner (this=0x7f3a94014b10) at /git/10.2/sql/sql_select.cc:1582
|
#15 0x00005580244ae3a9 in JOIN::optimize (this=0x7f3a94014b10) at /git/10.2/sql/sql_select.cc:1115
|
#16 0x00005580247b5792 in subselect_single_select_engine::exec (this=0x7f3a94013fe8) at /git/10.2/sql/item_subselect.cc:3811
|
#17 0x00005580247aab8f in Item_subselect::exec (this=0x7f3a94013e68) at /git/10.2/sql/item_subselect.cc:722
|
#18 0x00005580247ac8a3 in Item_singlerow_subselect::val_int (this=0x7f3a94013e68) at /git/10.2/sql/item_subselect.cc:1329
|
#19 0x000055802470b6ce in Item::save_in_field (this=0x7f3a94013e68, field=0x7f3a94014a30, no_conversions=true) at /git/10.2/sql/item.cc:6394
|
#20 0x000055802458c9f0 in make_empty_rec (thd=0x7f3a94000b00, buff=0x7f3a94090626 "\001", table_options=9, create_fields=..., reclength=12, data_offset=1) at /git/10.2/sql/unireg.cc:998
|
#21 0x000055802458a125 in build_frm_image (thd=0x7f3a94000b00, table=0x7f3a94012548 "t1", create_info=0x7f3adc112cd0, create_fields=..., keys=0, key_info=0x7f3a94014a18, db_file=0x7f3a94014338) at /git/10.2/sql/unireg.cc:308
|
#22 0x0000558024536eb7 in mysql_create_frm_image (thd=0x7f3a94000b00, db=0x7f3a94012b90 "test", table_name=0x7f3a94012548 "t1", create_info=0x7f3adc112cd0, alter_info=0x7f3adc112c20, create_table_mode=-2, key_info=0x7f3adc1113d8, key_count=0x7f3adc1113a8, frm=0x7f3adc111440) at /git/10.2/sql/sql_table.cc:4658
|
#23 0x00005580245378be in create_table_impl (thd=0x7f3a94000b00, orig_db=0x7f3a94012b90 "test", orig_table_name=0x7f3a94012548 "t1", db=0x7f3a94012b90 "test", table_name=0x7f3adc112100 "#sql-2ad7_9", path=0x7f3adc11296c "./test/#sql-2ad7_9", options=..., create_info=0x7f3adc112cd0, alter_info=0x7f3adc112c20, create_table_mode=-2, is_trans=0x0, key_info=0x7f3adc1113d8, key_count=0x7f3adc1113a8, frm=0x7f3adc111440) at /git/10.2/sql/sql_table.cc:4898
|
#24 0x0000558024542fc7 in mysql_alter_table (thd=0x7f3a94000b00, new_db=0x7f3a94012b90 "test", new_name=0x0, create_info=0x7f3adc112cd0, table_list=0x7f3a94012580, alter_info=0x7f3adc112c20, order_num=0, order=0x0, ignore=false) at /git/10.2/sql/sql_table.cc:9238
|
#25 0x00005580245be7a4 in Sql_cmd_alter_table::execute (this=0x7f3a94014078, thd=0x7f3a94000b00) at /git/10.2/sql/sql_alter.cc:329
|
#26 0x0000558024475d98 in mysql_execute_command (thd=0x7f3a94000b00) at /git/10.2/sql/sql_parse.cc:6228
|
#27 0x000055802447ae9f in mysql_parse (thd=0x7f3a94000b00, rawbuf=0x7f3a94012448 "ALTER TABLE t1 ALTER COLUMN k1 SET DEFAULT (SELECT 1 FROM t2 limit 1)", length=69, parser_state=0x7f3adc114080, is_com_multi=false, is_next_command=false) at /git/10.2/sql/sql_parse.cc:8015
|
#28 0x00005580244684f0 in dispatch_command (command=COM_QUERY, thd=0x7f3a94000b00, packet=0x7f3a94095e21 "ALTER TABLE t1 ALTER COLUMN k1 SET DEFAULT (SELECT 1 FROM t2 limit 1)", packet_length=69, is_com_multi=false, is_next_command=false) at /git/10.2/sql/sql_parse.cc:1826
|
#29 0x0000558024466e40 in do_command (thd=0x7f3a94000b00) at /git/10.2/sql/sql_parse.cc:1379
|
#30 0x00005580245b947c in do_handle_one_connection (connect=0x558026b7af40) at /git/10.2/sql/sql_connect.cc:1335
|
#31 0x00005580245b91fc in handle_one_connection (arg=0x558026b7af40) at /git/10.2/sql/sql_connect.cc:1241
|
#32 0x0000558024de7066 in pfs_spawn_thread (arg=0x558026ac1630) at /git/10.2/storage/perfschema/pfs.cc:1862
|
#33 0x00007f3aead526ba in start_thread (arg=0x7f3adc115700) at pthread_create.c:333
|
#34 0x00007f3aea1e741d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
|
Attachments
Issue Links
- relates to
-
MDEV-7034 Assertion `table_share->tmp_table != NO_TMP_TABLE || m_lock_type != 2' failed in handler::ha_rnd_next on EXPLAIN INSERT .. SELECT
-
- Closed
-
-
MDEV-19569 Assertion `table_list->table' failed in find_field_in_table_ref and Assertion `table_ref->table || table_ref->view' in Field_iterator_table_ref::set_field_iterator
-
- Closed
-
-
MDEV-23159 Assertion `table_share->tmp_table != NO_TMP_TABLE || m_lock_type != 2' + SIGSEGV in trnman_can_read_from (on optimized builds)
-
- Closed
-
-
MDEV-19336 Assertion `expr == default_value->expr' failed in make_empty_rec_store_default / ERROR 1901 (on optimized builds)
-
- Closed
-
-
MDEV-28506 SIGSEGV's in find_field_in_table[s][_ref], Item_field::fix_fields, create_view_field and MemcmpInterceptorCommon | Assertions `(*select_ref)->fixed' or '->is_fixed' and `table_list->table' failed
-
- Stalled
-
-
MDEV-36176 Assertion `table_share->tmp_table != NO_TMP_TABLE || m_lock_type != 2' failed in handler::ha_rnd_next on SELECT
-
- Open
-
/git/10.2/sql/sql_base.cc:5661: Field* find_field_in_table_ref(THD*, TABLE_LIST*, const char*, uint, const char*, const char*, const char*, Item**, bool, bool, uint*, bool, TABLE_LIST**): Assertion `table_list->table' failed.
#7 0x00007fbcc28efc82 in __GI___assert_fail (assertion=0x55720b77d68d "table_list->table", file=0x55720b77ca20 "/git/10.2/sql/sql_base.cc", line=5661, function=0x55720b77f280 <find_field_in_table_ref(THD*, TABLE_LIST*, char const*, unsigned int, char const*, char const*, char const*, Item**, bool, bool, unsigned int*, bool, TABLE_LIST**)::__PRETTY_FUNCTION__> "Field* find_field_in_table_ref(THD*, TABLE_LIST*, const char*, uint, const char*, const char*, const char*, Item**, bool, bool, uint*, bool, TABLE_LIST**)") at assert.c:101
#8 0x000055720ac85a34 in find_field_in_table_ref (thd=0x7fbc70000b00, table_list=0x7fbc70034498, name=0x7fbc70091e58 "i1", length=2, item_name=0x7fbc70091e58 "i1", db_name=0x0, table_name=0x0, ref=0x7fbc70091f60, check_privileges=true, allow_rowid=true, cached_field_index_ptr=0x7fbc70091f24, register_tree_change=true, actual_table=0x7fbcb46f68a8) at /git/10.2/sql/sql_base.cc:5661
#9 0x000055720ac86592 in find_field_in_tables (thd=0x7fbc70000b00, item=0x7fbc70091e60, first_table=0x7fbc70034498, last_table=0x0, ref=0x7fbc70091f60, report_error=REPORT_ALL_ERRORS, check_privileges=true, register_tree_change=true) at /git/10.2/sql/sql_base.cc:5961
#10 0x000055720af8cc6f in Item_field::fix_fields (this=0x7fbc70091e60, thd=0x7fbc70000b00, reference=0x7fbc70091f60) at /git/10.2/sql/item.cc:5429
#11 0x000055720ac89330 in setup_fields (thd=0x7fbc70000b00, ref_pointer_array=..., fields=..., mark_used_columns=MARK_COLUMNS_READ, sum_func_list=0x7fbc70035818, pre_fix=0x7fbc70092ff8, allow_sum_func=true) at /git/10.2/sql/sql_base.cc:7160
#12 0x000055720ad30edb in JOIN::prepare (this=0x7fbc700354f8, tables_init=0x7fbc70034498, wild_num=0, conds_init=0x7fbc70034cc8, og_num=0, order_init=0x0, skip_order_by=false, group_init=0x0, having_init=0x0, proc_param_init=0x0, select_lex_arg=0x7fbc70092eb8, unit_arg=0x7fbc70093338) at /git/10.2/sql/sql_select.cc:814
#13 0x000055720b0391b0 in subselect_single_select_engine::prepare (this=0x7fbc70035018, thd=0x7fbc70000b00) at /git/10.2/sql/item_subselect.cc:3675
#14 0x000055720b02dae8 in Item_subselect::fix_fields (this=0x7fbc70034ec0, thd_param=0x7fbc70000b00, ref=0x7fbc70035068) at /git/10.2/sql/item_subselect.cc:269
#15 0x000055720adf4d7d in fix_vcol_expr (thd=0x7fbc70000b00, vcol=0x7fbc70035058) at /git/10.2/sql/table.cc:2752
#16 0x000055720adf517a in fix_and_check_vcol_expr (thd=0x7fbc70000b00, table=0x7fbc70091020, vcol=0x7fbc70035058) at /git/10.2/sql/table.cc:2837
#17 0x000055720adf55d9 in unpack_vcol_info_from_frm (thd=0x7fbc70000b00, mem_root=0x7fbc70091ad8, table=0x7fbc70091020, expr_str=0x7fbcb46f8da0, vcol_ptr=0x7fbc70091d18, error_reported=0x7fbcb46f9121) at /git/10.2/sql/table.cc:2956
#18 0x000055720adeed9a in parse_vcol_defs (thd=0x7fbc70000b00, mem_root=0x7fbc70091ad8, table=0x7fbc70091020, error_reported=0x7fbcb46f9121) at /git/10.2/sql/table.cc:1076
#19 0x000055720adf6313 in open_table_from_share (thd=0x7fbc70000b00, share=0x7fbc7008fe60, alias=0x7fbcb46fa100 "#sql-1ab6_9", db_stat=0, prgflag=8, ha_open_flags=16, outparam=0x7fbc70091020, is_create_table=true) at /git/10.2/sql/table.cc:3202
#20 0x000055720aee862c in THD::open_temporary_table (this=0x7fbc70000b00, share=0x7fbc7008fe60, alias=0x7fbcb46fa100 "#sql-1ab6_9", open_in_engine=false) at /git/10.2/sql/temporary_tables.cc:1091
#21 0x000055720aee660c in THD::create_and_open_tmp_table (this=0x7fbc70000b00, hton=0x55720e9e1460, frm=0x7fbcb46f9440, path=0x7fbcb46fa96c "./test/#sql-1ab6_9", db=0x7fbc70012bb0 "test", table_name=0x7fbcb46fa100 "#sql-1ab6_9", open_in_engine=false) at /git/10.2/sql/temporary_tables.cc:76
#22 0x000055720adc71d0 in mysql_alter_table (thd=0x7fbc70000b00, new_db=0x7fbc70012bb0 "test", new_name=0x0, create_info=0x7fbcb46facd0, table_list=0x7fbc700125a0, alter_info=0x7fbcb46fac20, order_num=0, order=0x0, ignore=false) at /git/10.2/sql/sql_table.cc:9295
#23 0x000055720ae427a4 in Sql_cmd_alter_table::execute (this=0x7fbc70014400, thd=0x7fbc70000b00) at /git/10.2/sql/sql_alter.cc:329
#24 0x000055720acf9d98 in mysql_execute_command (thd=0x7fbc70000b00) at /git/10.2/sql/sql_parse.cc:6228
#25 0x000055720acfee9f in mysql_parse (thd=0x7fbc70000b00, rawbuf=0x7fbc70012448 "ALTER TABLE t1 ALTER COLUMN k1 SET DEFAULT (SELECT i1 FROM t2 WHERE i1 = 4 limit 1)", length=83, parser_state=0x7fbcb46fc080, is_com_multi=false, is_next_command=false) at /git/10.2/sql/sql_parse.cc:8015
#26 0x000055720acec4f0 in dispatch_command (command=COM_QUERY, thd=0x7fbc70000b00, packet=0x7fbc70095e21 "ALTER TABLE t1 ALTER COLUMN k1 SET DEFAULT (SELECT i1 FROM t2 WHERE i1 = 4 limit 1) ", packet_length=84, is_com_multi=false, is_next_command=false) at /git/10.2/sql/sql_parse.cc:1826
#27 0x000055720aceae40 in do_command (thd=0x7fbc70000b00) at /git/10.2/sql/sql_parse.cc:1379
#28 0x000055720ae3d47c in do_handle_one_connection (connect=0x55720eff6f40) at /git/10.2/sql/sql_connect.cc:1335
#29 0x000055720ae3d1fc in handle_one_connection (arg=0x55720eff6f40) at /git/10.2/sql/sql_connect.cc:1241
#30 0x000055720b66b066 in pfs_spawn_thread (arg=0x55720ef3d630) at /git/10.2/storage/perfschema/pfs.cc:1862
#31 0x00007fbcc35346ba in start_thread (arg=0x7fbcb46fd700) at pthread_create.c:333
#32 0x00007fbcc29c941d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
on non-debug build:
CREATE TABLE t1 ( c1 text);
ALTER TABLE t1 ALTER COLUMN c1 SET DEFAULT (with cte as (select 2) select * from cte);
10.4 ca7fbcea6c4fe13c295
Version: '10.4.5-MariaDB-log'
190425 16:30:12 [ERROR] mysqld got signal 11 ;
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7fbf6bf3a390]
sql/sql_base.cc:5912(find_field_in_table(THD*, TABLE*, char const*, unsigned long, bool, unsigned int*))[0x55f08b9bd75c]
sql/sql_base.cc:6070(find_field_in_table_ref(THD*, TABLE_LIST*, char const*, unsigned long, char const*, char const*, char const*, Item**, bool, bool, unsigned int*, bool, TABLE_LIST**))[0x55f08b755b70]
sql/sql_base.cc:6372(find_field_in_tables(THD*, Item_ident*, TABLE_LIST*, TABLE_LIST*, Item**, find_item_error_report_type, bool, bool))[0x55f08b7f226b]
sql/item.cc:5675(Item_field::fix_fields(THD*, Item**))[0x55f08ba3727d]
sql/item.h:961(Item::fix_fields_if_needed_for_scalar(THD*, Item**))[0x55f08b850a52]
sql/sql_select.cc:1198(JOIN::prepare(TABLE_LIST*, unsigned int, Item*, unsigned int, st_order*, bool, st_order*, Item*, st_order*, st_select_lex*, st_select_lex_unit*))[0x55f08b850f83]
sql/item_subselect.cc:3705(subselect_single_select_engine::prepare(THD*))[0x55f08b857366]
sql/item_subselect.cc:282(Item_subselect::fix_fields(THD*, Item**))[0x55f08b85c681]
sql/table.cc:3199(fix_vcol_expr(THD*, Virtual_column_info*) [clone .constprop.314])[0x55f08b83762f]
sql/table.cc:3280(fix_and_check_vcol_expr)[0x55f08b888af2]
sql/table.cc:1157(parse_vcol_defs(THD*, st_mem_root*, TABLE*, bool*))[0x55f08b7abe4e]
sql/table.cc:3763(open_table_from_share(THD*, TABLE_SHARE*, st_mysql_const_lex_string const*, unsigned int, unsigned int, unsigned int, TABLE*, bool, List<String>*))[0x55f08b7b3ab9]
sql/sql_table.cc:9190(create_table_for_inplace_alter)[0x55f08b7b5d56]
sql/sql_alter.cc:496(Sql_cmd_alter_table::execute(THD*))[0x55f08b7b7389]
sql/sql_parse.cc:6344(mysql_execute_command(THD*))[0x55f08b884754]
sql/sql_parse.cc:8154(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x55f08b884874]
sql/sql_parse.cc:1896(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x55f08be1b8b4]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7fbf6bf306ba]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x6d)[0x7fbf6b1c141d]
Query (0x7fbf1c011f60): ALTER TABLE t1 ALTER COLUMN c1 SET DEFAULT (with cte as (select 2) select * from cte)