List:Internals« Previous MessageNext Message »
From:Rich Prohaska Date:July 10 2012 2:08pm
Subject:possible bug in the 5.6.6 alter inplace software
View as plain text  
Hello,

We found a alter table statement that adds columns to a table sets the
ADD and DROP INDEX flags in the alter inplace info struct.  When
running the attached mysql test program, innodb's
check_if_supported_inplace_alter gets called with unexpected
handler_flags set (handler_flags = 2115 = ADD_INDEX + DROP_INDEX +
ADD_COLUMN + ALTER_COLUMN_ORDER).  The fill_if_supported_inplace_alter
function is probably at fault.  We are using
mysql-5.6.6-labs-june-2012.

Thanks
Rich Prohaska


Breakpoint 1, ha_innobase::check_if_supported_inplace_alter
(this=0x7fff9c00ead0, altered_table=0x7fff9c00d780,
ha_alter_info=0x7ffff44e9ad0) at
/home/prohaska/mysql566-build/mysql-5.6.6-labs-june-2012\
/storage/innobase/handler/handler0alter.cc:161
(gdb) p *ha_alter_info
$2 = {static ADD_INDEX = 1, static DROP_INDEX = 2, static
ADD_UNIQUE_INDEX = 4, static DROP_UNIQUE_INDEX = 8, static
ADD_PK_INDEX = 16, static DROP_PK_INDEX = 32, static ADD_COLUMN = 64,
static DROP_CO\
LUMN = 18446744073709551488, static ALTER_COLUMN_NAME = 256, static
ALTER_COLUMN_TYPE = 512, static ALTER_COLUMN_EQUAL_PACK_LENGTH = 1024,
static ALTER_COLUMN_ORDER = 2048, static ALTER_COLUMN_NULLABLE\
 = 4096, static ALTER_COLUMN_NOT_NULLABLE = 8192, static
ALTER_COLUMN_DEFAULT = 16384, static ADD_FOREIGN_KEY =
18446744073709518848, static DROP_FOREIGN_KEY = 65536, static
CHANGE_CREATE_OPTION = 1310\
72, static ALTER_RENAME = 262144, static ALTER_COLUMN_STORAGE_TYPE =
524288, static ALTER_COLUMN_COLUMN_FORMAT = 1048576, create_info =
0x7ffff44eaea0, alter_info = 0x7ffff44eaf70, key_info_buffer = 0x\
7fff9c009cc8, key_count = 8, index_drop_count = 1, index_drop_buffer =
0x7fff9c00ab28, index_add_count = 1, index_add_buffer =
0x7fff9c00ab68, handler_ctx = 0x0, handler_flags = 2115, ignore =
false}

$ cat 3478-innodb.test
--source include/have_innodb.inc
SET STORAGE_ENGINE = 'innodb';

--disable_warnings
DROP TABLE IF EXISTS foo;
--enable_warnings

CREATE TABLE `foo` (
  `a0` bigint(20) unsigned NOT NULL,
  `a1` varchar(63) NOT NULL,
  `a2` varchar(128) DEFAULT NULL,
  `a3` varchar(32) DEFAULT NULL,
  `a4` varchar(8) DEFAULT NULL,
  `a5` varchar(256) DEFAULT NULL,
  `a6` varchar(6) DEFAULT NULL,
  `a7` int(11) DEFAULT NULL,
  `a8` int(11) DEFAULT NULL,
  `a9` varchar(256) DEFAULT NULL,
  `a10` varchar(32) DEFAULT NULL,
  `a11` enum('yes','no') NOT NULL DEFAULT 'no',
  `a12` enum('yes','no') NOT NULL DEFAULT 'no',
  `a13` int(11) NOT NULL DEFAULT '0',
  `a14` int(11) NOT NULL DEFAULT '0',
  `a15` int(11) NOT NULL DEFAULT '0',
  `a16` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`a0`),
  UNIQUE KEY `a2` (`a2`),
  KEY `a3` (`a3`),
  KEY `a5` (`a5`(50)),
  KEY `a10` (`a10`),
  KEY `a13` (`a13`),
  KEY `a15` (`a15`),
  KEY `a12` (`a12`)
);

ALTER TABLE `foo` ADD `b0` TINYINT NULL AFTER `a9` ,
ADD `b1` INT NOT NULL DEFAULT '0' AFTER `b0` ,
ADD `b2` INT NOT NULL DEFAULT '0' AFTER `b1`;


DROP TABLE foo;
Thread
possible bug in the 5.6.6 alter inplace softwareRich Prohaska10 Jul
  • Re: possible bug in the 5.6.6 alter inplace softwareDmitry Lenev10 Jul
    • Re: possible bug in the 5.6.6 alter inplace softwareRich Prohaska10 Jul
      • Re: possible bug in the 5.6.6 alter inplace softwareRich Prohaska10 Jul