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

Assertion `!((system_charset_info)->coll->strcasecmp((system_charset_info), (dict_table_get_col_name( ib_table, j)), (field->field_name.str)))' failed in innobase_build_v_templ

    XMLWordPrintable

Details

    Description

      CREATE TABLE t (a INT,b VARCHAR(1),KEY(a,b)) ENGINE=InnoDB;
      ALTER TABLE t ADD COLUMN x INT GENERATED ALWAYS AS (a+b),ADD INDEX idx (x);
      ALTER TABLE t CHANGE COLUMN b bb VARCHAR(256);
      

      Leads to:

      10.6.0 a3e3225cd3b816d47621e749e21a71b6a864a96a (Debug)

      mysqld: /test/10.6_dbg/storage/innobase/handler/ha_innodb.cc:5246: void innobase_build_v_templ(const TABLE*, const dict_table_t*, dict_vcol_templ_t*, const dict_add_v_col_t*, bool): Assertion `!((system_charset_info)->coll->strcasecmp((system_charset_info), (dict_table_get_col_name( ib_table, j)), (field->field_name.str)))' failed.
      

      10.6.0 a3e3225cd3b816d47621e749e21a71b6a864a96a (Debug)

      Core was generated by `/test/MD150421-mariadb-10.6.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 0x154e849ac700 (LWP 1925542))]
      (gdb) bt
      #0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
      #1  0x0000154e8fe11859 in __GI_abort () at abort.c:79
      #2  0x0000154e8fe11729 in __assert_fail_base (fmt=0x154e8ffa7588 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x55c6870c2a70 "!((system_charset_info)->coll->strcasecmp((system_charset_info), (dict_table_get_col_name( ib_table, j)), (field->field_name.str)))", file=0x55c6870bbc30 "/test/10.6_dbg/storage/innobase/handler/ha_innodb.cc", line=5246, function=<optimized out>) at assert.c:92
      #3  0x0000154e8fe22f36 in __GI___assert_fail (assertion=assertion@entry=0x55c6870c2a70 "!((system_charset_info)->coll->strcasecmp((system_charset_info), (dict_table_get_col_name( ib_table, j)), (field->field_name.str)))", file=file@entry=0x55c6870bbc30 "/test/10.6_dbg/storage/innobase/handler/ha_innodb.cc", line=line@entry=5246, function=function@entry=0x55c6870c2990 "void innobase_build_v_templ(const TABLE*, const dict_table_t*, dict_vcol_templ_t*, const dict_add_v_col_t*, bool)") at assert.c:101
      #4  0x000055c6868b53b3 in innobase_build_v_templ (table=table@entry=0x154e849a8860, ib_table=0x154e2c01eac8, s_templ=s_templ@entry=0x154e2c062ec8, add_v=add_v@entry=0x0, locked=locked@entry=false) at /test/10.6_dbg/storage/innobase/include/dict0dict.h:811
      #5  0x000055c6868e1ff9 in ha_innobase::inplace_alter_table (this=0x154e2c044ca0, altered_table=0x154e849a8860, ha_alter_info=0x154e849a87b0) at /test/10.6_dbg/storage/innobase/handler/handler0alter.cc:8436
      #6  0x000055c6862afeba in handler::ha_inplace_alter_table (ha_alter_info=0x154e849a87b0, altered_table=0x154e849a8860, this=<optimized out>) at /test/10.6_dbg/sql/handler.h:4573
      #7  mysql_inplace_alter_table (thd=thd@entry=0x154e2c000db8, table_list=0x154e2c013cb0, table=table@entry=0x154e2c0443a8, altered_table=altered_table@entry=0x154e849a8860, ha_alter_info=ha_alter_info@entry=0x154e849a87b0, target_mdl_request=target_mdl_request@entry=0x154e849a8db0, alter_ctx=0x154e849a9910) at /test/10.6_dbg/sql/sql_table.cc:8126
      #8  0x000055c6862c3f68 in mysql_alter_table (thd=thd@entry=0x154e2c000db8, new_db=new_db@entry=0x154e2c005838, new_name=new_name@entry=0x154e2c005c60, create_info=create_info@entry=0x154e849aa540, table_list=<optimized out>, table_list@entry=0x154e2c013cb0, alter_info=alter_info@entry=0x154e849aa450, order_num=0, order=0x0, ignore=false, if_exists=false) at /test/10.6_dbg/sql/sql_table.cc:10780
      #9  0x000055c686348421 in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x154e2c000db8) at /test/10.6_dbg/sql/structs.h:564
      #10 0x000055c6861ee3d6 in mysql_execute_command (thd=thd@entry=0x154e2c000db8) at /test/10.6_dbg/sql/sql_parse.cc:5986
      #11 0x000055c6861d4a06 in mysql_parse (thd=thd@entry=0x154e2c000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x154e849ab410) at /test/10.6_dbg/sql/sql_parse.cc:8017
      #12 0x000055c6861e37df in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x154e2c000db8, packet=packet@entry=0x154e2c00b369 "ALTER TABLE t CHANGE COLUMN b bb VARCHAR(256)", packet_length=packet_length@entry=45, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_class.h:1331
      #13 0x000055c6861e6bd5 in do_command (thd=0x154e2c000db8, blocking=blocking@entry=true) at /test/10.6_dbg/sql/sql_parse.cc:1406
      #14 0x000055c68634077c in do_handle_one_connection (connect=<optimized out>, connect@entry=0x55c6887a9718, put_in_cache=put_in_cache@entry=true) at /test/10.6_dbg/sql/sql_connect.cc:1410
      #15 0x000055c686340d81 in handle_one_connection (arg=arg@entry=0x55c6887a9718) at /test/10.6_dbg/sql/sql_connect.cc:1312
      #16 0x000055c6867eea03 in pfs_spawn_thread (arg=0x55c6886cdd28) at /test/10.6_dbg/storage/perfschema/pfs.cc:2201
      #17 0x0000154e9031f609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #18 0x0000154e8ff0e293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.4.19 (dbg), 10.5.10 (dbg), 10.6.0 (dbg)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.38 (dbg), 10.2.38 (opt), 10.3.29 (dbg), 10.3.29 (opt), 10.4.19 (opt), 10.5.10 (opt), 10.6.0 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.33 (dbg), 5.7.33 (opt), 8.0.23 (dbg), 8.0.23 (opt)

      Regression;

      10.3.29 7d5ec9f1aeec1ea8d00a0aa5bfec521948cfb8be (Debug)

      10.3.29-dbg>CREATE TABLE t (a INT,b VARCHAR(1),KEY(a,b)) ENGINE=InnoDB;
      Query OK, 0 rows affected (0.025 sec)
       
      10.3.29-dbg>ALTER TABLE t ADD COLUMN x INT GENERATED ALWAYS AS (a+b),ADD INDEX idx (x);
      Query OK, 0 rows affected (0.029 sec)
      Records: 0  Duplicates: 0  Warnings: 0
       
      10.3.29-dbg>ALTER TABLE t CHANGE COLUMN b bb VARCHAR(256);
      Query OK, 0 rows affected (0.074 sec)              
      Records: 0  Duplicates: 0  Warnings: 0
       
      10.3.29-dbg>
      

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              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.