Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.4(EOL), 10.5, 10.6, 10.11, 11.0(EOL), 11.1(EOL), 11.2(EOL), 11.3(EOL), 11.4, 11.5(EOL)
Description
_The assertion is similar to MDEV-31215 but the stack is different and the crash is reproduced on 10.5+ debug builds _
SET character_set_connection=ucs2; |
CREATE TABLE t1 (d1 date not null, d2 date, gd text as (concat(d1,if(d1 <> d2, date_format(d2, 'to %y-%m-%d '), ''))) ); |
--ERROR ER_NO_SUCH_TABLE
|
SELECT (SELECT 1 FROM foo) FROM t1; |
INSERT INTO t1 (d1) VALUES ('2009-07-02'); |
Leads to:
11.5.0 374783c3d9a87170b313a05240dadaa813ec6034 (Debug) |
mariadbd: /test/11.5_dbg/sql/field.cc:6866: virtual String* Field_newdate::val_str(String*, String*): Assertion `marked_for_read()' failed.
|
11.5.0 374783c3d9a87170b313a05240dadaa813ec6034 (Debug) |
Core was generated by `/test/MD210224-mariadb-11.5.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --max'.
|
Program terminated with signal SIGABRT, Aborted.
|
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
|
[Current thread is 1 (Thread 0x14d39c073700 (LWP 54683))]
|
(gdb) bt
|
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
|
#1 0x000014d39ecd9859 in __GI_abort () at abort.c:79
|
#2 0x000014d39ecd9729 in __assert_fail_base (fmt=0x14d39ee6f588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55aeb360b278 "marked_for_read()", file=0x55aeb360b0f3 "/test/11.5_dbg/sql/field.cc", line=6866, function=<optimized out>) at assert.c:92
|
#3 0x000014d39eceafd6 in __GI___assert_fail (assertion=assertion@entry=0x55aeb360b278 "marked_for_read()", file=file@entry=0x55aeb360b0f3 "/test/11.5_dbg/sql/field.cc", line=line@entry=6866, function=function@entry=0x55aeb360cbb8 "virtual String* Field_newdate::val_str(String*, String*)") at assert.c:101
|
#4 0x000055aeb2aaa0c8 in Field_newdate::val_str (this=0x14d34c034a88, val_buffer=0x14d39c070a60, val_ptr=<optimized out>) at /test/11.5_dbg/sql/field.cc:6866
|
#5 0x000055aeb2af680a in Item_field::val_str (this=0x14d34c0356f8, str=0x14d39c070a60) at /test/11.5_dbg/sql/item.cc:3342
|
#6 0x000055aeb2b00ee8 in Item_func_conv_charset::Item_func_conv_charset (cache_if_const=true, cs=0x55aeb3ec39a0 <my_charset_ucs2_general_ci>, a=0x14d34c0356f8, thd=0x14d34c000d48, this=0x14d34c036bd8) at /test/11.5_dbg/sql/sql_string.h:301
|
#7 Item::safe_charset_converter (this=0x14d34c0356f8, thd=0x14d34c000d48, tocs=0x55aeb3ec39a0 <my_charset_ucs2_general_ci>) at /test/11.5_dbg/sql/item.cc:1285
|
#8 0x000055aeb2b14ffe in Type_std_attributes::agg_item_set_converter (this=this@entry=0x14d34c036a28, coll=@0x14d34c036a30: {collation = 0x55aeb3ec39a0 <my_charset_ucs2_general_ci>, derivation = DERIVATION_COERCIBLE, repertoire = MY_REPERTOIRE_ASCII}, fname=@0x14d39c070b90: {str = 0x55aeb3629210 "concat", length = 6}, args=args@entry=0x14d34c036aa0, nargs=nargs@entry=2, flags=flags@entry=11, item_sep=1, single_err=0x0) at /test/11.5_dbg/sql/item.cc:2644
|
#9 0x000055aeb2bbb257 in Type_std_attributes::agg_arg_charsets (item_sep=1, flags=11, nitems=2, items=0x14d34c036aa0, func_name=@0x14d39c070b90: {str = 0x55aeb3629210 "concat", length = 6}, c=@0x14d34c036a30: {collation = 0x55aeb3ec39a0 <my_charset_ucs2_general_ci>, derivation = DERIVATION_COERCIBLE, repertoire = MY_REPERTOIRE_ASCII}, this=0x14d34c036a28) at /test/11.5_dbg/sql/sql_type.h:3350
|
#10 Type_std_attributes::agg_arg_charsets_for_string_result (item_sep=1, nitems=2, items=0x14d34c036aa0, func_name=@0x14d39c070b90: {str = 0x55aeb3629210 "concat", length = 6}, c=@0x14d34c036a30: {collation = 0x55aeb3ec39a0 <my_charset_ucs2_general_ci>, derivation = DERIVATION_COERCIBLE, repertoire = MY_REPERTOIRE_ASCII}, this=0x14d34c036a28) at /test/11.5_dbg/sql/sql_type.h:3365
|
#11 Item_func_or_sum::agg_arg_charsets_for_string_result (item_sep=1, nitems=2, items=0x14d34c036aa0, c=@0x14d34c036a30: {collation = 0x55aeb3ec39a0 <my_charset_ucs2_general_ci>, derivation = DERIVATION_COERCIBLE, repertoire = MY_REPERTOIRE_ASCII}, this=0x14d34c036a20) at /test/11.5_dbg/sql/item.h:5427
|
#12 Item_func_concat::fix_length_and_dec (this=0x14d34c036a20, thd=<optimized out>) at /test/11.5_dbg/sql/item_strfunc.cc:883
|
#13 0x000055aeb2b6a4d7 in Item_func::fix_fields (this=this@entry=0x14d34c036a20, thd=thd@entry=0x14d34c000d48, ref=<optimized out>) at /test/11.5_dbg/sql/item_func.cc:377
|
#14 0x000055aeb2bb50f4 in Item_str_func::fix_fields (this=0x14d34c036a20, thd=0x14d34c000d48, ref=<optimized out>) at /test/11.5_dbg/sql/item_strfunc.cc:132
|
#15 0x000055aeb28de449 in Virtual_column_info::fix_expr (this=this@entry=0x14d34c036af0, thd=thd@entry=0x14d34c000d48) at /test/11.5_dbg/sql/table.cc:3733
|
#16 0x000055aeb28de5c2 in Virtual_column_info::fix_session_expr (this=0x14d34c036af0, thd=thd@entry=0x14d34c000d48) at /test/11.5_dbg/sql/table.cc:3759
|
#17 0x000055aeb28de8fc in TABLE::vcol_fix_expr (this=<optimized out>, thd=thd@entry=0x14d34c000d48) at /test/11.5_dbg/sql/table.cc:3843
|
#18 0x000055aeb2725075 in open_table (thd=thd@entry=0x14d34c000d48, table_list=table_list@entry=0x14d34c018ef0, ot_ctx=ot_ctx@entry=0x14d39c071860) at /test/11.5_dbg/sql/sql_base.cc:2372
|
#19 0x000055aeb2729da3 in open_and_process_table (ot_ctx=0x14d39c071860, has_prelocking_list=false, prelocking_strategy=0x14d39c071a50, flags=0, counter=0x14d39c0718fc, tables=0x14d34c018ef0, thd=0x14d34c000d48) at /test/11.5_dbg/sql/sql_base.cc:4168
|
#20 open_tables (thd=thd@entry=0x14d34c000d48, options=@0x14d34c006758: {m_options = DDL_options_st::OPT_NONE}, start=start@entry=0x14d39c0718e8, counter=counter@entry=0x14d39c0718fc, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x14d39c071a50) at /test/11.5_dbg/sql/sql_base.cc:4654
|
#21 0x000055aeb272ad07 in open_and_lock_tables (thd=thd@entry=0x14d34c000d48, options=<optimized out>, tables=<optimized out>, tables@entry=0x14d34c018ef0, derived=derived@entry=true, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x14d39c071a50) at /test/11.5_dbg/sql/sql_base.cc:5628
|
#22 0x000055aeb277096b in open_and_lock_tables (flags=0, derived=true, tables=0x14d34c018ef0, thd=0x14d34c000d48) at /test/11.5_dbg/sql/sql_base.h:528
|
#23 mysql_insert (thd=thd@entry=0x14d34c000d48, table_list=0x14d34c018ef0, fields=@0x14d34c006110: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14d34c019730, last = 0x14d34c019730, elements = 1}, <No data fields>}, values_list=@0x14d34c006158: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14d34c019d60, last = 0x14d34c019d60, elements = 1}, <No data fields>}, update_fields=@0x14d34c006140: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55aeb3ef41e0 <end_of_list>, last = 0x14d34c006140, elements = 0}, <No data fields>}, update_values=@0x14d34c006128: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55aeb3ef41e0 <end_of_list>, last = 0x14d34c006128, elements = 0}, <No data fields>}, duplic=DUP_ERROR, ignore=false, result=0x0) at /test/11.5_dbg/sql/sql_insert.cc:772
|
#24 0x000055aeb27b579a in mysql_execute_command (thd=thd@entry=0x14d34c000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/11.5_dbg/sql/sql_parse.cc:4448
|
#25 0x000055aeb27a1550 in mysql_parse (thd=thd@entry=0x14d34c000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14d39c0722b0) at /test/11.5_dbg/sql/sql_parse.cc:7815
|
#26 0x000055aeb27af378 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14d34c000d48, packet=packet@entry=0x14d34c00b1c9 "INSERT INTO t1 (d1) VALUES ('2009-07-02 01:02:03')", packet_length=packet_length@entry=50, blocking=blocking@entry=true) at /test/11.5_dbg/sql/sql_class.h:1563
|
#27 0x000055aeb27b1c83 in do_command (thd=0x14d34c000d48, blocking=blocking@entry=true) at /test/11.5_dbg/sql/sql_parse.cc:1406
|
#28 0x000055aeb292e583 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55aeb59c8b58, put_in_cache=put_in_cache@entry=true) at /test/11.5_dbg/sql/sql_connect.cc:1437
|
#29 0x000055aeb292eb38 in handle_one_connection (arg=arg@entry=0x55aeb59c8b58) at /test/11.5_dbg/sql/sql_connect.cc:1339
|
#30 0x000055aeb2da5ee6 in pfs_spawn_thread (arg=0x55aeb5949028) at /test/11.5_dbg/storage/perfschema/pfs.cc:2201
|
#31 0x000014d39f1ea609 in start_thread (arg=<optimized out>) at pthread_create.c:477
|
#32 0x000014d39edd6133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
|
Bug confirmed present in:
MariaDB: 10.4.33 (dbg), 10.5.24 (dbg), 10.6.17 (dbg), 10.11.7 (dbg), 11.0.5 (dbg), 11.1.4 (dbg), 11.2.4 (dbg), 11.3.2 (dbg), 11.4.0 (dbg), 11.5.0 (dbg)
Bug (or feature/syntax) confirmed not present in:
MariaDB: 10.4.33 (opt), 10.5.24 (opt), 10.6.17 (opt), 10.11.7 (opt), 11.0.5 (opt), 11.1.4 (opt), 11.2.4 (opt), 11.3.2 (opt), 11.4.0 (opt), 11.5.0 (opt)
Attachments
Issue Links
- relates to
-
MDEV-34992 Assertion `marked_for_read()' failed in virtual my_time_t Field_timestamp0::get_timestamp(const uchar*, ulong*) const
-
- Open
-
Server crashes with a slightly different stack when executing the given test case
SET GLOBAL mysql56_temporal_format=0;
SET character_set_connection=utf32;
CREATE OR REPLACE TABLE t (c1 INT);
SET sql_mode='ORACLE';
SET STATEMENT max_statement_time=1 FOR LOCK TABLES t WRITE;
CREATE OR REPLACE TABLE t (c1 DATE NOT NULL,c2 DATE NOT NULL,c3 TEXT AS (CONCAT (c1,IF(c1=c2,DATE_FORMAT(c2,'to % y-%m -% d '),0))));
CREATE OR REPLACE TABLE t (c1 INT) ;
Leads to
10.5.27 d1dc70675c000fc5c6b38ce4456fd2faf56abaf0 (Debug)
mariadbd: /test/10.5_dbg/sql/field.cc:6968: virtual String* Field_datetime0::val_str(String*, String*): Assertion `marked_for_read()' failed.
10.5.27 d1dc70675c000fc5c6b38ce4456fd2faf56abaf0 (Debug)
Core was generated by `/test/MD040924-mariadb-10.5.27-linux-x86_64-dbg/bin/mariadbd --no-defaults --ma'.
Program terminated with signal SIGABRT, Aborted.
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
[Current thread is 1 (Thread 0x14f11c100700 (LWP 3583111))]
(gdb) bt
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x000014f125bf8859 in __GI_abort () at abort.c:79
#2 0x000014f125bf8729 in __assert_fail_base (fmt=0x14f125d8e588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55f65400bc90 "marked_for_read()", file=0x55f65400bb0b "/test/10.5_dbg/sql/field.cc", line=6968, function=<optimized out>) at assert.c:92
#3 0x000014f125c09fd6 in __GI___assert_fail (assertion=assertion@entry=0x55f65400bc90 "marked_for_read()", file=file@entry=0x55f65400bb0b "/test/10.5_dbg/sql/field.cc", line=line@entry=6968, function=function@entry=0x55f65400d698 "virtual String* Field_datetime0::val_str(String*, String*)") at assert.c:101
#4 0x000055f6533f5e6d in Field_datetime0::val_str (this=0x14f0d001e208, val_buffer=0x14f11c0fda10, val_ptr=<optimized out>) at /test/10.5_dbg/sql/field.cc:6968
#5 0x000055f653441f09 in Item_field::val_str (this=0x14f0d0022948, str=0x14f11c0fda10) at /test/10.5_dbg/sql/item.cc:3349
#6 0x000055f65344bb3b in Item_func_conv_charset::Item_func_conv_charset (cache_if_const=true, cs=0x55f65478c460 <my_charset_utf32_general_ci>, a=0x14f0d0022948, thd=0x14f0d0000d48, this=0x14f0d00766e0) at /test/10.5_dbg/sql/sql_string.h:476
#7 Item::safe_charset_converter (this=0x14f0d0022948, thd=0x14f0d0000d48, tocs=0x55f65478c460 <my_charset_utf32_general_ci>) at /test/10.5_dbg/sql/item.cc:1298
#8 0x000055f653460189 in Type_std_attributes::agg_item_set_converter (this=this@entry=0x14f0d00764f8, coll=@0x14f0d0076508: {collation = 0x55f65478c460 <my_charset_utf32_general_ci>, derivation = DERIVATION_COERCIBLE, repertoire = MY_REPERTOIRE_ASCII}, fname=fname@entry=0x55f654027749 "concat", args=args@entry=0x14f0d0076588, nargs=nargs@entry=2, flags=flags@entry=11, item_sep=1, single_err=0x0) at /test/10.5_dbg/sql/item.cc:2642
#9 0x000055f653510a47 in Type_std_attributes::agg_arg_charsets (item_sep=1, flags=11, nitems=2, items=0x14f0d0076588, func_name=0x55f654027749 "concat", c=@0x14f0d0076508: {collation = 0x55f65478c460 <my_charset_utf32_general_ci>, derivation = DERIVATION_COERCIBLE, repertoire = MY_REPERTOIRE_ASCII}, this=0x14f0d00764f8) at /test/10.5_dbg/sql/sql_type.h:3283
#10 Type_std_attributes::agg_arg_charsets_for_string_result (item_sep=1, nitems=2, items=0x14f0d0076588, func_name=0x55f654027749 "concat", c=@0x14f0d0076508: {collation = 0x55f65478c460 <my_charset_utf32_general_ci>, derivation = DERIVATION_COERCIBLE, repertoire = MY_REPERTOIRE_ASCII}, this=0x14f0d00764f8) at /test/10.5_dbg/sql/sql_type.h:3297
#11 Item_func_or_sum::agg_arg_charsets_for_string_result (item_sep=1, nitems=2, items=0x14f0d0076588, c=@0x14f0d0076508: {collation = 0x55f65478c460 <my_charset_utf32_general_ci>, derivation = DERIVATION_COERCIBLE, repertoire = MY_REPERTOIRE_ASCII}, this=0x14f0d00764f0) at /test/10.5_dbg/sql/item.h:5356
#12 Item_func_concat::fix_length_and_dec (this=0x14f0d00764f0) at /test/10.5_dbg/sql/item_strfunc.cc:701
#13 0x000055f6534b8907 in Item_func::fix_fields (this=this@entry=0x14f0d00764f0, thd=thd@entry=0x14f0d0000d48, ref=<optimized out>) at /test/10.5_dbg/sql/item_func.cc:389
#14 0x000055f65350a2cc in Item_str_func::fix_fields (this=0x14f0d00764f0, thd=0x14f0d0000d48, ref=<optimized out>) at /test/10.5_dbg/sql/item_strfunc.cc:122
#15 0x000055f65325a563 in Virtual_column_info::fix_expr (this=this@entry=0x14f0d00765d8, thd=thd@entry=0x14f0d0000d48) at /test/10.5_dbg/sql/table.cc:3506
#16 0x000055f65325a6e0 in Virtual_column_info::fix_session_expr (this=0x14f0d00765d8, thd=thd@entry=0x14f0d0000d48) at /test/10.5_dbg/sql/table.cc:3532
#17 0x000055f65325aa23 in TABLE::vcol_fix_expr (this=<optimized out>, thd=thd@entry=0x14f0d0000d48) at /test/10.5_dbg/sql/table.cc:3618
#18 0x000055f6530d41bd in open_table (thd=thd@entry=0x14f0d0000d48, table_list=table_list@entry=0x14f0d0012ec8, ot_ctx=ot_ctx@entry=0x14f11c0fe830) at /test/10.5_dbg/sql/sql_base.cc:2150
#19 0x000055f6530d8768 in open_and_process_table (ot_ctx=0x14f11c0fe830, has_prelocking_list=false, prelocking_strategy=0x14f11c0fe928, flags=0, counter=0x14f11c0fe8cc, tables=0x14f0d0012ec8, thd=0x14f0d0000d48) at /test/10.5_dbg/sql/sql_base.cc:3819
#20 open_tables (thd=thd@entry=0x14f0d0000d48, options=@0x14f11c0fecc0: {m_options = DDL_options_st::OPT_OR_REPLACE}, start=start@entry=0x14f11c0fe8b8, counter=counter@entry=0x14f11c0fe8cc, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x14f11c0fe928) at /test/10.5_dbg/sql/sql_base.cc:4303
#21 0x000055f6530d98ff in open_and_lock_tables (thd=thd@entry=0x14f0d0000d48, options=@0x14f11c0fecc0: {m_options = DDL_options_st::OPT_OR_REPLACE}, tables=<optimized out>, tables@entry=0x14f0d0012ec8, derived=derived@entry=false, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x14f11c0fe928) at /test/10.5_dbg/sql/sql_base.cc:5250
#22 0x000055f65322aa9e in open_and_lock_tables (flags=0, derived=false, tables=0x14f0d0012ec8, options=@0x14f11c0fecc0: {m_options = DDL_options_st::OPT_OR_REPLACE}, thd=0x14f0d0000d48) at /test/10.5_dbg/sql/sql_base.h:501
#23 mysql_create_table (thd=thd@entry=0x14f0d0000d48, create_table=create_table@entry=0x14f0d0012ec8, create_info=create_info@entry=0x14f11c0feab0, alter_info=alter_info@entry=0x14f11c0fe9c0) at /test/10.5_dbg/sql/sql_table.cc:5666
#24 0x000055f65322c637 in Sql_cmd_create_table_like::execute (this=<optimized out>, thd=0x14f0d0000d48) at /test/10.5_dbg/sql/sql_table.cc:12577
#25 0x000055f653163b81 in mysql_execute_command (thd=thd@entry=0x14f0d0000d48) at /test/10.5_dbg/sql/sql_parse.cc:6180
#26 0x000055f65314a418 in mysql_parse (thd=thd@entry=0x14f0d0000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14f11c0ff2c0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_parse.cc:8236
#27 0x000055f65315915d in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14f0d0000d48, packet=packet@entry=0x14f0d000aa19 "CREATE OR REPLACE TABLE t (c1 INT)", packet_length=packet_length@entry=34, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.5_dbg/sql/sql_class.h:1329
#28 0x000055f65315be96 in do_command (thd=0x14f0d0000d48) at /test/10.5_dbg/sql/sql_parse.cc:1376
#29 0x000055f6532a9254 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55f657b3f988, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1417
#30 0x000055f6532a98f2 in handle_one_connection (arg=arg@entry=0x55f657b3f988) at /test/10.5_dbg/sql/sql_connect.cc:1319
#31 0x000055f65372aaa9 in pfs_spawn_thread (arg=0x55f657007668) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
#32 0x000014f126109609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#33 0x000014f125cf5133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95