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

Assertion `used_tables_cache == 0' failed in Item_func::fix_fields on INSERT

    XMLWordPrintable

Details

    Description

      Does not look related to MDEV-25650, and different from MDEV-30730 as no Galera is involved here, and the assert is different.

      SET SESSION lc_time_names=zh_hk;
      CREATE TABLE t (c CHAR,cc TEXT AS (CONCAT (c,IF(c=c,DATE_FORMAT(c,''),'')))) ENGINE=InnoDB;
      SET NAMES utf8;
      INSERT INTO t VALUES (0,0);
      INSERT INTO t VALUES (0,0);
      INSERT INTO t VALUES (0,0);
      

      Leads to:

      11.3.0 7ba9c7fb84b5f28e4736656b57d9508b70ca6369 (Debug)

      ...
      11.3.0-dbg>INSERT INTO t VALUES (0,0);
      ERROR 1906 (HY000): The value specified for generated column 'cc' in table 't' has been ignored
      11.3.0-dbg>INSERT INTO t VALUES (0,0);
      ERROR 1267 (HY000): Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb3_general_ci,COERCIBLE) for operation 'concat'
      11.3.0-dbg>INSERT INTO t VALUES (0,0);
      ERROR 2013 (HY000): Lost connection to server during query
      

      11.3.0 7ba9c7fb84b5f28e4736656b57d9508b70ca6369 (Debug)

      mariadbd: /test/git-bisect/11.3_dbg/sql/item_func.cc:326: virtual bool Item_func::fix_fields(THD*, Item**): Assertion `used_tables_cache == 0' failed.
      

      11.3.0 7ba9c7fb84b5f28e4736656b57d9508b70ca6369 (Debug)

      Core was generated by `/test/MD020923-mariadb-11.3.0-linux-x86_64-dbg/bin/mariadbd --no-defaults --cor'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=22937018324544)
          at ./nptl/pthread_kill.c:44
      [Current thread is 1 (Thread 0x14dc70d45640 (LWP 3134337))]
      (gdb) bt
      #0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=22937018324544) at ./nptl/pthread_kill.c:44
      #1  __pthread_kill_internal (signo=6, threadid=22937018324544) at ./nptl/pthread_kill.c:78
      #2  __GI___pthread_kill (threadid=22937018324544, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
      #3  0x000014dc8ea42476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
      #4  0x000014dc8ea287f3 in __GI_abort () at ./stdlib/abort.c:79
      #5  0x000014dc8ea2871b in __assert_fail_base (fmt=0x14dc8ebdd150 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x5633f4ef434a "used_tables_cache == 0", file=0x5633f4ef4748 "/test/git-bisect/11.3_dbg/sql/item_func.cc", line=326, function=<optimized out>) at ./assert/assert.c:92
      #6  0x000014dc8ea39e96 in __GI___assert_fail (assertion=0x5633f4ef434a "used_tables_cache == 0", file=0x5633f4ef4748 "/test/git-bisect/11.3_dbg/sql/item_func.cc", line=326, function=0x5633f4ef5040 "virtual bool Item_func::fix_fields(THD*, Item**)") at ./assert/assert.c:101
      #7  0x00005633f457d83b in Item_func::fix_fields (this=this@entry=0x14dc200285d8, thd=thd@entry=0x14dc20000d58, ref=<optimized out>) at /test/git-bisect/11.3_dbg/sql/item_func.cc:326
      #8  0x00005633f45c3330 in Item_str_func::fix_fields (this=0x14dc200285d8, thd=0x14dc20000d58, ref=<optimized out>) at /test/git-bisect/11.3_dbg/sql/item_strfunc.cc:128
      #9  0x00005633f43218ff in Virtual_column_info::fix_expr (this=this@entry=0x14dc200286a8, thd=thd@entry=0x14dc20000d58) at /test/git-bisect/11.3_dbg/sql/table.cc:3725
      #10 0x00005633f4321a68 in Virtual_column_info::fix_session_expr (this=0x14dc200286a8, thd=thd@entry=0x14dc20000d58) at /test/git-bisect/11.3_dbg/sql/table.cc:3751
      #11 0x00005633f4321da2 in TABLE::vcol_fix_expr (this=<optimized out>, thd=thd@entry=0x14dc20000d58) at /test/git-bisect/11.3_dbg/sql/table.cc:3835
      #12 0x00005633f418dd6f in open_table (thd=thd@entry=0x14dc20000d58, table_list=table_list@entry=0x14dc20013380, ot_ctx=ot_ctx@entry=0x14dc70d43710) at /test/git-bisect/11.3_dbg/sql/sql_base.cc:2353
      #13 0x00005633f419200d in open_and_process_table (ot_ctx=0x14dc70d43710, has_prelocking_list=false, prelocking_strategy=0x14dc70d43900, flags=0, counter=0x14dc70d437ac, tables=0x14dc20013380, thd=0x14dc20000d58) at /test/git-bisect/11.3_dbg/sql/sql_base.cc:4148
      #14 open_tables (thd=thd@entry=0x14dc20000d58, options=@0x14dc200065e8: {m_options = DDL_options_st::OPT_NONE}, start=start@entry=0x14dc70d43798, counter=counter@entry=0x14dc70d437ac, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x14dc70d43900) at /test/git-bisect/11.3_dbg/sql/sql_base.cc:4633
      #15 0x00005633f4192e78 in open_and_lock_tables (thd=thd@entry=0x14dc20000d58, options=<optimized out>, tables=<optimized out>, tables@entry=0x14dc20013380, derived=derived@entry=true, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x14dc70d43900) at /test/git-bisect/11.3_dbg/sql/sql_base.cc:5607
      #16 0x00005633f41d0a4a in open_and_lock_tables (flags=0, derived=true, tables=0x14dc20013380, thd=0x14dc20000d58) at /test/git-bisect/11.3_dbg/sql/sql_base.h:525
      #17 mysql_insert (thd=thd@entry=0x14dc20000d58, table_list=0x14dc20013380, fields=@0x14dc20005fa0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x5633f5755be0 <end_of_list>, last = 0x14dc20005fa0, elements = 0}, <No data fields>}, values_list=@0x14dc20005fe8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x14dc20014098, last = 0x14dc20014098, elements = 1}, <No data fields>}, update_fields=@0x14dc20005fd0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x5633f5755be0 <end_of_list>, last = 0x14dc20005fd0, elements = 0}, <No data fields>}, update_values=@0x14dc20005fb8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x5633f5755be0 <end_of_list>, last = 0x14dc20005fb8, elements = 0}, <No data fields>}, duplic=DUP_ERROR, ignore=false, result=0x0) at /test/git-bisect/11.3_dbg/sql/sql_insert.cc:767
      #18 0x00005633f420cc37 in mysql_execute_command (thd=thd@entry=0x14dc20000d58, is_called_from_prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/git-bisect/11.3_dbg/sql/sql_parse.cc:4427
      #19 0x00005633f42123a8 in mysql_parse (thd=thd@entry=0x14dc20000d58, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x14dc70d44200) at /test/git-bisect/11.3_dbg/sql/sql_parse.cc:7760
      #20 0x00005633f421453c in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x14dc20000d58, packet=packet@entry=0x14dc2000af69 "INSERT INTO t VALUES (0,0)", packet_length=packet_length@entry=26, blocking=blocking@entry=true) at /test/git-bisect/11.3_dbg/sql/sql_class.h:247
      #21 0x00005633f4216417 in do_command (thd=0x14dc20000d58, blocking=blocking@entry=true) at /test/git-bisect/11.3_dbg/sql/sql_parse.cc:1406
      #22 0x00005633f436d2ae in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5633f6d011d8, put_in_cache=put_in_cache@entry=true) at /test/git-bisect/11.3_dbg/sql/sql_connect.cc:1445
      #23 0x00005633f436d50d in handle_one_connection (arg=0x5633f6d011d8) at /test/git-bisect/11.3_dbg/sql/sql_connect.cc:1347
      #24 0x000014dc8ea94b43 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #25 0x000014dc8eb26a00 in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      Bug confirmed present in:
      MariaDB: 10.6.15 (dbg), 10.9.8 (dbg), 10.10.6 (dbg), 10.11.5 (dbg), 11.0.3 (dbg), 11.1.2 (dbg), 11.2.0 (dbg), 11.3.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.4.31 (dbg), 10.4.31 (opt), 10.5.22 (dbg), 10.5.22 (opt), 10.6.15 (opt), 10.9.8 (opt), 10.10.6 (opt), 10.11.5 (opt), 11.0.3 (opt), 11.1.2 (opt), 11.2.0 (opt), 11.3.0 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.40 (dbg), 8.0.33 (dbg), 8.0.33 (opt)

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              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.