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

Unexpected ER_NOT_KEYFILE or assertion failure upon ALTER adding unique key to Aria table with DYNAMIC row format

    XMLWordPrintable

Details

    Description

      SET aria_repair_threads=4;
      CREATE TABLE t (a VARCHAR(1), b TINYBLOB) ENGINE=Aria ROW_FORMAT=DYNAMIC;
      INSERT INTO t VALUES
      ('c','xxxxxxxxxxxxxxxx'),('b','n'),('a','x'),('p','p'),
      ('s','n'),('u','5'),('n','n'),('g','m'),('s','n'),('n','x'),('f','7'),('n','9'),
      ('i','0'),('z','n'),('i','v'),('r','n'),('p','e'),('e','x'),('n','x'),('f','7'),
      ('f','x'),('n','x'),('o','a'),('h','n'),('o','n'),('x','5'),('n','m'),('e','n'),
      ('n','r'),('x','x'),('n','s'),('x','8'),('m','r'),('x','x'),('u','n'),('w','c'),
      ('n','n'),('n','c'),('w','x'),('e','d'),('i','1'),('o','3'),('c','n'),('c','x'),
      ('r','x'),('o','n'),('e','s'),('l','n'),('n','n'),('n','s'),('n','s'),('n','x'),
      ('n','u'),('m','n'),('z','x'),('n','4'),('n','x'),('a','i'),('n','1'),('b','s'),
      ('a','n'),('n','n'),('p','1'),('n','c'),('v','n'),('r','w'),('q','s'),('n','n'),
      ('n','x'),('n','d'),('n','x'),('u','s'),('a','x'),('a','n'),('n','x'),('s','n'),
      ('n','x'),('i','x'),('a','n'),('x','n'),('l','x'),('r','x'),('v','x'),('q','c'),
      ('w','n'),('s','1'),('n','p'),('i','c'),('n','e'),('x','g'),('n','n'),('e','x'),
      ('s','n'),('n','m'),('k','1'),('z','x'),('n','1'),('u','n'),('p','i'),('e','x');
      ALTER TABLE t ADD UNIQUE(a);
       
      # Cleanup
      DROP TABLE t;
      

      10.6 3f22f5f2fe76cb95378b57c0095aebe5e0ae5e11

      mariadbd: /data/bld/10.6-asan/mysys/my_malloc.c:150: my_realloc: Assertion `old_flags == ((my_flags & 0x10000U) ? 1 : 0)' failed.
      241219 18:02:07 [ERROR] /mnt8t/bld/10.6-asan/sql/mariadbd got signal 6 ;
       
      #9  0x00007fc0b1e53e32 in __GI___assert_fail (assertion=0x55afdfa85240 "old_flags == ((my_flags & 0x10000U) ? 1 : 0)", file=0x55afdfa84e60 "/data/bld/10.6-asan/mysys/my_malloc.c", line=150, function=0x55afdfa85420 <__PRETTY_FUNCTION__.0> "my_realloc") at ./assert/assert.c:101
      #10 0x000055afde734500 in my_realloc (key=0, old_point=0x60d000010ee8, size=117, my_flags=64) at /data/bld/10.6-asan/mysys/my_malloc.c:150
      #11 0x000055afdd7f64dc in _ma_alloc_buffer (old_addr=0x7fc0a86e1890, old_size=0x7fc0a86e1b58, new_size=117, flag=0) at /data/bld/10.6-asan/storage/maria/ma_open.c:1257
      #12 0x000055afdd8f0718 in sort_get_next_record (sort_param=0x7fc0a86e13c0) at /data/bld/10.6-asan/storage/maria/ma_check.c:5287
      #13 0x000055afdd8dbc05 in maria_repair (param=0x7fc0a6fe9838, info=0x5e36b, name=0x7fc0a86e2c10 "./test/#sql-alter-5e364-4", rep_quick=1 '\001') at /data/bld/10.6-asan/storage/maria/ma_check.c:2814
      #14 0x000055afdd73be58 in ha_maria::repair (this=0x61d0002396b8, thd=0x62b00007e218, param=0x7fc0a6fe9838, do_optimize=false) at /data/bld/10.6-asan/storage/maria/ha_maria.cc:1718
      #15 0x000055afdd73ed7b in ha_maria::enable_indexes (this=0x61d0002396b8, map=..., persist=true) at /data/bld/10.6-asan/storage/maria/ha_maria.cc:2081
      #16 0x000055afdd740a52 in ha_maria::end_bulk_insert (this=0x61d0002396b8) at /data/bld/10.6-asan/storage/maria/ha_maria.cc:2336
      #17 0x000055afdd191ae7 in handler::ha_end_bulk_insert (this=0x61d0002396b8) at /data/bld/10.6-asan/sql/handler.cc:5171
      #18 0x000055afdcbab8f1 in copy_data_between_tables (thd=0x62b00007e218, from=0x619000098898, to=0x6190000a0a98, ignore=false, order_num=0, order=0x0, copied=0x7fc0a86e4110, deleted=0x7fc0a86e4130, alter_info=0x7fc0a86e7080, alter_ctx=0x7fc0a86e61f0) at /data/bld/10.6-asan/sql/sql_table.cc:11654
      #19 0x000055afdcba4e48 in mysql_alter_table (thd=0x62b00007e218, new_db=0x62b000082ec8, new_name=0x62b000083338, create_info=0x7fc0a86e7230, table_list=0x62b000085358, recreate_info=0x7fc0a86e6fc0, alter_info=0x7fc0a86e7080, order_num=0, order=0x0, ignore=false, if_exists=false) at /data/bld/10.6-asan/sql/sql_table.cc:10854
      #20 0x000055afdcd6baf1 in Sql_cmd_alter_table::execute (this=0x62b000085b68, thd=0x62b00007e218) at /data/bld/10.6-asan/sql/sql_alter.cc:675
      #21 0x000055afdc8ec88d in mysql_execute_command (thd=0x62b00007e218, is_called_from_prepared_stmt=false) at /data/bld/10.6-asan/sql/sql_parse.cc:6166
      #22 0x000055afdc8f9a7c in mysql_parse (thd=0x62b00007e218, rawbuf=0x62b000085238 "ALTER TABLE t ADD UNIQUE(a)", length=27, parser_state=0x7fc0a86e8a90) at /data/bld/10.6-asan/sql/sql_parse.cc:8208
      #23 0x000055afdc8cee2b in dispatch_command (command=COM_QUERY, thd=0x62b00007e218, packet=0x62900023f219 "", packet_length=27, blocking=true) at /data/bld/10.6-asan/sql/sql_parse.cc:1908
      #24 0x000055afdc8cbb5f in do_command (thd=0x62b00007e218, blocking=true) at /data/bld/10.6-asan/sql/sql_parse.cc:1421
      #25 0x000055afdcd4cddb in do_handle_one_connection (connect=0x608000002d38, put_in_cache=true) at /data/bld/10.6-asan/sql/sql_connect.cc:1386
      #26 0x000055afdcd4c93a in handle_one_connection (arg=0x608000002cb8) at /data/bld/10.6-asan/sql/sql_connect.cc:1298
      #27 0x000055afdd9c528e in pfs_spawn_thread (arg=0x617000005b98) at /data/bld/10.6-asan/storage/perfschema/pfs.cc:2201
      #28 0x00007fc0b1ea8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #29 0x00007fc0b1f2861c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      A non-debug build doesn't crash, but the error which ALTER produces there seems strange:

      10.6 3f22f5f2fe76cb95378b57c0095aebe5e0ae5e11

      mysqltest: At line 17: query 'ALTER TABLE t ADD UNIQUE(a)' failed: ER_NOT_KEYFILE (1034): Duplicate key  1 for record at        164 against new record at         84
      

      A duplicate key error is expected, but with other row formats it is usual ER_DUP_ENTRY, while here it is ER_NOT_KEYFILE instead.

      Attachments

        Activity

          People

            monty Michael Widenius
            elenst Elena Stepanova
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.