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

Assertion `fixed()' or fixed == 1 failed in Item_func_date_format::val_str on INSERT when using binary logging

    XMLWordPrintable

    Details

      Description

      This issue may be for either Andrei Elkin or Alexander Barkov.

      # mysqld options required for replay: --log-bin --binlog_format=ROW
      CREATE TABLE t (a INT,c CHAR(0) AS (DATE_FORMAT(a,1))) ENGINE=InnoDB;
      CREATE TRIGGER tr AFTER INSERT ON t FOR EACH ROW SET @a=0;
      INSERT INTO t VALUES (),();
      

      Leads to:

      10.10.0 88b22356e623fd63aa87273a895521a6e6667bc7 (Debug)

      mysqld: /test/10.10_dbg/sql/item_timefunc.cc:1887: virtual String* Item_func_date_format::val_str(String*): Assertion `fixed()' failed.
      

      10.10.0 88b22356e623fd63aa87273a895521a6e6667bc7 (Debug)

      Core was generated by `/test/MD120722-mariadb-10.10.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
      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 0x154bd8dbe700 (LWP 3439549))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x0000154bf7189859 in __GI_abort () at abort.c:79
      #2  0x0000154bf7189729 in __assert_fail_base (fmt=0x154bf731f588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5558185cc60f "fixed()", file=0x5558187a2f60 "/test/10.10_dbg/sql/item_timefunc.cc", line=1887, function=<optimized out>) at assert.c:92
      #3  0x0000154bf719afd6 in __GI___assert_fail (assertion=assertion@entry=0x5558185cc60f "fixed()", file=file@entry=0x5558187a2f60 "/test/10.10_dbg/sql/item_timefunc.cc", line=line@entry=1887, function=function@entry=0x5558187a3b00 "virtual String* Item_func_date_format::val_str(String*)") at assert.c:101
      #4  0x0000555817e323f0 in Item_func_date_format::val_str (this=0x154b6c041e48, str=0x154b6c041e70) at /test/10.10_dbg/sql/item.h:1069
      #5  0x0000555817d2649f in Item::save_str_in_field (this=0x154b6c041e48, field=0x154b6c028ce0, no_conversions=<optimized out>) at /test/10.10_dbg/sql/item.cc:6804
      #6  0x0000555817c059b8 in Type_handler_string_result::Item_save_in_field (this=<optimized out>, item=<optimized out>, field=<optimized out>, no_conversions=<optimized out>) at /test/10.10_dbg/sql/sql_type.cc:4338
      #7  0x0000555817d0cdfd in Item::save_in_field (this=0x154b6c041e48, field=0x154b6c028ce0, no_conversions=<optimized out>) at /test/10.10_dbg/sql/item.cc:6852
      #8  0x0000555817b2e5c1 in TABLE::update_virtual_fields (this=this@entry=0x154b6c03f6e8, h=<optimized out>, update_mode=update_mode@entry=VCOL_UPDATE_FOR_WRITE) at /test/10.10_dbg/sql/table.cc:8859
      #9  0x000055581798d914 in fill_record (thd=thd@entry=0x154b6c000db8, table_arg=table_arg@entry=0x154b6c03f6e8, fields=@0x154b6c005e90: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x555818ee67c0 <end_of_list>, last = 0x154b6c005e90, elements = 0}, <No data fields>}, values=@0x154b6c0149b0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x555818ee67c0 <end_of_list>, last = 0x154b6c0149b0, elements = 0}, <No data fields>}, ignore_errors=ignore_errors@entry=false, update=update@entry=false) at /test/10.10_dbg/sql/sql_base.cc:8882
      #10 0x000055581798de4a in fill_record_n_invoke_before_triggers (thd=thd@entry=0x154b6c000db8, table=table@entry=0x154b6c03f6e8, fields=@0x154b6c005e90: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x555818ee67c0 <end_of_list>, last = 0x154b6c005e90, elements = 0}, <No data fields>}, values=@0x154b6c0149b0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x555818ee67c0 <end_of_list>, last = 0x154b6c0149b0, elements = 0}, <No data fields>}, ignore_errors=ignore_errors@entry=false, event=event@entry=TRG_EVENT_INSERT) at /test/10.10_dbg/sql/sql_base.cc:9011
      #11 0x00005558179d0184 in mysql_insert (thd=thd@entry=0x154b6c000db8, table_list=<optimized out>, fields=@0x154b6c005e90: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x555818ee67c0 <end_of_list>, last = 0x154b6c005e90, elements = 0}, <No data fields>}, values_list=@0x154b6c005ed8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x154b6c0149a0, last = 0x154b6c0149c8, elements = 2}, <No data fields>}, update_fields=@0x154b6c005ec0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x555818ee67c0 <end_of_list>, last = 0x154b6c005ec0, elements = 0}, <No data fields>}, update_values=@0x154b6c005ea8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x555818ee67c0 <end_of_list>, last = 0x154b6c005ea8, elements = 0}, <No data fields>}, duplic=DUP_ERROR, ignore=false, result=0x0) at /test/10.10_dbg/sql/sql_insert.cc:1042
      #12 0x0000555817a13e1f in mysql_execute_command (thd=thd@entry=0x154b6c000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.10_dbg/sql/sql_parse.cc:4562
      #13 0x0000555817a00464 in mysql_parse (thd=thd@entry=0x154b6c000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x154bd8dbd470) at /test/10.10_dbg/sql/sql_parse.cc:8036
      #14 0x0000555817a0da4c in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x154b6c000db8, packet=packet@entry=0x154b6c00b7e9 "INSERT INTO t VALUES (),()", packet_length=packet_length@entry=26, blocking=blocking@entry=true) at /test/10.10_dbg/sql/sql_class.h:1364
      #15 0x0000555817a10156 in do_command (thd=0x154b6c000db8, blocking=blocking@entry=true) at /test/10.10_dbg/sql/sql_parse.cc:1407
      #16 0x0000555817b700d0 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55581a9e0c38, put_in_cache=put_in_cache@entry=true) at /test/10.10_dbg/sql/sql_connect.cc:1418
      #17 0x0000555817b705d9 in handle_one_connection (arg=0x55581a9e0c38) at /test/10.10_dbg/sql/sql_connect.cc:1312
      #18 0x0000154bf769a609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #19 0x0000154bf7286133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.4.26 9a0cbd31ce8576468981b14b066dea155cb922d9 (Debug)

      mysqld: /test/10.4_dbg/sql/item_timefunc.cc:1895: virtual String* Item_func_date_format::val_str(String*): Assertion `fixed == 1' failed.
      

      10.4.26 9a0cbd31ce8576468981b14b066dea155cb922d9 (Debug)

      Core was generated by `/test/MD120722-mariadb-10.4.26-linux-x86_64-dbg/bin/mysqld --no-defaults --core'.
      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 0x15368031f700 (LWP 3448015))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x000015368a0d9859 in __GI_abort () at abort.c:79
      #2  0x000015368a0d9729 in __assert_fail_base (fmt=0x15368a26f588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55fc8cd0e460 "fixed == 1", file=0x55fc8cd0ed48 "/test/10.4_dbg/sql/item_timefunc.cc", line=1895, function=<optimized out>) at assert.c:92
      #3  0x000015368a0eafd6 in __GI___assert_fail (assertion=assertion@entry=0x55fc8cd0e460 "fixed == 1", file=file@entry=0x55fc8cd0ed48 "/test/10.4_dbg/sql/item_timefunc.cc", line=line@entry=1895, function=function@entry=0x55fc8cd0f8e0 "virtual String* Item_func_date_format::val_str(String*)") at assert.c:101
      #4  0x000055fc8c32e1e0 in Item_func_date_format::val_str (this=0x153624025900, str=0x153624025930) at /test/10.4_dbg/sql/item_timefunc.cc:1895
      #5  0x000055fc8c23088f in Item::save_str_in_field (this=0x153624025900, field=0x15362400e690, no_conversions=<optimized out>) at /test/10.4_dbg/sql/item.cc:6666
      #6  0x000055fc8c11ba12 in Type_handler_string_result::Item_save_in_field (this=<optimized out>, item=<optimized out>, field=<optimized out>, no_conversions=<optimized out>) at /test/10.4_dbg/sql/sql_type.cc:3816
      #7  0x000055fc8c21730b in Item::save_in_field (this=0x153624025900, field=0x15362400e690, no_conversions=<optimized out>) at /test/10.4_dbg/sql/item.cc:6714
      #8  0x000055fc8c07279e in TABLE::update_virtual_fields (this=this@entry=0x153624030170, h=<optimized out>, update_mode=update_mode@entry=VCOL_UPDATE_FOR_WRITE) at /test/10.4_dbg/sql/table.cc:8531
      #9  0x000055fc8bf0b8ed in fill_record (thd=thd@entry=0x153624000d90, table_arg=table_arg@entry=0x153624030170, fields=@0x153624005a08: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55fc8d415690 <end_of_list>, last = 0x153624005a08, elements = 0}, <No data fields>}, values=@0x153624013e08: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55fc8d415690 <end_of_list>, last = 0x153624013e08, elements = 0}, <No data fields>}, ignore_errors=ignore_errors@entry=false, update=update@entry=false) at /test/10.4_dbg/sql/sql_base.cc:8597
      #10 0x000055fc8bf0bee0 in fill_record_n_invoke_before_triggers (thd=thd@entry=0x153624000d90, table=table@entry=0x153624030170, fields=@0x153624005a08: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55fc8d415690 <end_of_list>, last = 0x153624005a08, elements = 0}, <No data fields>}, values=@0x153624013e08: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55fc8d415690 <end_of_list>, last = 0x153624013e08, elements = 0}, <No data fields>}, ignore_errors=ignore_errors@entry=false, event=event@entry=TRG_EVENT_INSERT) at /test/10.4_dbg/sql/sql_base.cc:8726
      #11 0x000055fc8bf4594b in mysql_insert (thd=thd@entry=0x153624000d90, table_list=<optimized out>, fields=@0x153624005a08: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55fc8d415690 <end_of_list>, last = 0x153624005a08, elements = 0}, <No data fields>}, values_list=@0x153624005a50: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x153624013df8, last = 0x153624013e20, elements = 2}, <No data fields>}, update_fields=@0x153624005a38: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55fc8d415690 <end_of_list>, last = 0x153624005a38, elements = 0}, <No data fields>}, update_values=@0x153624005a20: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55fc8d415690 <end_of_list>, last = 0x153624005a20, elements = 0}, <No data fields>}, duplic=DUP_ERROR, ignore=false) at /test/10.4_dbg/sql/sql_insert.cc:980
      #12 0x000055fc8bf7dac1 in mysql_execute_command (thd=thd@entry=0x153624000d90) at /test/10.4_dbg/sql/sql_parse.cc:4598
      #13 0x000055fc8bf84e63 in mysql_parse (thd=thd@entry=0x153624000d90, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x15368031e3f0, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.4_dbg/sql/sql_parse.cc:7995
      #14 0x000055fc8bf87989 in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x153624000d90, packet=packet@entry=0x15362401a2d1 "INSERT INTO t VALUES (),()", packet_length=packet_length@entry=26, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /test/10.4_dbg/sql/sql_class.h:1201
      #15 0x000055fc8bf8a44a in do_command (thd=0x153624000d90) at /test/10.4_dbg/sql/sql_parse.cc:1378
      #16 0x000055fc8c0ab327 in do_handle_one_connection (connect=<optimized out>) at /test/10.4_dbg/sql/sql_connect.cc:1420
      #17 0x000055fc8c0ab3e7 in handle_one_connection (arg=<optimized out>) at /test/10.4_dbg/sql/sql_connect.cc:1316
      #18 0x000015368a5ea609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #19 0x000015368a1d6133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.3.36 (dbg), 10.4.26 (dbg), 10.5.17 (dbg), 10.6.9 (dbg), 10.7.5 (dbg), 10.8.4 (dbg), 10.9.2 (dbg), 10.10.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.3.36 (opt), 10.4.26 (opt), 10.5.17 (opt), 10.6.9 (opt), 10.7.5 (opt), 10.8.4 (opt), 10.9.2 (opt), 10.10.0 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.38 (dbg), 5.7.38 (opt), 8.0.29 (dbg), 8.0.29 (opt)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              bar Alexander Barkov
              Reporter:
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.