Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-30730

Assertion `marked_for_read()' failed in virtual bool Field_newdate::get_TIME(MYSQL_TIME*, const uchar*, date_mode_t) const

    XMLWordPrintable

Details

    Description

      This issue is similar to MDEV-19674, but the given test case crashes only on the Galera cluster.

      SET collation_server=utf8mb4_unicode_ci;
      SET GLOBAL wsrep_mode=disallow_local_gtid;
      SET SESSION wsrep_on=0;
      DROP DATABASE test;
      CREATE DATABASE test;
      USE test;
      CREATE TABLE t (c DATE,d DATE NOT NULL,cd TEXT AS (CONCAT (c,IF(c=d,DATE_FORMAT(d,''),''))));
      INSERT INTO t (c) VALUES (1);
      INSERT INTO t (c) VALUES (1);
      

      Leads to

      11.0.1 f2dc4d4c10ac36a73b5c1eb765352d3aee808d66 (Debug)

      mysqld: /test/11.0_dbg/sql/field.cc:6857: virtual bool Field_newdate::get_TIME(MYSQL_TIME*, const uchar*, date_mode_t) const: Assertion `marked_for_read()' failed.
      

      11.0.1 f2dc4d4c10ac36a73b5c1eb765352d3aee808d66 (Debug)

      Core was generated by `/test/GAL_MD200223-mariadb-11.0.1-linux-x86_64-dbg/bin/mysqld --defaults-file=/'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
          at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      [Current thread is 1 (Thread 0x1465aeeb0700 (LWP 472980))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:56
      #1  0x000055a96374b960 in my_write_core (sig=sig@entry=6) at /test/11.0_dbg/mysys/stacktrace.c:424
      #2  0x000055a9630471df in handle_fatal_signal (sig=6) at /test/11.0_dbg/sql/signal_handler.cc:357
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #5  0x00001465fce86859 in __GI_abort () at abort.c:79
      #6  0x00001465fce86729 in __assert_fail_base (fmt=0x1465fd01c588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55a963a9b130 "marked_for_read()", file=0x55a963a9afab "/test/11.0_dbg/sql/field.cc", line=6857, function=<optimized out>) at assert.c:92
      #7  0x00001465fce97fd6 in __GI___assert_fail (assertion=assertion@entry=0x55a963a9b130 "marked_for_read()", file=file@entry=0x55a963a9afab "/test/11.0_dbg/sql/field.cc", line=line@entry=6857, function=function@entry=0x55a963a9c9f8 "virtual bool Field_newdate::get_TIME(MYSQL_TIME*, const uchar*, date_mode_t) const") at assert.c:101
      #8  0x000055a96301b255 in Field_newdate::get_TIME (this=0x14657c11afc0, ltime=0x1465aeead850, pos=0x14657c11aeac "", fuzzydate={m_mode = date_mode_t::FRAC_TRUNCATE}) at /test/11.0_dbg/sql/field.cc:6857
      #9  0x000055a96303bda5 in Field_newdate::get_date (this=<optimized out>, ltime=<optimized out>, fuzzydate=<optimized out>) at /test/11.0_dbg/sql/field.h:3559
      #10 0x000055a963065ab6 in Item_field::get_date (this=this@entry=0x14657c112ae0, thd=thd@entry=0x14657c000d48, ltime=ltime@entry=0x1465aeead850, fuzzydate=<optimized out>) at /test/11.0_dbg/sql/field.h:1392
      #11 0x000055a9631881cf in Item_func_date_format::val_str (this=0x14657c112c80, str=0x1465aeead950) at /test/11.0_dbg/sql/sql_basic_types.h:81
      #12 0x000055a96306dcd7 in Item_func_conv_charset::Item_func_conv_charset (cache_if_const=true, cs=0x55a9642790c0 <my_charset_utf8mb4_unicode_ci>, a=0x14657c112c80, thd=0x14657c000d48, this=0x14657c113f30) at /test/11.0_dbg/sql/sql_string.h:224
      #13 Item::safe_charset_converter (this=0x14657c112c80, thd=0x14657c000d48, tocs=0x55a9642790c0 <my_charset_utf8mb4_unicode_ci>) at /test/11.0_dbg/sql/item.cc:1284
      #14 0x000055a963081b36 in Type_std_attributes::agg_item_set_converter (this=this@entry=0x14657c112df0, coll=@0x14657c112df8: {collation = 0x55a9642790c0 <my_charset_utf8mb4_unicode_ci>, derivation = DERIVATION_COERCIBLE, repertoire = MY_REPERTOIRE_ASCII}, fname=@0x1465aeeadaf0: {str = 0x55a96396d51a "if", length = 2}, args=args@entry=0x14657c112ea8, nargs=nargs@entry=2, flags=flags@entry=11, item_sep=1) at /test/11.0_dbg/sql/item.cc:2649
      #15 0x000055a962f73b97 in Type_std_attributes::agg_arg_charsets (item_sep=1, flags=11, nitems=2, items=0x14657c112ea8, func_name=@0x1465aeeadaf0: {str = 0x55a96396d51a "if", length = 2}, c=@0x14657c112df8: {collation = 0x55a9642790c0 <my_charset_utf8mb4_unicode_ci>, derivation = DERIVATION_COERCIBLE, repertoire = MY_REPERTOIRE_ASCII}, this=0x14657c112df0) at /test/11.0_dbg/sql/sql_type.h:3276
      #16 Type_std_attributes::agg_arg_charsets_for_string_result (item_sep=1, nitems=2, items=0x14657c112ea8, func_name=@0x1465aeeadaf0: {str = 0x55a96396d51a "if", length = 2}, c=@0x14657c112df8: {collation = 0x55a9642790c0 <my_charset_utf8mb4_unicode_ci>, derivation = DERIVATION_COERCIBLE, repertoire = MY_REPERTOIRE_ASCII}, this=0x14657c112df0) at /test/11.0_dbg/sql/sql_type.h:3291
      #17 Type_std_attributes::aggregate_attributes_string (this=this@entry=0x14657c112df0, func_name=@0x1465aeeadaf0: {str = 0x55a96396d51a "if", length = 2}, items=items@entry=0x14657c112ea8, nitems=nitems@entry=2) at /test/11.0_dbg/sql/sql_type.cc:1308
      #18 0x000055a962f73c28 in Type_handler_string_result::Item_hybrid_func_fix_attributes (this=this@entry=0x55a96430cd10 <type_handler_varchar>, thd=<optimized out>, func_name=@0x1465aeeadaf0: {str = 0x55a96396d51a "if", length = 2}, handler=handler@entry=0x14657c112e98, func=func@entry=0x14657c112de8, items=items@entry=0x14657c112ea8, nitems=2) at /test/11.0_dbg/sql/sql_type.cc:4644
      #19 0x000055a9630e10df in Item_hybrid_func::fix_attributes (this=this@entry=0x14657c112de8, items=items@entry=0x14657c112ea8, nitems=nitems@entry=2) at /test/11.0_dbg/sql/sql_type.h:7450
      #20 0x000055a9630aeabc in Item_func_case_abbreviation2::fix_length_and_dec2 (items=0x14657c112ea8, this=0x14657c112de8) at /test/11.0_dbg/sql/item_cmpfunc.h:1147
      #21 Item_func_case_abbreviation2::fix_length_and_dec2_eliminate_null (items=0x14657c112ea8, this=0x14657c112de8) at /test/11.0_dbg/sql/item_cmpfunc.h:1174
      #22 Item_func_if::fix_length_and_dec (this=0x14657c112de8, thd=<optimized out>) at /test/11.0_dbg/sql/item_cmpfunc.h:1293
      #23 0x000055a9630d365d in Item_func::fix_fields (this=this@entry=0x14657c112de8, thd=thd@entry=0x14657c000d48, ref=ref@entry=0x14657c112fc0) at /test/11.0_dbg/sql/item_func.cc:362
      #24 0x000055a9630947bc in Item_func_if::fix_fields (this=0x14657c112de8, thd=0x14657c000d48, ref=0x14657c112fc0) at /test/11.0_dbg/sql/item_cmpfunc.cc:2485
      #25 0x000055a9630d3638 in Item::fix_fields_if_needed (ref=0x14657c112fc0, thd=0x14657c000d48, this=<optimized out>) at /test/11.0_dbg/sql/item.h:1147
      #26 Item_func::fix_fields (this=this@entry=0x14657c112f38, thd=thd@entry=0x14657c000d48, ref=<optimized out>) at /test/11.0_dbg/sql/item_func.cc:350
      #27 0x000055a96311db84 in Item_str_func::fix_fields (this=0x14657c112f38, thd=0x14657c000d48, ref=<optimized out>) at /test/11.0_dbg/sql/item_strfunc.cc:127
      #28 0x000055a962e76d87 in Virtual_column_info::fix_expr (this=this@entry=0x14657c113008, thd=thd@entry=0x14657c000d48) at /test/11.0_dbg/sql/table.cc:3726
      #29 0x000055a962e76f00 in Virtual_column_info::fix_session_expr (this=0x14657c113008, thd=thd@entry=0x14657c000d48) at /test/11.0_dbg/sql/table.cc:3752
      #30 0x000055a962e7723a in TABLE::vcol_fix_expr (this=<optimized out>, thd=thd@entry=0x14657c000d48) at /test/11.0_dbg/sql/table.cc:3836
      #31 0x000055a962cd8c58 in open_table (thd=thd@entry=0x14657c000d48, table_list=table_list@entry=0x14657c013210, ot_ctx=ot_ctx@entry=0x1465aeeae9f0) at /test/11.0_dbg/sql/sql_base.cc:2313
      #32 0x000055a962cdd9b7 in open_and_process_table (ot_ctx=0x1465aeeae9f0, has_prelocking_list=false, prelocking_strategy=0x1465aeeaebe0, flags=0, counter=0x1465aeeaea8c, tables=0x14657c013210, thd=0x14657c000d48) at /test/11.0_dbg/sql/sql_base.cc:4108
      #33 open_tables (thd=thd@entry=0x14657c000d48, options=@0x14657c0064f8: {m_options = DDL_options_st::OPT_NONE}, start=start@entry=0x1465aeeaea78, counter=counter@entry=0x1465aeeaea8c, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x1465aeeaebe0) at /test/11.0_dbg/sql/sql_base.cc:4595
      #34 0x000055a962cde8e0 in open_and_lock_tables (thd=thd@entry=0x14657c000d48, options=<optimized out>, tables=<optimized out>, tables@entry=0x14657c013210, derived=derived@entry=true, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x1465aeeaebe0) at /test/11.0_dbg/sql/sql_base.cc:5570
      #35 0x000055a962d1fb17 in open_and_lock_tables (flags=0, derived=true, tables=0x14657c013210, thd=0x14657c000d48) at /test/11.0_dbg/sql/sql_base.h:510
      #36 mysql_insert (thd=thd@entry=0x14657c000d48, table_list=0x14657c013210, fields=@0x14657c005eb0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14657c013a58, last = 0x14657c013a58, elements = 1}, <No data fields>}, values_list=@0x14657c005ef8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14657c013fc8, last = 0x14657c013fc8, elements = 1}, <No data fields>}, update_fields=@0x14657c005ee0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55a9642e2440 <end_of_list>, last = 0x14657c005ee0, elements = 0}, <No data fields>}, update_values=@0x14657c005ec8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55a9642e2440 <end_of_list>, last = 0x14657c005ec8, elements = 0}, <No data fields>}, duplic=DUP_ERROR, ignore=false, result=0x0) at /test/11.0_dbg/sql/sql_insert.cc:767
      #37 0x000055a962d62fed in mysql_execute_command (thd=thd@entry=0x14657c000d48, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/11.0_dbg/sql/sql_parse.cc:4569
      #38 0x000055a962d4f5f6 in mysql_parse (thd=thd@entry=0x14657c000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1465aeeaf300) at /test/11.0_dbg/sql/sql_parse.cc:8002
      #39 0x000055a962d5cd11 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14657c000d48, packet=packet@entry=0x14657c00ae09 "INSERT INTO t (c) VALUES (1)", packet_length=packet_length@entry=28, blocking=blocking@entry=true) at /test/11.0_dbg/sql/sql_class.h:1370
      #40 0x000055a962d5f154 in do_command (thd=0x14657c000d48, blocking=blocking@entry=true) at /test/11.0_dbg/sql/sql_parse.cc:1407
      #41 0x000055a962ec349a in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55a966ff0238, put_in_cache=put_in_cache@entry=true) at /test/11.0_dbg/sql/sql_connect.cc:1416
      #42 0x000055a962ec396c in handle_one_connection (arg=0x55a966ff0238) at /test/11.0_dbg/sql/sql_connect.cc:1318
      #43 0x00001465fd397609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #44 0x00001465fcf83133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.6.12 (dbg),10.7.8 (dbg), 10.8.7 (dbg), 10.9.5 (dbg), 10.10.3 (dbg), 10.11.2 (dbg), 11.0.1 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.4.28 (opt), 10.4.28 (dbg), 10.5.19 (dbg), 10.5.19 (opt), 10.6.12 (opt), 10.7.8 (opt), 10.8.7 (opt), 10.9.5 (opt), 10.10.3 (opt), 10.11.2 (opt), 11.0.1 (opt)

      Attachments

        Issue Links

          Activity

            People

              janlindstrom Jan Lindström
              ramesh Ramesh Sivaraman
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.