Merge lp:~stewart/percona-server/bug1017192 into lp:percona-server/5.5

Proposed by Stewart Smith on 2012-09-02
Status: Work in progress
Proposed branch: lp:~stewart/percona-server/bug1017192
Merge into: lp:percona-server/5.5
Diff against target: 75 lines (+34/-4)
2 files modified
Percona-Server/mysql-test/t/percona_bug1017192.test (+30/-0)
Percona-Server/sql/sql_table.cc (+4/-4)
To merge this branch: bzr merge lp:~stewart/percona-server/bug1017192
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) 2012-09-02 Needs Information on 2012-09-03
Review via email: mp+122426@code.launchpad.net

Description of the change

Fix: Server crashes in add_identifier on concurrent ALTER TABLE and SHOW ENGINE INNODB STATUS

Fix and test case comes from MariaDB. Without fix, test case (just about always) crashes.

http://jenkins.percona.com/view/PS%205.5/job/percona-server-5.5-param/481/

To post a comment you must log in.

Stewart -

It needs a DBUG_SYNC testcase. Also the bug & fix needs an actual explanation. It seems that MariaDB don't have one neither.

review: Needs Fixing

Also, is 5.1 affected?

review: Needs Information

I was told that MariaDB fixed it in a different way, rev. 3491 in 5.5. (did not verify this report).

Unmerged revisions

293. By Stewart Smith on 2012-09-02

Fix bug lp:1017192 Server crashes in add_identifier on concurrent ALTER TABLE and SHOW ENGINE INNODB STATUS

Fix and test comes from MariaDB: https://mariadb.atlassian.net/browse/MDEV-364

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'Percona-Server/mysql-test/r/percona_bug1017192.result'
2=== added file 'Percona-Server/mysql-test/t/percona_bug1017192.test'
3--- Percona-Server/mysql-test/t/percona_bug1017192.test 1970-01-01 00:00:00 +0000
4+++ Percona-Server/mysql-test/t/percona_bug1017192.test 2012-09-02 22:32:21 +0000
5@@ -0,0 +1,30 @@
6+--source include/have_partition.inc
7+
8+--disable_result_log
9+--disable_query_log
10+
11+CREATE TABLE IF NOT EXISTS t1 (`a` INT) ENGINE=InnoDB;
12+INSERT INTO t1 VALUES (1),(2),(3),(4);
13+
14+--connect (con1,localhost,root,,)
15+--let $run = 50
16+
17+while ($run)
18+{
19+ --connection default
20+ --send ALTER TABLE t1 PARTITION BY HASH (`a`) PARTITIONS 4
21+ --connection con1
22+ --let $show = 300
23+ while ($show)
24+ {
25+ SHOW ENGINE INNODB STATUS;
26+ --dec $show
27+ }
28+ --connection default
29+ --reap
30+ --dec $run
31+}
32+
33+DROP TABLE t1;
34+--enable_query_log
35+--enable_result_log
36
37=== modified file 'Percona-Server/sql/sql_table.cc'
38--- Percona-Server/sql/sql_table.cc 2012-08-07 06:10:00 +0000
39+++ Percona-Server/sql/sql_table.cc 2012-09-02 22:32:21 +0000
40@@ -209,7 +209,7 @@
41 int part_name_len= 0;
42 const char *subpart_name= NULL;
43 int subpart_name_len= 0;
44- enum enum_file_name_type {NORMAL, TEMP, RENAMED} name_type= NORMAL;
45+ enum enum_file_name_type {NORMAL, TEMP, RENAMED, ALTER} name_type= NORMAL;
46 const char *tmp_p;
47 DBUG_ENTER("explain_filename");
48 DBUG_PRINT("enter", ("from '%s'", from));
49@@ -252,7 +252,7 @@
50 (tmp_p[2] == 'L' || tmp_p[2] == 'l') &&
51 tmp_p[3] == '-')
52 {
53- name_type= TEMP;
54+ name_type= ALTER;
55 tmp_p+= 4; /* sql- prefix found */
56 }
57 else
58@@ -298,7 +298,7 @@
59 subpart_name_len= strlen(subpart_name);
60 else
61 part_name_len= strlen(part_name);
62- if (name_type != NORMAL)
63+ if (name_type == TEMP || name_type == RENAMED)
64 {
65 if (subpart_name)
66 subpart_name_len-= 5;
67@@ -342,7 +342,7 @@
68 to_p= strnmov(to_p, ", ", end_p - to_p);
69 if (name_type != NORMAL)
70 {
71- if (name_type == TEMP)
72+ if (name_type == TEMP || name_type == ALTER)
73 to_p= strnmov(to_p, ER_THD_OR_DEFAULT(thd, ER_TEMPORARY_NAME),
74 end_p - to_p);
75 else

Subscribers

People subscribed via source and target branches