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

Assertion `fixed()' failed or Assertion `fixed == 1' failed in Item_func_dayname::val_str on INSERT

    XMLWordPrintable

    Details

      Description

      Some similarities to both MDEV-29173 (same versions, but no binlog required here), and MDEV-29356 (similar testcase, but versions and assert are different).

      SET sql_mode='';
      CREATE TABLE t (c1 BLOB ,c2 INT,c3 CHAR(10) AS (DAYNAME (c2)));
      CREATE TRIGGER tr BEFORE INSERT ON t FOR EACH ROW SET new.c2=0;
      INSERT INTO t VALUES (0,0,0);
      

      Leads to:

      10.11.0 bc563f1a4b0b38de3b41fd0f0d3d8b7f1aacbd8b (Debug)

      mysqld: /test/10.11_dbg/sql/item_timefunc.cc:1132: virtual String* Item_func_dayname::val_str(String*): Assertion `fixed()' failed.
      

      10.11.0 bc563f1a4b0b38de3b41fd0f0d3d8b7f1aacbd8b (Debug)

      Core was generated by `/test/MD190822-mariadb-10.11.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 0x1488e1af5700 (LWP 3661963))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x00001488fee93859 in __GI_abort () at abort.c:79
      #2  0x00001488fee93729 in __assert_fail_base (fmt=0x1488ff029588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x562c4be9a61f "fixed()", file=0x562c4c072b80 "/test/10.11_dbg/sql/item_timefunc.cc", line=1132, function=<optimized out>) at assert.c:92
      #3  0x00001488feea4fd6 in __GI___assert_fail (assertion=assertion@entry=0x562c4be9a61f "fixed()", file=file@entry=0x562c4c072b80 "/test/10.11_dbg/sql/item_timefunc.cc", line=line@entry=1132, function=function@entry=0x562c4c073460 "virtual String* Item_func_dayname::val_str(String*)") at assert.c:101
      #4  0x0000562c4b6fb5be in Item_func_dayname::val_str (this=0x148888030268, str=0x148888030290) at /test/10.11_dbg/sql/item.h:1069
      #5  0x0000562c4b5f0d63 in Item::save_str_in_field (this=0x148888030268, field=0x148888021158, no_conversions=<optimized out>) at /test/10.11_dbg/sql/item.cc:6804
      #6  0x0000562c4b4cfece 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.11_dbg/sql/sql_type.cc:4329
      #7  0x0000562c4b5d76c1 in Item::save_in_field (this=0x148888030268, field=0x148888021158, no_conversions=<optimized out>) at /test/10.11_dbg/sql/item.cc:6852
      #8  0x0000562c4b3f76a1 in TABLE::update_virtual_fields (this=this@entry=0x148888020a98, h=<optimized out>, update_mode=update_mode@entry=VCOL_UPDATE_FOR_WRITE) at /test/10.11_dbg/sql/table.cc:8859
      #9  0x0000562c4b255671 in fill_record_n_invoke_before_triggers (thd=thd@entry=0x148888000db8, table=table@entry=0x148888020a98, ptr=0x1488880295e0, values=@0x148888014888: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x148888014920, last = 0x148888014a40, elements = 3}, <No data fields>}, ignore_errors=ignore_errors@entry=false, event=event@entry=TRG_EVENT_INSERT) at /test/10.11_dbg/sql/sql_base.cc:9264
      #10 0x0000562c4b298de2 in mysql_insert (thd=thd@entry=0x148888000db8, table_list=<optimized out>, fields=@0x148888005ea8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x562c4c89fc20 <end_of_list>, last = 0x148888005ea8, elements = 0}, <No data fields>}, values_list=@0x148888005ef0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x148888014a50, last = 0x148888014a50, elements = 1}, <No data fields>}, update_fields=@0x148888005ed8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x562c4c89fc20 <end_of_list>, last = 0x148888005ed8, elements = 0}, <No data fields>}, update_values=@0x148888005ec0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x562c4c89fc20 <end_of_list>, last = 0x148888005ec0, elements = 0}, <No data fields>}, duplic=DUP_ERROR, ignore=false, result=0x0) at /test/10.11_dbg/sql/sql_insert.cc:1089
      #11 0x0000562c4b2db24c in mysql_execute_command (thd=thd@entry=0x148888000db8, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.11_dbg/sql/sql_parse.cc:4563
      #12 0x0000562c4b2c7882 in mysql_parse (thd=thd@entry=0x148888000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1488e1af4330) at /test/10.11_dbg/sql/sql_parse.cc:8035
      #13 0x0000562c4b2d4e6a in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x148888000db8, packet=packet@entry=0x14888800b6e9 "INSERT INTO t VALUES (0,0,0)", packet_length=packet_length@entry=28, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_class.h:1339
      #14 0x0000562c4b2d7574 in do_command (thd=0x148888000db8, blocking=blocking@entry=true) at /test/10.11_dbg/sql/sql_parse.cc:1407
      #15 0x0000562c4b4391da in do_handle_one_connection (connect=<optimized out>, connect@entry=0x562c4f55a9e8, put_in_cache=put_in_cache@entry=true) at /test/10.11_dbg/sql/sql_connect.cc:1418
      #16 0x0000562c4b4396e3 in handle_one_connection (arg=0x562c4f55a9e8) at /test/10.11_dbg/sql/sql_connect.cc:1312
      #17 0x00001488ff3a4609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #18 0x00001488fef90133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.5.18 5fc172fd43375b392a8c8adfb9038c279e578d83 (Debug)

      mysqld: /test/10.5_dbg/sql/item_timefunc.cc:1135: virtual String* Item_func_dayname::val_str(String*): Assertion `fixed == 1' failed.
      

      10.5.18 5fc172fd43375b392a8c8adfb9038c279e578d83 (Debug)

      Core was generated by `/test/MD200822-mariadb-10.5.18-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 0x1492fe15e700 (LWP 3662578))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x000014931b314859 in __GI_abort () at abort.c:79
      #2  0x000014931b314729 in __assert_fail_base (fmt=0x14931b4aa588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55a7e4f23ce9 "fixed == 1", file=0x55a7e4f2dfd8 "/test/10.5_dbg/sql/item_timefunc.cc", line=1135, function=<optimized out>) at assert.c:92
      #3  0x000014931b325fd6 in __GI___assert_fail (assertion=assertion@entry=0x55a7e4f23ce9 "fixed == 1", file=file@entry=0x55a7e4f2dfd8 "/test/10.5_dbg/sql/item_timefunc.cc", line=line@entry=1135, function=function@entry=0x55a7e4f2e8b0 "virtual String* Item_func_dayname::val_str(String*)") at assert.c:101
      #4  0x000055a7e4549393 in Item_func_dayname::val_str (this=0x1492b80267d0, str=0x1492b8026808) at /test/10.5_dbg/sql/item_timefunc.cc:1135
      #5  0x000055a7e4448219 in Item::save_str_in_field (this=0x1492b80267d0, field=0x1492b8025b88, no_conversions=<optimized out>) at /test/10.5_dbg/sql/item.cc:6731
      #6  0x000055a7e432d8b2 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.5_dbg/sql/sql_type.cc:4330
      #7  0x000055a7e442ea59 in Item::save_in_field (this=0x1492b80267d0, field=0x1492b8025b88, no_conversions=<optimized out>) at /test/10.5_dbg/sql/item.cc:6779
      #8  0x000055a7e42774fb in TABLE::update_virtual_fields (this=this@entry=0x1492b802bba8, h=<optimized out>, update_mode=update_mode@entry=VCOL_UPDATE_FOR_WRITE) at /test/10.5_dbg/sql/table.cc:8760
      #9  0x000055a7e40fb16f in fill_record_n_invoke_before_triggers (thd=thd@entry=0x1492b8000db8, table=table@entry=0x1492b802bba8, ptr=0x1492b802d9e8, values=@0x1492b8014748: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1492b8014800, last = 0x1492b8014960, elements = 3}, <No data fields>}, ignore_errors=ignore_errors@entry=false, event=event@entry=TRG_EVENT_INSERT) at /test/10.5_dbg/sql/sql_base.cc:8911
      #10 0x000055a7e41375a5 in mysql_insert (thd=thd@entry=0x1492b8000db8, table_list=<optimized out>, fields=@0x1492b8005c38: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55a7e5658280 <end_of_list>, last = 0x1492b8005c38, elements = 0}, <No data fields>}, values_list=@0x1492b8005c80: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x1492b8014970, last = 0x1492b8014970, elements = 1}, <No data fields>}, update_fields=@0x1492b8005c68: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55a7e5658280 <end_of_list>, last = 0x1492b8005c68, elements = 0}, <No data fields>}, update_values=@0x1492b8005c50: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55a7e5658280 <end_of_list>, last = 0x1492b8005c50, elements = 0}, <No data fields>}, duplic=DUP_ERROR, ignore=false, result=0x0) at /test/10.5_dbg/sql/sql_insert.cc:1066
      #11 0x000055a7e417a8f1 in mysql_execute_command (thd=thd@entry=0x1492b8000db8) at /test/10.5_dbg/sql/sql_parse.cc:4625
      #12 0x000055a7e41663c0 in mysql_parse (thd=thd@entry=0x1492b8000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x1492fe15d340, 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:8101
      #13 0x000055a7e417439a in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x1492b8000db8, packet=packet@entry=0x1492b800b2b9 "INSERT INTO t VALUES (0,0,0)", packet_length=packet_length@entry=28, 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:1290
      #14 0x000055a7e4176eb6 in do_command (thd=0x1492b8000db8) at /test/10.5_dbg/sql/sql_parse.cc:1375
      #15 0x000055a7e42b7133 in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55a7e84a40f8, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1418
      #16 0x000055a7e42b763b in handle_one_connection (arg=0x55a7e84a40f8) at /test/10.5_dbg/sql/sql_connect.cc:1312
      #17 0x000014931b825609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #18 0x000014931b411133 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.3.37 (dbg), 10.4.27 (dbg), 10.5.18 (dbg), 10.6.10 (dbg), 10.7.6 (dbg), 10.8.5 (dbg), 10.9.2 (dbg), 10.10.2 (dbg), 10.11.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.3.37 (opt), 10.4.27 (opt), 10.5.18 (opt), 10.6.10 (opt), 10.7.6 (opt), 10.8.5 (opt), 10.9.2 (opt), 10.10.2 (opt), 10.11.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:
              midenok Aleksey Midenkov
              Reporter:
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.