MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: //usr/share/mysql-test/suite/innodb_plugin/t/innodb_bug53592.test
# Testcase for Bug #53592 - "crash replacing duplicates into
# table after fast alter table added unique key". The fix is to make
# sure index number lookup should go through "index translation table".

--source include/have_innodb_plugin.inc

# Use FIC for index creation
set old_alter_table=0;

create table bug53592(a int) engine=innodb row_format=compact;

alter table bug53592 add column b text charset utf8;

alter table bug53592 add column c blob not null;

# Create a non-unique nonclustered index
create index bug53592_b on bug53592(b(81));

# Create a unique index, this unique index should have smaller
# index number than bug53592_b, since unique index ranks higher
# than regular index does
create unique index bug53592_c on bug53592(c(1));

# This will trigger a dup key error and will require fetching
# the index number through a index structure for the error reporting.
# To get the correct index number, the code should go through index
# translation table. Otherwise, it will get the wrong index
# number and later trigger a server crash.
replace into bug53592 values (),();

check table bug53592;

drop table bug53592;

# Running the same set of test when "old_alter_table" is turned on
set old_alter_table=1;

create table bug53592(a int) engine=innodb row_format=compact;

alter table bug53592 add column b text charset utf8;

alter table bug53592 add column c blob not null;

# Create a non-unique nonclustered index
create index bug53592_b on bug53592(b(81));

# Create a unique index
create unique index bug53592_c on bug53592(c(1));

# This will trigger a dup key error and will require fetching
# the index number through a index structure for the error reporting.
# To get the correct index number, the code should go through index
# translation table. Otherwise, it will get the wrong index
# number and later trigger a server crash.
replace into bug53592 values (),();

check table bug53592;

drop table bug53592;