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

Assertion `marked_for_read()' failed in VSec9::VSec9 | Item_func_from_unixtime::get_date

    XMLWordPrintable

Details

    Description

      The assertion is similar to MDEV-35310, but the stack is slightly different, and the problem is not present in 11.x debug builds

      CREATE TABLE t (a INT,b TIMESTAMP DEFAULT FROM_UNIXTIME(a));
      INSERT INTO t VALUES (1,NOW());
      EXECUTE IMMEDIATE 'UPDATE t SET b=?' USING DEFAULT;
      

      Leads to:

      CS 10.5.27 d64034770ef4e15c7f3599a57a2b060a042b10b6 (Debug)

      mariadbd: /test/10.5_dbg/sql/field.cc:4426: virtual longlong Field_long::val_int(): Assertion `marked_for_read()' failed.
      

      CS 10.5.27 d64034770ef4e15c7f3599a57a2b060a042b10b6 (Debug)

      Core was generated by `/test/MD291024-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 0x149d85376700 (LWP 2367469))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x0000149da8a88859 in __GI_abort () at abort.c:79
      #2  0x0000149da8a88729 in __assert_fail_base (fmt=0x149da8c1e588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x560db1807138 "marked_for_read()", file=0x560db1806fb3 "/test/10.5_dbg/sql/field.cc", line=4426, function=<optimized out>) at assert.c:92
      #3  0x0000149da8a99fd6 in __GI___assert_fail (assertion=assertion@entry=0x560db1807138 "marked_for_read()", file=file@entry=0x560db1806fb3 "/test/10.5_dbg/sql/field.cc", line=line@entry=4426, function=function@entry=0x560db18084e8 "virtual longlong Field_long::val_int()") at assert.c:101
      #4  0x0000560db0beead2 in Field_long::val_int (this=0x149d5401d6c0) at /test/10.5_dbg/sql/field.cc:4426
      #5  0x0000560db0c3c983 in Item_field::val_int (this=0x149d5401c340) at /test/10.5_dbg/sql/item.cc:3367
      #6  0x0000560db0b48ac1 in VSec9::VSec9 (this=0x149d85373d00, thd=0x149d54000d48, item=0x149d5401c340, type_str=0x560db182914f "unixtime", limit=2147483647) at /test/10.5_dbg/sql/sql_type.cc:541
      #7  0x0000560db0d5b392 in Item_func_from_unixtime::get_date (this=this@entry=0x149d5401c480, thd=thd@entry=0x149d54000d48, ltime=ltime@entry=0x149d85373d80, fuzzydate=<optimized out>) at /test/10.5_dbg/sql/item_timefunc.cc:1958
      #8  0x0000560db0c45fe3 in Item::save_date_in_field (this=0x149d5401c480, field=0x149d5401d798, no_conversions=<optimized out>) at /test/10.5_dbg/sql/sql_basic_types.h:81
      #9  0x0000560db0b36fc4 in Type_handler_temporal_with_date::Item_save_in_field (this=<optimized out>, item=<optimized out>, field=<optimized out>, no_conversions=<optimized out>) at /test/10.5_dbg/sql/sql_type.cc:4328
      #10 0x0000560db0c39b3b in Item::save_in_field (this=0x149d5401c480, field=0x149d5401d798, no_conversions=<optimized out>) at /test/10.5_dbg/sql/item.cc:6937
      #11 0x0000560db0be78af in Field::set_default (this=0x149d5401d798) at /test/10.5_dbg/sql/field.cc:2597
      #12 0x0000560db0c0aa01 in Field::save_in_field_default_value (this=this@entry=0x149d5401d798, view_error_processing=<optimized out>) at /test/10.5_dbg/sql/field.cc:11369
      #13 0x0000560db0c524cd in Item_param::save_in_field (this=0x149d54068830, field=0x149d5401d798, no_conversions=<optimized out>) at /test/10.5_dbg/sql/table.h:2815
      #14 0x0000560db08d76dd in fill_record (thd=thd@entry=0x149d54000d48, table_arg=table_arg@entry=0x149d54020828, fields=@0x149d54066d58: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x149d54068a00, last = 0x149d54068a00, elements = 1}, <No data fields>}, values=@0x149d54067318: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x149d54068a10, last = 0x149d54068a10, elements = 1}, <No data fields>}, ignore_errors=ignore_errors@entry=false, update=update@entry=true) at /test/10.5_dbg/sql/sql_base.cc:8604
      #15 0x0000560db08d7888 in fill_record_n_invoke_before_triggers (thd=thd@entry=0x149d54000d48, table=table@entry=0x149d54020828, fields=@0x149d54066d58: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x149d54068a00, last = 0x149d54068a00, elements = 1}, <No data fields>}, values=@0x149d54067318: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x149d54068a10, last = 0x149d54068a10, elements = 1}, <No data fields>}, ignore_errors=ignore_errors@entry=false, event=event@entry=TRG_EVENT_UPDATE) at /test/10.5_dbg/sql/sql_base.cc:8782
      #16 0x0000560db0a49f84 in mysql_update (thd=thd@entry=0x149d54000d48, table_list=<optimized out>, fields=@0x149d54066d58: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x149d54068a00, last = 0x149d54068a00, elements = 1}, <No data fields>}, values=@0x149d54067318: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x149d54068a10, last = 0x149d54068a10, elements = 1}, <No data fields>}, conds=<optimized out>, order_num=<optimized out>, order=<optimized out>, limit=18446744073709551615, ignore=<optimized out>, found_return=<optimized out>, updated_return=<optimized out>) at /test/10.5_dbg/sql/sql_update.cc:1040
      #17 0x0000560db0959113 in mysql_execute_command (thd=0x149d54000d48) at /test/10.5_dbg/sql/sql_limit.h:78
      #18 0x0000560db0970314 in Prepared_statement::execute (this=this@entry=0x149d54065ee8, expanded_query=expanded_query@entry=0x149d85374b00, open_cursor=open_cursor@entry=false) at /test/10.5_dbg/sql/sql_prepare.cc:5131
      #19 0x0000560db0970679 in Prepared_statement::execute_loop (this=this@entry=0x149d54065ee8, expanded_query=expanded_query@entry=0x149d85374b00, open_cursor=open_cursor@entry=false, packet=packet@entry=0x0, packet_end=packet_end@entry=0x0) at /test/10.5_dbg/sql/sql_prepare.cc:4553
      #20 0x0000560db09721e8 in Prepared_statement::execute_immediate (this=this@entry=0x149d54065ee8, query=<optimized out>, query_len=16) at /test/10.5_dbg/sql/sql_prepare.cc:5259
      #21 0x0000560db09723c0 in mysql_sql_stmt_execute_immediate (thd=thd@entry=0x149d54000d48) at /test/10.5_dbg/sql/sql_prepare.cc:3008
      #22 0x0000560db0957c53 in mysql_execute_command (thd=thd@entry=0x149d54000d48) at /test/10.5_dbg/sql/sql_parse.cc:4035
      #23 0x0000560db0943682 in mysql_parse (thd=thd@entry=0x149d54000d48, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x149d853752c0, 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:8237
      #24 0x0000560db0952bf9 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x149d54000d48, packet=packet@entry=0x149d5400aa19 "EXECUTE IMMEDIATE 'UPDATE t SET b=?' USING DEFAULT", packet_length=packet_length@entry=50, 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:1334
      #25 0x0000560db0955948 in do_command (thd=thd@entry=0x149d54000d48) at /test/10.5_dbg/sql/sql_parse.cc:1375
      #26 0x0000560db0aa3640 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x560db42c43a8, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1407
      #27 0x0000560db0aa3cb1 in handle_one_connection (arg=arg@entry=0x560db42c43a8) at /test/10.5_dbg/sql/sql_connect.cc:1319
      #28 0x0000560db0f257b5 in pfs_spawn_thread (arg=0x560db416a9a8) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
      #29 0x0000149da8f99609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #30 0x0000149da8b85133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.5.27 (dbg), 10.6.20 (dbg), 10.11.10 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.5.27 (opt), 10.6.20 (opt), 10.11.10 (opt), 11.2.6 (dbg), 11.2.6 (opt), 11.4.4 (dbg), 11.4.4 (opt), 11.6.2 (dbg), 11.6.2 (opt), 11.7.0 (dbg), 11.7.0 (opt)

      Attachments

        Activity

          People

            bar Alexander Barkov
            ramesh Ramesh Sivaraman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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