~ubuntu-branches/debian/squeeze/mysql-5.1/squeeze

« back to all changes in this revision

Viewing changes to mysql-test/suite/innodb_plugin/t/innodb-index.test

  • Committer: Package Import Robot
  • Author(s): Moritz Muehlenhoff
  • Date: 2014-01-14 10:40:30 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20140114104030-44alii0hx3x3g41y
Tags: 5.1.73-1
* New upstream release
  http://dev.mysql.com/doc/relnotes/mysql/5.1/en/news-5-1-73.html
* Update patches
* Disable flaky test rpl.rpl_innodb_bug28430 breaking the build. It's  marked
  as experimental by upstream and the internet is full of reports about it's
  unrelialibity

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
let $MYSQLD_DATADIR= `select @@datadir`;
4
4
 
5
 
let $innodb_file_format_check_orig=`select @@innodb_file_format_check`;
 
5
let $per_table=`select @@innodb_file_per_table`;
 
6
let $format=`select @@innodb_file_format`;
 
7
set global innodb_file_per_table=on;
 
8
set global innodb_file_format='Barracuda';
 
9
 
 
10
# Bug #12429576 - Test an assertion failure on purge.
 
11
CREATE TABLE t1_purge (
 
12
A INT,
 
13
B BLOB, C BLOB, D BLOB, E BLOB,
 
14
F BLOB, G BLOB, H BLOB,
 
15
PRIMARY KEY (B(767), C(767), D(767), E(767), A),
 
16
INDEX (A)
 
17
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
 
18
 
 
19
INSERT INTO t1_purge VALUES (1,
 
20
REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
 
21
REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766));
 
