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

Assertion `(uint) (table_check_constraints - share->check_constraints) == (uint) (share->table_check_constraints - share->field_check_constraints)' failed in TABLE_SHARE::init_from_binary_frm_image

    XMLWordPrintable

Details

    Description

      USE test;
      SET @@SESSION.collation_connection=utf32_estonian_ci;
      CREATE TABLE t1(c1 SET('a') COLLATE 'Binary',c2 JSON);
      

      Leads to:

      10.5.3 64488a6f2dd6aa43462292b757e783cfba11a8c6

      mysqld: /test/10.5_dbg/sql/table.cc:3131: int TABLE_SHARE::init_from_binary_frm_image(THD*, bool, const uchar*, size_t, const uchar*, size_t): Assertion `(uint) (table_check_constraints - share->check_constraints) == (uint) (share->table_check_constraints - share->field_check_constraints)' failed.
      

      10.5.3 64488a6f2dd6aa43462292b757e783cfba11a8c6

      Core was generated by `/test/MD050520-mariadb-10.5.3-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGABRT, Aborted.
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6)
          at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      [Current thread is 1 (Thread 0x154a5bcf7700 (LWP 71945))]
      (gdb) bt
      #0  __pthread_kill (threadid=<optimized out>, signo=signo@entry=6) at ../sysdeps/unix/sysv/linux/pthread_kill.c:57
      #1  0x000055869954ce9a in my_write_core (sig=sig@entry=6) at /test/10.5_dbg/mysys/stacktrace.c:518
      #2  0x0000558698cf1289 in handle_fatal_signal (sig=6) at /test/10.5_dbg/sql/signal_handler.cc:329
      #3  <signal handler called>
      #4  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
      #5  0x0000154a5a43b801 in __GI_abort () at abort.c:79
      #6  0x0000154a5a42b39a in __assert_fail_base (fmt=0x154a5a5b27d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x5586996e8910 "(uint) (table_check_constraints - share->check_constraints) == (uint) (share->table_check_constraints - share->field_check_constraints)", file=file@entry=0x5586996e5f49 "/test/10.5_dbg/sql/table.cc", line=line@entry=3131, function=function@entry=0x5586996ea2a0 <TABLE_SHARE::init_from_binary_frm_image(THD*, bool, unsigned char const*, unsigned long, unsigned char const*, unsigned long)::__PRETTY_FUNCTION__> "int TABLE_SHARE::init_from_binary_frm_image(THD*, bool, const uchar*, size_t, const uchar*, size_t)") at assert.c:92
      #7  0x0000154a5a42b412 in __GI___assert_fail (assertion=assertion@entry=0x5586996e8910 "(uint) (table_check_constraints - share->check_constraints) == (uint) (share->table_check_constraints - share->field_check_constraints)", file=file@entry=0x5586996e5f49 "/test/10.5_dbg/sql/table.cc", line=line@entry=3131, function=function@entry=0x5586996ea2a0 <TABLE_SHARE::init_from_binary_frm_image(THD*, bool, unsigned char const*, unsigned long, unsigned char const*, unsigned long)::__PRETTY_FUNCTION__> "int TABLE_SHARE::init_from_binary_frm_image(THD*, bool, const uchar*, size_t, const uchar*, size_t)") at assert.c:101
      #8  0x0000558698b5eece in TABLE_SHARE::init_from_binary_frm_image (this=this@entry=0x154a5bcf47a0, thd=thd@entry=0x154a37c15088, write=<optimized out>, frm_image=<optimized out>, frm_length=<optimized out>, par_image=par_image@entry=0x0, par_length=0) at /test/10.5_dbg/sql/table.cc:3129
      #9  0x0000558698d00793 in ha_create_table (thd=thd@entry=0x154a37c15088, path=path@entry=0x154a5bcf55a0 "./test/t1", db=0x154a37c748a0 "test", table_name=0x154a37c74198 "t1", create_info=create_info@entry=0x154a5bcf59f0, frm=frm@entry=0x154a5bcf5590) at /test/10.5_dbg/sql/handler.cc:5343
      #10 0x0000558698b17c42 in create_table_impl (thd=thd@entry=0x154a37c15088, orig_db=..., orig_table_name=..., db=..., table_name=..., path=path@entry=0x154a5bcf55a0 "./test/t1", options=..., create_info=0x154a5bcf59f0, alter_info=0x154a5bcf5920, create_table_mode=0, is_trans=0x154a5bcf5827, key_info=0x154a5bcf5588, key_count=0x154a5bcf5584, frm=0x154a5bcf5590) at /test/10.5_dbg/sql/sql_table.cc:5177
      #11 0x0000558698b18127 in mysql_create_table_no_lock (thd=thd@entry=0x154a37c15088, db=db@entry=0x154a37c741e8, table_name=table_name@entry=0x154a37c741f8, create_info=create_info@entry=0x154a5bcf59f0, alter_info=alter_info@entry=0x154a5bcf5920, is_trans=is_trans@entry=0x154a5bcf5827, create_table_mode=0, table_list=0x154a37c741d0) at /test/10.5_dbg/sql/sql_table.cc:5261
      #12 0x0000558698b1846e in mysql_create_table (thd=thd@entry=0x154a37c15088, create_table=create_table@entry=0x154a37c741d0, create_info=create_info@entry=0x154a5bcf59f0, alter_info=alter_info@entry=0x154a5bcf5920) at /test/10.5_dbg/sql/sql_table.cc:5353
      #13 0x0000558698b19d87 in Sql_cmd_create_table_like::execute (this=0x154a37c74170, thd=0x154a37c15088) at /test/10.5_dbg/sql/sql_table.cc:11876
      #14 0x0000558698a4d206 in mysql_execute_command (thd=thd@entry=0x154a37c15088) at /test/10.5_dbg/sql/sql_parse.cc:5912
      #15 0x0000558698a54b3a in mysql_parse (thd=thd@entry=0x154a37c15088, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x154a5bcf6450, 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:7957
      #16 0x0000558698a4130f in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x154a37c15088, packet=packet@entry=0x154a37c67089 "CREATE TABLE t1(c1 SET('a') COLLATE 'Binary',c2 JSON)", packet_length=packet_length@entry=53, 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:1839
      #17 0x0000558698a3fbde in do_command (thd=0x154a37c15088) at /test/10.5_dbg/sql/sql_parse.cc:1358
      #18 0x0000558698b99d0d in do_handle_one_connection (connect=<optimized out>, connect@entry=0x154a3a8433a8, put_in_cache=put_in_cache@entry=true) at /test/10.5_dbg/sql/sql_connect.cc:1422
      #19 0x0000558698b9a03c in handle_one_connection (arg=arg@entry=0x154a3a8433a8) at /test/10.5_dbg/sql/sql_connect.cc:1319
      #20 0x0000558698ff9f1a in pfs_spawn_thread (arg=0x154a59845888) at /test/10.5_dbg/storage/perfschema/pfs.cc:2201
      #21 0x0000154a5b11e6db in start_thread (arg=0x154a5bcf7700) at pthread_create.c:463
      #22 0x0000154a5a51c88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.4.13 (dbg), 10.5.2 (dbg), 10.5.3 (dbg)

      Bug confirmed not present in:
      MariaDB: 10.1.45 (dbg), 10.1.45 (opt), 10.2.32 (dbg), 10.2.32 (opt), 10.3.23 (dbg), 10.3.23 (opt), 10.4.13 (opt), 10.5.2 (opt), 10.5.3 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.47 (dbg), 5.6.47 (opt), 5.7.29 (dbg), 5.7.29 (opt), 8.0.19 (dbg), 8.0.19 (opt)

      MariaDB 10.3.23 (dbg):

      10.3.23>USE test;
      Database changed
      10.3.23>SET @@SESSION.collation_connection=utf32_estonian_ci;
      Query OK, 0 rows affected (0.000 sec)
      10.3.23>CREATE TABLE t1(c1 SET('a') COLLATE 'Binary',c2 JSON);
      Query OK, 0 rows affected (0.014 sec)
      

      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:
                Resolved:

                Git Integration

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