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

Server crashes in mysql_alter_table on an attempt to add a primary key to InnoDB table

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 5.5.36
    • Fix Version/s: 5.5.37
    • Component/s: None
    • Labels:
      None

      Description

      Initially reported as https://github.com/Tokutek/mariadb/issues/48

      
      --source include/have_innodb.inc
      
      CREATE TABLE t1 (a INT) ENGINE = InnoDB;
      INSERT INTO t1 VALUES (2);
      ALTER TABLE t1 ADD PRIMARY KEY (a);
      ALTER TABLE t1 DROP PRIMARY KEY;
      INSERT INTO t1 VALUES (2);
      ALTER TABLE t1 ADD PRIMARY KEY (a);
      
      #3  <signal handler called>
      #4  0x00000000006d169f in mysql_alter_table (thd=0x7fef787d4060, new_db=0x7fef7059c738 "test", new_name=0x7fef7059c138 "t1", create_info=0x7fef807b45f0, table_list=0x7fef7059c170, alter_info=0x7fef807b4550, order_num=0, order=0x0, ignore=false, require_online=false) at /home/elenst/bzr/5.5/sql/sql_table.cc:6911
      #5  0x0000000000956856 in Alter_table_statement::execute (this=0x7fef7059c7f8, thd=0x7fef787d4060) at /home/elenst/bzr/5.5/sql/sql_alter.cc:106
      #6  0x0000000000637706 in mysql_execute_command (thd=0x7fef787d4060) at /home/elenst/bzr/5.5/sql/sql_parse.cc:4513
      #7  0x000000000063a6dc in mysql_parse (thd=0x7fef787d4060, rawbuf=0x7fef7059c078 "ALTER TABLE t1 ADD PRIMARY KEY (a)", length=34, parser_state=0x7fef807b5630) at /home/elenst/bzr/5.5/sql/sql_parse.cc:5800
      #8  0x000000000062e6fe in dispatch_command (command=COM_QUERY, thd=0x7fef787d4060, packet=0x7fef797b8061 "ALTER TABLE t1 ADD PRIMARY KEY (a)", packet_length=34) at /home/elenst/bzr/5.5/sql/sql_parse.cc:1079
      #9  0x000000000062d88a in do_command (thd=0x7fef787d4060) at /home/elenst/bzr/5.5/sql/sql_parse.cc:793
      #10 0x000000000072ea9a in do_handle_one_connection (thd_arg=0x7fef787d4060) at /home/elenst/bzr/5.5/sql/sql_connect.cc:1266
      #11 0x000000000072e559 in handle_one_connection (arg=0x7fef787d4060) at /home/elenst/bzr/5.5/sql/sql_connect.cc:1181
      #12 0x0000000000983679 in pfs_spawn_thread (arg=0x7fef797bd440) at /home/elenst/bzr/5.5/storage/perfschema/pfs.cc:1015
      #13 0x00007fef803edb50 in start_thread (arg=<optimized out>) at pthread_create.c:304
      #14 0x00007fef7ef3ca7d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
      

      Stack trace from:

      revision-id: holyfoot@askmonty.org-20140224194016-dy793va2m3wvjlh3
      revno: 4096
      branch-nick: 5.5
      cmake . -DCMAKE_BUILD_TYPE=Debug && make
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              elenst Elena Stepanova added a comment -

              The problem appeared in 5.5 tree with the following revision:

              revno: 4025
              revision-id: sergii@pisem.net-20140123100459-zxe9qaxoynnrwhgz
              parent: sergii@pisem.net-20140122230305-equgkusccl2y9w5b
              fixes bug: https://mariadb.atlassian.net/browse/MDEV-5406
              committer: Sergei Golubchik <sergii@pisem.net>
              branch nick: 5.5
              timestamp: Thu 2014-01-23 11:04:59 +0100
              message:
                MDEV-5406 add index to an innodb table with a uniqueness violation crashes mysqld
              ...
              
              Show
              elenst Elena Stepanova added a comment - The problem appeared in 5.5 tree with the following revision: revno: 4025 revision-id: sergii@pisem.net-20140123100459-zxe9qaxoynnrwhgz parent: sergii@pisem.net-20140122230305-equgkusccl2y9w5b fixes bug: https://mariadb.atlassian.net/browse/MDEV-5406 committer: Sergei Golubchik <sergii@pisem.net> branch nick: 5.5 timestamp: Thu 2014-01-23 11:04:59 +0100 message: MDEV-5406 add index to an innodb table with a uniqueness violation crashes mysqld ...

                People

                • Assignee:
                  serg Sergei Golubchik
                  Reporter:
                  elenst Elena Stepanova
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 40 minutes
                    40m