22
 
 
23
CREATE TABLE t2_purge (
 
24
A INT PRIMARY KEY,
 
25
B BLOB, C BLOB, D BLOB, E BLOB,
 
26
F BLOB, G BLOB, H BLOB, I BLOB,
 
27
J BLOB, K BLOB, L BLOB,
 
28
INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
 
29
 
 
30
INSERT INTO t2_purge VALUES (1,
 
31
REPEAT('b', 766), REPEAT('c', 766), REPEAT('d', 766), REPEAT('e', 766),
 
32
REPEAT('f', 766), REPEAT('g', 766), REPEAT('h', 766), REPEAT('i', 766),
 
33
REPEAT('j', 766), REPEAT('k', 766), REPEAT('l', 766));
 
34
 
 
35
CREATE TABLE t3_purge (
 
36
A INT,
 
37
B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
 
38
F VARCHAR(800), G VARCHAR(800), H VARCHAR(800),
 
39
PRIMARY KEY (B(767), C(767), D(767), E(767), A),
 
40
INDEX (A)
 
41
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
 
42
 
 
43
INSERT INTO t3_purge SELECT * FROM t1_purge;
 
44
 
 
45
CREATE TABLE t4_purge (
 
46
A INT PRIMARY KEY,
 
47
B VARCHAR(800), C VARCHAR(800), D VARCHAR(800), E VARCHAR(800),
 
48
F VARCHAR(800), G VARCHAR(800), H VARCHAR(800), I VARCHAR(800),
 
49
J VARCHAR(800), K VARCHAR(800), L VARCHAR(800),
 
50
INDEX (B(767))) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
 
51
 
 
52
INSERT INTO t4_purge SELECT * FROM t2_purge;
 
53
 
 
54
# This would trigger the failure (Bug #12429576)
 
55
# if purge gets a chance to run before DROP TABLE t1_purge, ....
 
56
DELETE FROM t1_purge;
 
57
DELETE FROM t2_purge;
 
58
DELETE FROM t3_purge;
 
59
DELETE FROM t4_purge;
 
60
# Instead of doing a --sleep 10, wait until the rest of the tests in
 
61
# this file complete before dropping the tables.  By then, the purge thread
 
62
# will have delt with the updates above.
 
63
 
 
64
# Bug#12637786 - Bad assert by purge thread for records with external data
 
65
# used in secondary indexes.
 
66
SET @r=REPEAT('a',500);
 
67
CREATE TABLE t12637786(a INT,
 
68
 v1 VARCHAR(500), v2 VARCHAR(500), v3 VARCHAR(500),
 
69
 v4 VARCHAR(500), v5 VARCHAR(500), v6 VARCHAR(500),
 
70
 v7 VARCHAR(500), v8 VARCHAR(500), v9 VARCHAR(500),
 
71
 v10 VARCHAR(500), v11 VARCHAR(500), v12 VARCHAR(500),
 
72
 v13 VARCHAR(500), v14 VARCHAR(500), v15 VARCHAR(500),
 
73
 v16 VARCHAR(500), v17 VARCHAR(500), v18 VARCHAR(500)
 
74
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
 
75
CREATE INDEX idx1 ON t12637786(a,v1);
 
76
INSERT INTO t12637786 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
 
77
UPDATE t12637786 SET a=1000;
 
78
DELETE FROM t12637786;
 
79
# We need to activate the purge thread at this point to make sure it does not
 
80
# assert and is able to clean up the old versions of secondary index entries.
 
81
# But instead of doing a --sleep 10,  wait until the rest of the tests in
 
82
# this file complete before dropping the table.  By then, the purge thread
 
83
# will have delt with the updates above.
 
84
 
 
85
# Bug#12963823 - Test that the purge thread does not crash when
 
86
# the number of indexes has changed since the UNDO record was logged.
 
87
create table t12963823(a blob,b blob,c blob,d blob,e blob,f blob,g blob,h blob,
 
88
                       i blob,j blob,k blob,l blob,m blob,n blob,o blob,p blob)
 
89
        engine=innodb row_format=dynamic;
 
90
SET @r = repeat('a', 767);
 
91
insert into t12963823 values (@r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r, @r,@r,@r,@r);
 
92
create index ndx_a on t12963823 (a(500));
 
93
create index ndx_b on t12963823 (b(500));
 
94
create index ndx_c on t12963823 (c(500));
 
95
create index ndx_d on t12963823 (d(500));
 
96
create index ndx_e on t12963823 (e(500));
 
97
create index ndx_f on t12963823 (f(500));
 
98
create index ndx_k on t12963823 (k(500));
 
99
create index ndx_l on t12963823 (l(500));
 
100
 
 
101
SET @r = repeat('b', 500);
 
102
update t12963823 set a=@r,b=@r,c=@r,d=@r;
 
103
update t12963823 set e=@r,f=@r,g=@r,h=@r;
 
104
update t12963823 set i=@r,j=@r,k=@r,l=@r;
 
105
update t12963823 set m=@r,n=@r,o=@r,p=@r;
 
106
alter table t12963823 drop index ndx_a;
 
107
alter table t12963823 drop index ndx_b;
 
108
create index ndx_g on t12963823 (g(500));
 
109
create index ndx_h on t12963823 (h(500));
 
110
create index ndx_i on t12963823 (i(500));
 
111
create index ndx_j on t12963823 (j(500));
 
112
create index ndx_m on t12963823 (m(500));
 
113
create index ndx_n on t12963823 (n(500));
 
114
create index ndx_o on t12963823 (o(500));
 
115
create index ndx_p on t12963823 (p(500));
 
116
show create table t12963823;
 
117
# We need to activate the purge thread at this point to see if it crashes
 
118
# but instead of doing a --sleep 10,  wait until the rest of the tests in
 
119
# this file complete before dropping the table.  By then, the purge thread
 
120
# will have delt with the updates above.
 
121
 
 
122
# Bug#13654923 BOGUS DEBUG ASSERTION IN INDEX CREATION FOR ZERO-LENGTH RECORD
 
123
create table t1(a varchar(2) primary key) engine=innodb;
 
124
insert into t1 values('');
 
125
create index t1a1 on t1(a(1));
 
126
drop table t1;
 
127
 
 
128
eval set global innodb_file_per_table=$per_table;
 
129
eval set global innodb_file_format=$format;
6
130
 
7
131
create table t1(a int not null, b int, c char(10) not null, d varchar(20)) engine = innodb;
8
132
insert into t1 values (5,5,'oo','oo'),(4,4,'tr','tr'),(3,4,'ad','ad'),(2,3,'ak','ak');
296
420
length(b),b=left(repeat(d,100*a),65535),length(c),c=repeat(d,20*a),d from t1;
297
421
show create table t1;
298
422
check table t1;
 
423
 
 
424
# In my local machine and in pb2 machine only the key_len field is differing.
 
425
# So masking this problematic output.
 
426
--replace_column 9 #
299
427
explain select * from t1 where b like 'adfd%';
300
428
 
301
429
#
360
488
 
361
489
drop table t1;
362
490
 
363
 
let $per_table=`select @@innodb_file_per_table`;
364
 
let $format=`select @@innodb_file_format`;
365
491
set global innodb_file_per_table=on;
366
492
set global innodb_file_format='Barracuda';
367
493
# Test creating a table that could lead to undo log overflow.
404
530
create index t1u on t1 (u(1));
405
531
 
406
532
drop table t1;
 
533
 
 
534
# Bug#12547647 UPDATE LOGGING COULD EXCEED LOG PAGE SIZE
 
535
CREATE TABLE bug12547647(
 
536
a INT NOT NULL, b BLOB NOT NULL, c TEXT,
 
537
PRIMARY KEY (b(10), a), INDEX (c(10))
 
538
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
 
539
INSERT INTO bug12547647 VALUES (5,repeat('khdfo5AlOq',1900),repeat('g',7731));
 
540
COMMIT;
 
541
# The following used to cause infinite undo log allocation.
 
542
--error ER_TOO_BIG_ROWSIZE
 
543
UPDATE bug12547647 SET c = REPEAT('b',16928);
 
544
DROP TABLE bug12547647;
 
545
# Bug#12637786
 
546
SET @r=REPEAT('a',500);
 
547
CREATE TABLE t1(a INT,
 
548
 v1 VARCHAR(500), v2 VARCHAR(500), v3 VARCHAR(500),
 
549
 v4 VARCHAR(500), v5 VARCHAR(500), v6 VARCHAR(500),
 
550
 v7 VARCHAR(500), v8 VARCHAR(500), v9 VARCHAR(500),
 
551
 v10 VARCHAR(500), v11 VARCHAR(500), v12 VARCHAR(500),
 
552
 v13 VARCHAR(500), v14 VARCHAR(500), v15 VARCHAR(500),
 
553
 v16 VARCHAR(500), v17 VARCHAR(500), v18 VARCHAR(500)
 
554
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC;
 
555
 
 
556
CREATE INDEX idx1 ON t1(a,v1);
 
557
INSERT INTO t1 VALUES(9,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r,@r);
 
558
UPDATE t1 SET a=1000;
 
559
DELETE FROM t1;
 
560
# Let the purge thread clean up this file.
 
561
-- sleep 10
 
562
DROP TABLE t1;
 
563
 
407
564
eval set global innodb_file_per_table=$per_table;
408
565
eval set global innodb_file_format=$format;
409
566
eval set global innodb_file_format_check=$format;
542
699
 
543
700
DROP TABLE t1;
544
701
 
545
 
#
546
 
# restore environment to the state it was before this test execution
547
 
#
548
 
 
549
 
eval SET GLOBAL innodb_file_format_check=$innodb_file_format_check_orig;
 
702
# Drop these tables since the purge thread must have run by now
 
703
# and did not crash.
 
704
DROP TABLE t1_purge, t2_purge, t3_purge, t4_purge;
 
705
DROP TABLE t12637786;
 
706
DROP TABLE t12963823;