Commit a5fcced7 authored by Marko Mäkelä's avatar Marko Mäkelä

Merge 5.5 into 10.0

parents 706ed855 547ec8ce
...@@ -4,10 +4,11 @@ ...@@ -4,10 +4,11 @@
create table t1 (f1 int primary key, f2 int, f3 int, unique key k1(f2), create table t1 (f1 int primary key, f2 int, f3 int, unique key k1(f2),
key k2(f3)) engine=innodb; key k2(f3)) engine=innodb;
insert into t1 values (14, 24, 34); insert into t1 values (14, 24, 34);
set @@debug_dbug = '+d,row_ins_sec_index_entry_timeout'; set @old_dbug= @@session.debug_dbug;
set debug_dbug = '+d,row_ins_sec_index_entry_timeout';
replace into t1 values (14, 25, 34); replace into t1 values (14, 25, 34);
select * from t1; select * from t1;
f1 f2 f3 f1 f2 f3
14 25 34 14 25 34
drop table t1; drop table t1;
set @@debug_dbug = '-d,row_ins_sec_index_entry_timeout'; set debug_dbug = @old_dbug;
set names utf8;
SET UNIQUE_CHECKS=0;
CREATE TABLE corrupt_bit_test_ā(
a INT AUTO_INCREMENT PRIMARY KEY,
b CHAR(100),
c INT,
z INT,
INDEX idx(b))
ENGINE=InnoDB;
INSERT INTO corrupt_bit_test_ā VALUES(0,'x',1, 1);
CREATE UNIQUE INDEX idxā ON corrupt_bit_test_ā(c, b);
CREATE UNIQUE INDEX idxē ON corrupt_bit_test_ā(z, b);
SELECT * FROM corrupt_bit_test_ā;
a b c z a b c z
1 x 1 1 1 x 1 1
INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+1,z+1 FROM corrupt_bit_test_ā;
select count(*) from corrupt_bit_test_ā;
count(*) count(*)
2 2
SET @save_dbug = @@SESSION.debug_dbug;
SET debug_dbug = '+d,dict_set_index_corrupted';
check table corrupt_bit_test_ā;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.corrupt_bit_test_ā check Warning InnoDB: Index "idx" is marked as corrupted test.corrupt_bit_test_ā check Warning InnoDB: Index "idx" is marked as corrupted
test.corrupt_bit_test_ā check Warning InnoDB: Index "idxā" is marked as corrupted test.corrupt_bit_test_ā check Warning InnoDB: Index "idxā" is marked as corrupted
test.corrupt_bit_test_ā check Warning InnoDB: Index "idxē" is marked as corrupted test.corrupt_bit_test_ā check Warning InnoDB: Index "idxē" is marked as corrupted
test.corrupt_bit_test_ā check error Corrupt test.corrupt_bit_test_ā check error Corrupt
SET debug_dbug = @save_dbug;
CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c);
ERROR HY000: Index "idx" is corrupted ERROR HY000: Index "idx" is corrupted
CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z);
ERROR HY000: Index "idx" is corrupted ERROR HY000: Index "idx" is corrupted
select c from corrupt_bit_test_ā;
ERROR HY000: Index corrupt_bit_test_ā is corrupted ERROR HY000: Index corrupt_bit_test_ā is corrupted
select z from corrupt_bit_test_ā;
ERROR HY000: Index corrupt_bit_test_ā is corrupted ERROR HY000: Index corrupt_bit_test_ā is corrupted
show warnings;
Level Code Message Level Code Message
Warning 180 InnoDB: Index "idxē" for table "test"."corrupt_bit_test_ā" is marked as corrupted Warning 180 InnoDB: Index "idxē" for table "test"."corrupt_bit_test_ā" is marked as corrupted
Error 1712 Index corrupt_bit_test_ā is corrupted Error 1712 Index corrupt_bit_test_ā is corrupted
insert into corrupt_bit_test_ā values (10001, "a", 20001, 20001);
select * from corrupt_bit_test_ā use index(primary) where a = 10001;
a b c z a b c z
10001 a 20001 20001 10001 a 20001 20001
begin;
insert into corrupt_bit_test_ā values (10002, "a", 20002, 20002);
delete from corrupt_bit_test_ā where a = 10001;
insert into corrupt_bit_test_ā values (10001, "a", 20001, 20001);
rollback;
drop index idxā on corrupt_bit_test_ā;
check table corrupt_bit_test_ā;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.corrupt_bit_test_ā check Warning InnoDB: Index "idx" is marked as corrupted test.corrupt_bit_test_ā check Warning InnoDB: Index "idx" is marked as corrupted
test.corrupt_bit_test_ā check Warning InnoDB: Index "idxē" is marked as corrupted test.corrupt_bit_test_ā check Warning InnoDB: Index "idxē" is marked as corrupted
test.corrupt_bit_test_ā check error Corrupt test.corrupt_bit_test_ā check error Corrupt
set names utf8;
select z from corrupt_bit_test_ā;
ERROR HY000: Index corrupt_bit_test_ā is corrupted ERROR HY000: Index corrupt_bit_test_ā is corrupted
show create table corrupt_bit_test_ā;
Table Create Table Table Create Table
corrupt_bit_test_ā CREATE TABLE `corrupt_bit_test_ā` ( corrupt_bit_test_ā CREATE TABLE `corrupt_bit_test_ā` (
`a` int(11) NOT NULL AUTO_INCREMENT, `a` int(11) NOT NULL AUTO_INCREMENT,
...@@ -31,8 +67,12 @@ corrupt_bit_test_ā CREATE TABLE `corrupt_bit_test_ā` ( ...@@ -31,8 +67,12 @@ corrupt_bit_test_ā CREATE TABLE `corrupt_bit_test_ā` (
UNIQUE KEY `idxē` (`z`,`b`), UNIQUE KEY `idxē` (`z`,`b`),
KEY `idx` (`b`) KEY `idx` (`b`)
) ENGINE=InnoDB AUTO_INCREMENT=10003 DEFAULT CHARSET=latin1 ) ENGINE=InnoDB AUTO_INCREMENT=10003 DEFAULT CHARSET=latin1
drop index idxē on corrupt_bit_test_ā;
CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c);
ERROR HY000: Index "idx" is corrupted ERROR HY000: Index "idx" is corrupted
CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z);
ERROR HY000: Index "idx" is corrupted ERROR HY000: Index "idx" is corrupted
show create table corrupt_bit_test_ā;
Table Create Table Table Create Table
corrupt_bit_test_ā CREATE TABLE `corrupt_bit_test_ā` ( corrupt_bit_test_ā CREATE TABLE `corrupt_bit_test_ā` (
`a` int(11) NOT NULL AUTO_INCREMENT, `a` int(11) NOT NULL AUTO_INCREMENT,
...@@ -42,7 +82,12 @@ corrupt_bit_test_ā CREATE TABLE `corrupt_bit_test_ā` ( ...@@ -42,7 +82,12 @@ corrupt_bit_test_ā CREATE TABLE `corrupt_bit_test_ā` (
PRIMARY KEY (`a`), PRIMARY KEY (`a`),
KEY `idx` (`b`) KEY `idx` (`b`)
) ENGINE=InnoDB AUTO_INCREMENT=10003 DEFAULT CHARSET=latin1 ) ENGINE=InnoDB AUTO_INCREMENT=10003 DEFAULT CHARSET=latin1
drop index idx on corrupt_bit_test_ā;
CREATE INDEX idx3 ON corrupt_bit_test_ā(b, c);
CREATE INDEX idx4 ON corrupt_bit_test_ā(b, z);
select z from corrupt_bit_test_ā limit 10;
z z
20001 20001
1 1
2 2
drop table corrupt_bit_test_ā;
...@@ -8,8 +8,9 @@ ...@@ -8,8 +8,9 @@
create table t1 (f1 int primary key, f2 int, f3 int, unique key k1(f2), create table t1 (f1 int primary key, f2 int, f3 int, unique key k1(f2),
key k2(f3)) engine=innodb; key k2(f3)) engine=innodb;
insert into t1 values (14, 24, 34); insert into t1 values (14, 24, 34);
set @@debug_dbug = '+d,row_ins_sec_index_entry_timeout'; set @old_dbug= @@session.debug_dbug;
set debug_dbug = '+d,row_ins_sec_index_entry_timeout';
replace into t1 values (14, 25, 34); replace into t1 values (14, 25, 34);
select * from t1; select * from t1;
drop table t1; drop table t1;
set @@debug_dbug = '-d,row_ins_sec_index_entry_timeout'; set debug_dbug = @old_dbug;
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
-- source include/have_debug.inc -- source include/have_debug.inc
-- disable_query_log -- disable_query_log
call mtr.add_suppression("Flagged corruption of idx.*in"); call mtr.add_suppression("Flagged corruption of idx.*in ");
-- enable_query_log
set names utf8; set names utf8;
...@@ -37,9 +38,10 @@ INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+1,z+1 FROM corrupt_bit_test_ā; ...@@ -37,9 +38,10 @@ INSERT INTO corrupt_bit_test_ā SELECT 0,b,c+1,z+1 FROM corrupt_bit_test_ā;
select count(*) from corrupt_bit_test_ā; select count(*) from corrupt_bit_test_ā;
# This will flag all secondary indexes corrupted # This will flag all secondary indexes corrupted
SET SESSION debug_dbug="+d,dict_set_index_corrupted"; SET @save_dbug = @@SESSION.debug_dbug;
SET debug_dbug = '+d,dict_set_index_corrupted';
check table corrupt_bit_test_ā; check table corrupt_bit_test_ā;
SET SESSION debug_dbug=""; SET debug_dbug = @save_dbug;
# Cannot create new indexes while corrupted indexes exist # Cannot create new indexes while corrupted indexes exist
--error ER_INDEX_CORRUPT --error ER_INDEX_CORRUPT
......
...@@ -3269,9 +3269,9 @@ void Prepared_statement::cleanup_stmt() ...@@ -3269,9 +3269,9 @@ void Prepared_statement::cleanup_stmt()
DBUG_ENTER("Prepared_statement::cleanup_stmt"); DBUG_ENTER("Prepared_statement::cleanup_stmt");
DBUG_PRINT("enter",("stmt: 0x%lx", (long) this)); DBUG_PRINT("enter",("stmt: 0x%lx", (long) this));
thd->rollback_item_tree_changes();
cleanup_items(free_list); cleanup_items(free_list);
thd->cleanup_after_query(); thd->cleanup_after_query();
thd->rollback_item_tree_changes();
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment