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

Renaming Spider table fails due to ERROR 1062 (23000): Duplicate entry '...' for key 'PRIMARY'

    XMLWordPrintable

Details

    Description

      INSTALL PLUGIN spider SONAME 'ha_spider.so';
      CREATE TABLE t(c INT) ENGINE=SPIDER PARTITION BY KEY(c) PARTITIONS 2;
      INSERT INTO t VALUES(0);
      RENAME TABLE t TO `......................................................`;
      

      10.5 e44439ab7354c5dff20707325694839e9346fb27

      MariaDB [test]> RENAME TABLE t TO `......................................................`;
      ERROR 1062 (23000): Duplicate entry 'test-@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@002e@...' for key 'PRIMARY'
      


      OLD TITLE: SIGSEGV in spider_free_mem on INSERT after RENAME

      OLD DESCRIPTION

      INSTALL PLUGIN spider SONAME 'ha_spider.so';
      CREATE TABLE t(c INT) ENGINE=SPIDER PARTITION BY KEY(c) PARTITIONS 2;
      INSERT INTO t VALUES(0);
      RENAME TABLE t TO `......................................................`;
      INSERT INTO t VALUES(0);
      

      Leads to:

      10.8.0 ccdf5711a8fff0cd610a91fdcf37c8ff1182878c (Optimized)

      Core was generated by `/test/MD121221-mariadb-10.8.0-linux-x86_64-opt/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x0000154a39b78758 in spider_free_mem (trx=0x15496c03ee68, ptr=0x0, 
          my_flags=0) at /test/10.8_opt/storage/spider/spd_malloc.cc:185
      185	  size = *((uint *) tmp_ptr);
      [Current thread is 1 (Thread 0x154a54060700 (LWP 3081371))]
      (gdb) bt
      #0  0x0000154a39b78758 in spider_free_mem (trx=0x15496c03ee68, ptr=0x0, my_flags=0) at /test/10.8_opt/storage/spider/spd_malloc.cc:185
      #1  0x0000154a39b7d1b5 in ha_spider::~ha_spider (this=0x15496c082a00, __in_chrg=<optimized out>) at /test/10.8_opt/storage/spider/ha_spider.cc:286
      #2  0x000055ad12a3ccec in ha_partition::~ha_partition (this=0x15496c0498b0, __in_chrg=<optimized out>) at /test/10.8_opt/sql/ha_partition.cc:487
      #3  0x000055ad126a90f1 in open_table_from_share (thd=thd@entry=0x15496c000c58, share=share@entry=0x15496c089e80, alias=alias@entry=0x15496c0109c8, db_stat=db_stat@entry=33, prgflag=prgflag@entry=8, ha_open_flags=<optimized out>, outparam=0x15496c04a118, is_create_table=false, partitions_to_open=0x0) at /test/10.8_opt/sql/table.cc:4408
      #4  0x000055ad12547852 in open_table (thd=0x15496c000c58, table_list=0x15496c010980, ot_ctx=0x154a5405ea60) at /test/10.8_opt/sql/sql_base.cc:2003
      #5  0x000055ad1254a85a in open_and_process_table (ot_ctx=0x154a5405ea60, has_prelocking_list=false, prelocking_strategy=0x154a5405ec20, flags=0, counter=0x154a5405eafc, tables=0x15496c010980, thd=0x15496c000c58) at /test/10.8_opt/sql/sql_base.cc:3807
      #6  open_tables (thd=thd@entry=0x15496c000c58, options=@0x15496c0063a0: {m_options = DDL_options_st::OPT_NONE}, start=start@entry=0x154a5405eae8, counter=counter@entry=0x154a5405eafc, flags=flags@entry=0, prelocking_strategy=0x154a5405ec20) at /test/10.8_opt/sql/sql_base.cc:4290
      #7  0x000055ad1254b05a in open_and_lock_tables (thd=thd@entry=0x15496c000c58, options=<optimized out>, tables=<optimized out>, tables@entry=0x15496c010980, derived=derived@entry=true, flags=flags@entry=0, prelocking_strategy=<optimized out>) at /test/10.8_opt/sql/sql_base.cc:5262
      #8  0x000055ad125807ca in open_and_lock_tables (flags=<optimized out>, derived=<optimized out>, tables=<optimized out>, thd=<optimized out>) at /test/10.8_opt/sql/sql_base.h:509
      #9  open_and_lock_for_insert_delayed (table_list=<optimized out>, thd=<optimized out>) at /test/10.8_opt/sql/sql_insert.cc:628
      #10 mysql_insert (thd=thd@entry=0x15496c000c58, table_list=0x15496c010980, fields=@0x15496c005d58: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55ad13726510 <end_of_list>, last = 0x15496c005d58, elements = 0}, <No data fields>}, values_list=@0x15496c005da0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x15496c011588, last = 0x15496c011588, elements = 1}, <No data fields>}, update_fields=@0x15496c005d88: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55ad13726510 <end_of_list>, last = 0x15496c005d88, elements = 0}, <No data fields>}, update_values=@0x15496c005d70: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x55ad13726510 <end_of_list>, last = 0x15496c005d70, elements = 0}, <No data fields>}, duplic=<optimized out>, ignore=<optimized out>, result=<optimized out>) at /test/10.8_opt/sql/sql_insert.cc:753
      #11 0x000055ad125bbe69 in mysql_execute_command (thd=0x15496c000c58, is_called_from_prepared_stmt=<optimized out>) at /test/10.8_opt/sql/sql_parse.cc:4563
      #12 0x000055ad125ab986 in mysql_parse (thd=0x15496c000c58, rawbuf=<optimized out>, length=<optimized out>, parser_state=<optimized out>) at /test/10.8_opt/sql/sql_parse.cc:8028
      #13 0x000055ad125b7b35 in dispatch_command (command=COM_QUERY, thd=0x15496c000c58, packet=<optimized out>, packet_length=<optimized out>, blocking=<optimized out>) at /test/10.8_opt/sql/sql_class.h:1360
      #14 0x000055ad125b9d27 in do_command (thd=0x15496c000c58, blocking=blocking@entry=true) at /test/10.8_opt/sql/sql_parse.cc:1402
      #15 0x000055ad126d82e7 in do_handle_one_connection (connect=<optimized out>, put_in_cache=true) at /test/10.8_opt/sql/sql_connect.cc:1418
      #16 0x000055ad126d862d in handle_one_connection (arg=arg@entry=0x55ad14a1dbe8) at /test/10.8_opt/sql/sql_connect.cc:1312
      #17 0x000055ad12a465d8 in pfs_spawn_thread (arg=0x55ad149d5218) at /test/10.8_opt/storage/perfschema/pfs.cc:2201
      #18 0x0000154a5cdd7609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #19 0x0000154a5c9c5293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      10.8.0 ccdf5711a8fff0cd610a91fdcf37c8ff1182878c (Debug)

      Core was generated by `/test/MD121221-mariadb-10.8.0-linux-x86_64-dbg/bin/mysqld --no-defaults --core-'.
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  spider_free_mem (trx=0x147b8c055318, ptr=ptr@entry=0x0, 
          my_flags=my_flags@entry=0)
          at /test/10.8_dbg/storage/spider/spd_malloc.cc:185
      185	  size = *((uint *) tmp_ptr);
      [Current thread is 1 (Thread 0x147c2cc27700 (LWP 3081936))]
      (gdb) bt
      #0  spider_free_mem (trx=0x147b8c055318, ptr=ptr@entry=0x0, my_flags=my_flags@entry=0) at /test/10.8_dbg/storage/spider/spd_malloc.cc:185
      #1  0x0000147c1411bc7d in ha_spider::~ha_spider (this=0x147b8c097670, __in_chrg=<optimized out>) at /test/10.8_dbg/storage/spider/ha_spider.cc:292
      #2  0x0000147c1411bd5d in ha_spider::~ha_spider (this=0x147b8c097670, __in_chrg=<optimized out>) at /test/10.8_dbg/storage/spider/ha_spider.cc:278
      #3  0x00005581a32d8316 in ha_partition::~ha_partition (this=0x147b8c066460, __in_chrg=<optimized out>) at /test/10.8_dbg/sql/ha_partition.cc:487
      #4  0x00005581a32d8449 in ha_partition::~ha_partition (this=0x147b8c066460, __in_chrg=<optimized out>) at /test/10.8_dbg/sql/ha_partition.cc:478
      #5  0x00005581a2e23cac in open_table_from_share (thd=thd@entry=0x147b8c000db8, share=share@entry=0x147b8c030990, alias=alias@entry=0x147b8c013ee8, db_stat=db_stat@entry=33, prgflag=prgflag@entry=8, ha_open_flags=<optimized out>, outparam=0x147b8c085ff8, is_create_table=false, partitions_to_open=0x0) at /test/10.8_dbg/sql/table.cc:4408
      #6  0x00005581a2c57027 in open_table (thd=thd@entry=0x147b8c000db8, table_list=table_list@entry=0x147b8c013ea0, ot_ctx=ot_ctx@entry=0x147c2cc25aa0) at /test/10.8_dbg/sql/sql_base.cc:2003
      #7  0x00005581a2c5b76b in open_and_process_table (ot_ctx=0x147c2cc25aa0, has_prelocking_list=false, prelocking_strategy=0x147c2cc25c80, flags=0, counter=0x147c2cc25b3c, tables=0x147b8c013ea0, thd=0x147b8c000db8) at /test/10.8_dbg/sql/sql_base.cc:3807
      #8  open_tables (thd=thd@entry=0x147b8c000db8, options=@0x147b8c0066c0: {m_options = DDL_options_st::OPT_NONE}, start=start@entry=0x147c2cc25b28, counter=counter@entry=0x147c2cc25b3c, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x147c2cc25c80) at /test/10.8_dbg/sql/sql_base.cc:4290
      #9  0x00005581a2c5c868 in open_and_lock_tables (thd=thd@entry=0x147b8c000db8, options=@0x147b8c0066c0: {m_options = DDL_options_st::OPT_NONE}, tables=<optimized out>, tables@entry=0x147b8c013ea0, derived=derived@entry=true, flags=flags@entry=0, prelocking_strategy=prelocking_strategy@entry=0x147c2cc25c80) at /test/10.8_dbg/sql/sql_base.cc:5262
      #10 0x00005581a2cabec7 in open_and_lock_tables (flags=0, derived=true, tables=0x147b8c013ea0, thd=0x147b8c000db8) at /test/10.8_dbg/sql/sql_base.h:509
      #11 mysql_insert (thd=thd@entry=0x147b8c000db8, table_list=0x147b8c013ea0, fields=@0x147b8c006078: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x5581a4328b00 <end_of_list>, last = 0x147b8c006078, elements = 0}, <No data fields>}, values_list=@0x147b8c0060c0: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x147b8c014aa8, last = 0x147b8c014aa8, elements = 1}, <No data fields>}, update_fields=@0x147b8c0060a8: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x5581a4328b00 <end_of_list>, last = 0x147b8c0060a8, elements = 0}, <No data fields>}, update_values=@0x147b8c006090: {<base_list> = {<Sql_alloc> = {<No data fields>}, first = 0x5581a4328b00 <end_of_list>, last = 0x147b8c006090, elements = 0}, <No data fields>}, duplic=DUP_ERROR, ignore=false, result=0x0) at /test/10.8_dbg/sql/sql_insert.cc:758
      #12 0x00005581a2cf43d3 in mysql_execute_command (thd=thd@entry=0x147b8c000db8, is_called_from
       
      Bug confirmed present in:
      MariaDB: 10.5.14 (dbg), 10.5.14 (opt), 10.6.6 (dbg), 10.6.6 (opt), 10.7.2 (dbg), 10.7.2 (opt), 10.8.0 (dbg), 10.8.0 (opt)
       
      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.42 (dbg), 10.2.42 (opt), 10.3.33 (dbg), 10.3.33 (opt), 10.4.23 (dbg), 10.4.23 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.36 (dbg), 5.7.36 (opt), 8.0.27 (dbg), 8.0.27 (opt)
      _prepared_stmt=is_called_from_prepared_stmt@entry=false) at /test/10.8_dbg/sql/sql_parse.cc:4563
      #13 0x00005581a2cdee0f in mysql_parse (thd=thd@entry=0x147b8c000db8, rawbuf=<optimized out>, length=<optimized out>, parser_state=parser_state@entry=0x147c2cc26400) at /test/10.8_dbg/sql/sql_parse.cc:8028
      #14 0x00005581a2cedaab in dispatch_command (command=command@entry=COM_QUERY, thd=thd@entry=0x147b8c000db8, packet=packet@entry=0x147b8c00b879 "INSERT INTO t VALUES(0)", packet_length=packet_length@entry=23, blocking=blocking@entry=true) at /test/10.8_dbg/sql/sql_class.h:1360
      #15 0x00005581a2cf0eea in do_command (thd=0x147b8c000db8, blocking=blocking@entry=true) at /test/10.8_dbg/sql/sql_parse.cc:1402
      #16 0x00005581a2e6a89c in do_handle_one_connection (connect=<optimized out>, connect@entry=0x5581a6a0d988, put_in_cache=put_in_cache@entry=true) at /test/10.8_dbg/sql/sql_connect.cc:1418
      #17 0x00005581a2e6aea1 in handle_one_connection (arg=arg@entry=0x5581a6a0d988) at /test/10.8_dbg/sql/sql_connect.cc:1312
      #18 0x00005581a32ec442 in pfs_spawn_thread (arg=0x5581a6921fb8) at /test/10.8_dbg/storage/perfschema/pfs.cc:2201
      #19 0x0000147c3639a609 in start_thread (arg=<optimized out>) at pthread_create.c:477
      #20 0x0000147c35f88293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
      

      Bug confirmed present in:
      MariaDB: 10.5.14 (dbg), 10.5.14 (opt), 10.6.6 (dbg), 10.6.6 (opt), 10.7.2 (dbg), 10.7.2 (opt), 10.8.0 (dbg), 10.8.0 (opt)

      Bug (or feature/syntax) confirmed not present in:
      MariaDB: 10.2.42 (dbg), 10.2.42 (opt), 10.3.33 (dbg), 10.3.33 (opt), 10.4.23 (dbg), 10.4.23 (opt)
      MySQL: 5.5.62 (dbg), 5.5.62 (opt), 5.6.51 (dbg), 5.6.51 (opt), 5.7.36 (dbg), 5.7.36 (opt), 8.0.27 (dbg), 8.0.27 (opt)

      Attachments

        Issue Links

          Activity

            People

              ycp Yuchen Pei
              Roel Roel Van de Paar
              Votes:
              0 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.