Merge lp:~akopytov/percona-server/bug857590-5.1 into lp:percona-server/5.1

Proposed by Alexey Kopytov on 2011-09-23
Status: Merged
Approved by: Stewart Smith on 2011-09-27
Approved revision: 290
Merged at revision: 296
Proposed branch: lp:~akopytov/percona-server/bug857590-5.1
Merge into: lp:percona-server/5.1
Diff against target: 105 lines (+91/-0)
1 file modified
patches/innodb_expand_fast_index_creation.patch (+91/-0)
To merge this branch: bzr merge lp:~akopytov/percona-server/bug857590-5.1
Reviewer Review Type Date Requested Status
Oleg Tsarev (community) 2011-09-26 Approve on 2011-09-27
Stewart Smith (community) Approve on 2011-09-27
Laurynas Biveinis 2011-09-23 Approve on 2011-09-26
Review via email: mp+76800@code.launchpad.net
To post a comment you must log in.
289. By Alexey Kopytov on 2011-09-23

Addendum to the fix for bug #857590: adjusted a test result.

290. By Alexey Kopytov on 2011-09-24

Another addendum to the fix for bug #857590: more test results adjustments.

LGTM

review: Approve
Alexey Kopytov (akopytov) wrote :

As discussed with Laurynas, it would be good to have a second reviewer for this MP.

Stewart Smith (stewart) :
review: Approve
Oleg Tsarev (tsarev) wrote :

Fix looks fine.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'patches/innodb_expand_fast_index_creation.patch'
2--- patches/innodb_expand_fast_index_creation.patch 2011-09-22 11:45:56 +0000
3+++ patches/innodb_expand_fast_index_creation.patch 2011-09-24 18:52:23 +0000
4@@ -620,6 +620,14 @@
5 --error ER_DUP_ENTRY
6 alter table t1 drop primary key, add primary key (b);
7 create unique index c on t1 (c);
8+@@ -355,6 +360,7 @@
9+ length(b),b=left(repeat(d,100*a),65535),length(c),c=repeat(d,20*a),d from t1;
10+ show create table t1;
11+ check table t1;
12++--replace_column 9 X
13+ explain select * from t1 where b like 'adfd%';
14+
15+ #
16 --- a/mysql-test/suite/innodb_plugin/t/innodb.test
17 +++ b/mysql-test/suite/innodb_plugin/t/innodb.test
18 @@ -15,6 +15,12 @@
19@@ -1137,3 +1145,86 @@
20 }
21 else
22 {
23+--- /dev/null
24++++ b/mysql-test/r/percona_innodb_expand_fast_index_creation.result
25+@@ -0,0 +1,32 @@
26++CREATE TABLE t1(
27++id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
28++a CHAR(1) NOT NULL,
29++b CHAR(36) NOT NULL) ENGINE=InnoDB;
30++INSERT INTO t1(a,b) VALUES ('a','b');
31++INSERT INTO t1(a,b) SELECT a,b FROM t1;
32++INSERT INTO t1(a,b) SELECT a,b FROM t1;
33++INSERT INTO t1(a,b) SELECT a,b FROM t1;
34++INSERT INTO t1(a,b) SELECT a,b FROM t1;
35++ALTER TABLE t1 ADD KEY (a);
36++EXPLAIN SELECT COUNT(*) FROM t1, t1 t2 WHERE t1.a = t2.a AND t1.b = t2.b;
37++id 1
38++select_type SIMPLE
39++table t1
40++type ALL
41++possible_keys a
42++key NULL
43++key_len NULL
44++ref NULL
45++rows 16
46++Extra
47++id 1
48++select_type SIMPLE
49++table t2
50++type ALL
51++possible_keys a
52++key NULL
53++key_len NULL
54++ref NULL
55++rows 16
56++Extra Using where; Using join buffer
57++DROP TABLE t1;
58+--- /dev/null
59++++ b/mysql-test/t/percona_innodb_expand_fast_index_creation.test
60+@@ -0,0 +1,23 @@
61++--source include/have_innodb.inc
62++
63++########################################################################
64++# Bug #857590: Fast index creation does not update index statistics
65++########################################################################
66++
67++CREATE TABLE t1(
68++ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
69++ a CHAR(1) NOT NULL,
70++ b CHAR(36) NOT NULL) ENGINE=InnoDB;
71++
72++INSERT INTO t1(a,b) VALUES ('a','b');
73++INSERT INTO t1(a,b) SELECT a,b FROM t1;
74++INSERT INTO t1(a,b) SELECT a,b FROM t1;
75++INSERT INTO t1(a,b) SELECT a,b FROM t1;
76++INSERT INTO t1(a,b) SELECT a,b FROM t1;
77++
78++ALTER TABLE t1 ADD KEY (a);
79++
80++--vertical_results
81++EXPLAIN SELECT COUNT(*) FROM t1, t1 t2 WHERE t1.a = t2.a AND t1.b = t2.b;
82++
83++DROP TABLE t1;
84+--- a/storage/innodb_plugin/row/row0merge.c
85++++ b/storage/innodb_plugin/row/row0merge.c
86+@@ -2630,6 +2630,8 @@
87+ }
88+ }
89+
90++ dict_update_statistics(new_table, FALSE, TRUE);
91++
92+ func_exit:
93+ close(tmpfd);
94+
95+--- a/mysql-test/suite/innodb_plugin/r/innodb-index.result
96++++ b/mysql-test/suite/innodb_plugin/r/innodb-index.result
97+@@ -884,7 +884,7 @@
98+ test.t1 check status OK
99+ explain select * from t1 where b like 'adfd%';
100+ id select_type table type possible_keys key key_len ref rows Extra
101+-1 SIMPLE t1 ALL b NULL NULL NULL 15 Using where
102++1 SIMPLE t1 range b b 769 NULL X Using where
103+ create table t2(a int, b varchar(255), primary key(a,b)) engine=innodb;
104+ insert into t2 select a,left(b,255) from t1;
105+ drop table t1;

Subscribers

People subscribed via source and target branches