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

Server crashes in mysql_prepare_create_table

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.2(EOL), 10.3(EOL)
    • N/A
    • Partitioning
    • None

    Description

      --source include/have_partition.inc
       
      CREATE TABLE t1 (t TEXT DEFAULT '') CHARSET=latin1;
      ALTER TABLE t1 COLLATE utf8_bin;
      --error ER_BAD_FIELD_ERROR
      ALTER TABLE t1 PARTITION BY HASH(f);
      ALTER TABLE t1 ADD COLUMN i INT;
       
      # Cleanup
      DROP TABLE t1;
      

      10.2 aed2050e40cb3

      #3  <signal handler called>
      #4  0x000055834906c61a in mysql_prepare_create_table (thd=0x7ff70c000b00, create_info=0x7ff728527e50, alter_info=0x7ff728527da0, db_options=0x7ff728524f64, file=0x7ff70c013060, key_info_buffer=0x7ff728526588, key_count=0x7ff72852655c, create_table_mode=-2) at /data/src/10.2/sql/sql_table.cc:3379
      #5  0x00005583490703c3 in mysql_create_frm_image (thd=0x7ff70c000b00, db=0x7ff70c012be0 "test", table_name=0x7ff70c012598 "t1", create_info=0x7ff728527e50, alter_info=0x7ff728527da0, create_table_mode=-2, key_info=0x7ff728526588, key_count=0x7ff72852655c, frm=0x7ff7285265e0) at /data/src/10.2/sql/sql_table.cc:4653
      #6  0x0000558349070dde in create_table_impl (thd=0x7ff70c000b00, orig_db=0x7ff70c012be0 "test", orig_table_name=0x7ff70c012598 "t1", db=0x7ff70c012be0 "test", table_name=0x7ff728527280 "#sql-1966_4", path=0x7ff728527aec "./test/#sql-1966_4", options=..., create_info=0x7ff728527e50, alter_info=0x7ff728527da0, create_table_mode=-2, is_trans=0x0, key_info=0x7ff728526588, key_count=0x7ff72852655c, frm=0x7ff7285265e0) at /data/src/10.2/sql/sql_table.cc:4895
      #7  0x000055834907c01d in mysql_alter_table (thd=0x7ff70c000b00, new_db=0x7ff70c012be0 "test", new_name=0x0, create_info=0x7ff728527e50, table_list=0x7ff70c0125d0, alter_info=0x7ff728527da0, order_num=0, order=0x0, ignore=false) at /data/src/10.2/sql/sql_table.cc:9173
      #8  0x00005583490f5fa8 in Sql_cmd_alter_table::execute (this=0x7ff70c012cd0, thd=0x7ff70c000b00) at /data/src/10.2/sql/sql_alter.cc:324
      #9  0x0000558348fb1c3d in mysql_execute_command (thd=0x7ff70c000b00) at /data/src/10.2/sql/sql_parse.cc:6209
      #10 0x0000558348fb6568 in mysql_parse (thd=0x7ff70c000b00, rawbuf=0x7ff70c0124e8 "ALTER TABLE t1 ADD COLUMN i INT", length=31, parser_state=0x7ff728529200, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:7900
      #11 0x0000558348fa4476 in dispatch_command (command=COM_QUERY, thd=0x7ff70c000b00, packet=0x7ff70c16b281 "ALTER TABLE t1 ADD COLUMN i INT", packet_length=31, is_com_multi=false, is_next_command=false) at /data/src/10.2/sql/sql_parse.cc:1805
      #12 0x0000558348fa2dd4 in do_command (thd=0x7ff70c000b00) at /data/src/10.2/sql/sql_parse.cc:1360
      #13 0x00005583490f0c99 in do_handle_one_connection (connect=0x55834c51d5c0) at /data/src/10.2/sql/sql_connect.cc:1335
      #14 0x00005583490f0a26 in handle_one_connection (arg=0x55834c51d5c0) at /data/src/10.2/sql/sql_connect.cc:1241
      #15 0x000055834950fde2 in pfs_spawn_thread (arg=0x55834c4f8090) at /data/src/10.2/storage/perfschema/pfs.cc:1863
      #16 0x00007ff72f723494 in start_thread (arg=0x7ff72852a700) at pthread_create.c:333
      #17 0x00007ff72db0993f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      On a release build I'm getting weird errors instead:

      with InnoDB

      query 'ALTER TABLE t1 ADD COLUMN i INT' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'ibd'
      

      with MyISAM

      query 'ALTER TABLE t1 ADD COLUMN i INT' failed: 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '?C'
      

      Reproducible with at least InnoDB and MyISAM.
      Reproducible with 10.2 and 10.3, not reproducible with 10.1.

      Some more stack traces, to make them searchable:

      10.3 c664c48726cdf

      #3  <signal handler called>
      #4  0x000055873cafa343 in Column_definition::prepare_stage1_string (this=0x7fa36c015630, thd=0x7fa36c000b00, mem_root=0x7fa36c005e00, file=0x7fa36c015748, table_flags=176665231781329) at /data/src/10.3/sql/sql_table.cc:3186
      #5  0x000055873cc07fb3 in Type_handler_string_result::Column_definition_prepare_stage1 (this=0x55873e1921d0 <type_handler_blob>, thd=0x7fa36c000b00, mem_root=0x7fa36c005e00, def=0x7fa36c015630, file=0x7fa36c015748, table_flags=176665231781329) at /data/src/10.3/sql/sql_type.cc:1678
      #6  0x000055873cafa47b in Column_definition::prepare_stage1 (this=0x7fa36c015630, thd=0x7fa36c000b00, mem_root=0x7fa36c005e00, file=0x7fa36c015748, table_flags=176665231781329) at /data/src/10.3/sql/sql_table.cc:3216
      #7  0x000055873cafb02f in mysql_prepare_create_table (thd=0x7fa36c000b00, create_info=0x7fa37d012d60, alter_info=0x7fa37d012cb0, db_options=0x7fa37d00fe54, file=0x7fa36c015748, key_info_buffer=0x7fa37d011498, key_count=0x7fa37d01146c, create_table_mode=-2) at /data/src/10.3/sql/sql_table.cc:3448
      #8  0x000055873cafe9dc in mysql_create_frm_image (thd=0x7fa36c000b00, db=0x7fa36c015250 "test", table_name=0x7fa36c014c08 "t1", create_info=0x7fa37d012d60, alter_info=0x7fa37d012cb0, create_table_mode=-2, key_info=0x7fa37d011498, key_count=0x7fa37d01146c, frm=0x7fa37d0114f0) at /data/src/10.3/sql/sql_table.cc:4643
      #9  0x000055873caff421 in create_table_impl (thd=0x7fa36c000b00, orig_db=0x7fa36c015250 "test", orig_table_name=0x7fa36c014c08 "t1", db=0x7fa36c015250 "test", table_name=0x7fa37d012190 "#sql-1ba6_4", path=0x7fa37d0129fc "./test/#sql-1ba6_4", options=..., create_info=0x7fa37d012d60, alter_info=0x7fa37d012cb0, create_table_mode=-2, is_trans=0x0, key_info=0x7fa37d011498, key_count=0x7fa37d01146c, frm=0x7fa37d0114f0) at /data/src/10.3/sql/sql_table.cc:4885
      #10 0x000055873cb0aa97 in mysql_alter_table (thd=0x7fa36c000b00, new_db=0x7fa36c015250 "test", new_name=0x0, create_info=0x7fa37d012d60, table_list=0x7fa36c014c40, alter_info=0x7fa37d012cb0, order_num=0, order=0x0, ignore=false) at /data/src/10.3/sql/sql_table.cc:9245
      #11 0x000055873cb8b61b in Sql_cmd_alter_table::execute (this=0x7fa36c015368, thd=0x7fa36c000b00) at /data/src/10.3/sql/sql_alter.cc:331
      #12 0x000055873ca3c688 in mysql_execute_command (thd=0x7fa36c000b00) at /data/src/10.3/sql/sql_parse.cc:6251
      #13 0x000055873ca41098 in mysql_parse (thd=0x7fa36c000b00, rawbuf=0x7fa36c014b58 "ALTER TABLE t1 ADD COLUMN i INT", length=31, parser_state=0x7fa37d014610, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:7966
      #14 0x000055873ca2ea0d in dispatch_command (command=COM_QUERY, thd=0x7fa36c000b00, packet=0x7fa36c11ec21 "ALTER TABLE t1 ADD COLUMN i INT", packet_length=31, is_com_multi=false, is_next_command=false) at /data/src/10.3/sql/sql_parse.cc:1824
      #15 0x000055873ca2d441 in do_command (thd=0x7fa36c000b00) at /data/src/10.3/sql/sql_parse.cc:1369
      #16 0x000055873cb86190 in do_handle_one_connection (connect=0x55873fc02680) at /data/src/10.3/sql/sql_connect.cc:1420
      #17 0x000055873cb85f1d in handle_one_connection (arg=0x55873fc02680) at /data/src/10.3/sql/sql_connect.cc:1326
      #18 0x000055873d01583e in pfs_spawn_thread (arg=0x55873fca3b00) at /data/src/10.3/storage/perfschema/pfs.cc:1863
      #19 0x00007fa384a7c494 in start_thread (arg=0x7fa37d015700) at pthread_create.c:333
      #20 0x00007fa382e6293f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      10.2.11 release

      #2  <signal handler called>
      #3  alloc_root (mem_root=0xa, length=208) at /home/buildbot/buildbot/build/mysys/my_alloc.c:216
      #4  0x000055eac7a6129b in operator new (mem_root=<optimized out>, size=<optimized out>) at /home/buildbot/buildbot/build/sql/field.h:706
      #5  Type_handler_int_result::make_num_distinct_aggregator_field (this=<optimized out>, mem_root=<optimized out>, item=0x0) at /home/buildbot/buildbot/build/sql/sql_type.cc:283
      #6  0x000055eac79ce70a in mysql_prepare_create_table (thd=thd@entry=0x7fce7c0009a8, create_info=create_info@entry=0x7fce8e747400, alter_info=alter_info@entry=0x7fce8e747350, db_options=db_options@entry=0x7fce8e744580, file=file@entry=0x7fce7c00fc28, key_info_buffer=key_info_buffer@entry=0x7fce8e745b58, key_count=key_count@entry=0x7fce8e745b1c, create_table_mode=create_table_mode@entry=-2) at /home/buildbot/buildbot/build/sql/sql_table.cc:3379
      #7  0x000055eac79d1014 in mysql_create_frm_image (thd=thd@entry=0x7fce7c0009a8, db=db@entry=0x7fce7c00f7a8 "test", table_name=table_name@entry=0x7fce7c00f160 "t1", create_info=create_info@entry=0x7fce8e747400, alter_info=alter_info@entry=0x7fce8e747350, create_table_mode=create_table_mode@entry=-2, key_info=key_info@entry=0x7fce8e745b58, key_count=key_count@entry=0x7fce8e745b1c, frm=frm@entry=0x7fce8e745b60) at /home/buildbot/buildbot/build/sql/sql_table.cc:4656
      #8  0x000055eac79d4deb in create_table_impl (thd=thd@entry=0x7fce7c0009a8, orig_db=0x7fce7c00f7a8 "test", orig_table_name=0x7fce7c00f160 "t1", db=0x7fce7c00f7a8 "test", table_name=table_name@entry=0x7fce8e746860 "#sql-1c10_4", path=path@entry=0x7fce8e7470cc "./test/#sql-1c10_4", options=..., create_info=create_info@entry=0x7fce8e747400, alter_info=alter_info@entry=0x7fce8e747350, create_table_mode=create_table_mode@entry=-2, is_trans=0x0, is_trans@entry=0x55eaca234638, key_info=key_info@entry=0x7fce8e745b58, key_count=key_count@entry=0x7fce8e745b1c, frm=frm@entry=0x7fce8e745b60) at /home/buildbot/buildbot/build/sql/sql_table.cc:4898
      #9  0x000055eac79d7c11 in mysql_alter_table (thd=thd@entry=0x7fce7c0009a8, new_db=<optimized out>, new_name=<optimized out>, create_info=create_info@entry=0x7fce8e747400, table_list=table_list@entry=0x7fce7c00f198, alter_info=alter_info@entry=0x7fce8e747350, order_num=0, order=0x0, ignore=false) at /home/buildbot/buildbot/build/sql/sql_table.cc:9176
      #10 0x000055eac7a1d38e in Sql_cmd_alter_table::execute (this=<optimized out>, thd=0x7fce7c0009a8) at /home/buildbot/buildbot/build/sql/sql_alter.cc:324
      #11 0x000055eac7952f49 in mysql_execute_command (thd=thd@entry=0x7fce7c0009a8) at /home/buildbot/buildbot/build/sql/sql_parse.cc:6197
      #12 0x000055eac795a48a in mysql_parse (thd=thd@entry=0x7fce7c0009a8, rawbuf=<optimized out>, length=31, parser_state=parser_state@entry=0x7fce8e749260, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /home/buildbot/buildbot/build/sql/sql_parse.cc:7887
      #13 0x000055eac795c7fe in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x7fce7c0009a8, packet=<optimized out>, packet_length=2080436400, packet_length@entry=31, is_com_multi=is_com_multi@entry=false, is_next_command=is_next_command@entry=false) at /home/buildbot/buildbot/build/sql/sql_parse.cc:1805
      #14 0x000055eac795cdbe in do_command (thd=0x7fce7c0009a8) at /home/buildbot/buildbot/build/sql/sql_parse.cc:1360
      #15 0x000055eac7a1a40f in do_handle_one_connection (connect=connect@entry=0x55eaca35c3b8) at /home/buildbot/buildbot/build/sql/sql_connect.cc:1354
      #16 0x000055eac7a1a534 in handle_one_connection (arg=arg@entry=0x55eaca35c3b8) at /home/buildbot/buildbot/build/sql/sql_connect.cc:1260
      #17 0x000055eac7c548ed in pfs_spawn_thread (arg=0x55eaca2fa0a8) at /home/buildbot/buildbot/build/storage/perfschema/pfs.cc:1863
      #18 0x00007fce95085494 in start_thread (arg=0x7fce8e74a700) at pthread_create.c:333
      #19 0x00007fce9474293f in clone () from /lib/x86_64-linux-gnu/libc.so.6
      

      Attachments

        Issue Links

          Activity

            People

              elenst Elena Stepanova
              elenst Elena Stepanova
              Votes:
              1 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.