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

Proposed by Stewart Smith
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) Needs Information
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.
Revision history for this message
Stewart Smith (stewart) wrote :
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

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
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Also, is 5.1 affected?

review: Needs Information
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

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

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
=== added file 'Percona-Server/mysql-test/r/percona_bug1017192.result'
=== added file 'Percona-Server/mysql-test/t/percona_bug1017192.test'
--- Percona-Server/mysql-test/t/percona_bug1017192.test 1970-01-01 00:00:00 +0000
+++ Percona-Server/mysql-test/t/percona_bug1017192.test 2012-09-02 22:32:21 +0000
@@ -0,0 +1,30 @@
1--source include/have_partition.inc
2
3--disable_result_log
4--disable_query_log
5
6CREATE TABLE IF NOT EXISTS t1 (`a` INT) ENGINE=InnoDB;
7INSERT INTO t1 VALUES (1),(2),(3),(4);
8
9--connect (con1,localhost,root,,)
10--let $run = 50
11
12while ($run)
13{
14 --connection default
15 --send ALTER TABLE t1 PARTITION BY HASH (`a`) PARTITIONS 4
16 --connection con1
17 --let $show = 300
18 while ($show)
19 {
20 SHOW ENGINE INNODB STATUS;
21 --dec $show
22 }
23 --connection default
24 --reap
25 --dec $run
26}
27
28DROP TABLE t1;
29--enable_query_log
30--enable_result_log
031
=== modified file 'Percona-Server/sql/sql_table.cc'
--- Percona-Server/sql/sql_table.cc 2012-08-07 06:10:00 +0000
+++ Percona-Server/sql/sql_table.cc 2012-09-02 22:32:21 +0000
@@ -209,7 +209,7 @@
209 int part_name_len= 0;209 int part_name_len= 0;
210 const char *subpart_name= NULL;210 const char *subpart_name= NULL;
211 int subpart_name_len= 0;211 int subpart_name_len= 0;
212 enum enum_file_name_type {NORMAL, TEMP, RENAMED} name_type= NORMAL;212 enum enum_file_name_type {NORMAL, TEMP, RENAMED, ALTER} name_type= NORMAL;
213 const char *tmp_p;213 const char *tmp_p;
214 DBUG_ENTER("explain_filename");214 DBUG_ENTER("explain_filename");
215 DBUG_PRINT("enter", ("from '%s'", from));215 DBUG_PRINT("enter", ("from '%s'", from));
@@ -252,7 +252,7 @@
252 (tmp_p[2] == 'L' || tmp_p[2] == 'l') &&252 (tmp_p[2] == 'L' || tmp_p[2] == 'l') &&
253 tmp_p[3] == '-')253 tmp_p[3] == '-')
254 {254 {
255 name_type= TEMP;255 name_type= ALTER;
256 tmp_p+= 4; /* sql- prefix found */256 tmp_p+= 4; /* sql- prefix found */
257 }257 }
258 else258 else
@@ -298,7 +298,7 @@
298 subpart_name_len= strlen(subpart_name);298 subpart_name_len= strlen(subpart_name);
299 else299 else
300 part_name_len= strlen(part_name);300 part_name_len= strlen(part_name);
301 if (name_type != NORMAL)301 if (name_type == TEMP || name_type == RENAMED)
302 {302 {
303 if (subpart_name)303 if (subpart_name)
304 subpart_name_len-= 5;304 subpart_name_len-= 5;
@@ -342,7 +342,7 @@
342 to_p= strnmov(to_p, ", ", end_p - to_p);342 to_p= strnmov(to_p, ", ", end_p - to_p);
343 if (name_type != NORMAL)343 if (name_type != NORMAL)
344 {344 {
345 if (name_type == TEMP)345 if (name_type == TEMP || name_type == ALTER)
346 to_p= strnmov(to_p, ER_THD_OR_DEFAULT(thd, ER_TEMPORARY_NAME),346 to_p= strnmov(to_p, ER_THD_OR_DEFAULT(thd, ER_TEMPORARY_NAME),
347 end_p - to_p);347 end_p - to_p);
348 else348 else

Subscribers

People subscribed via source and target branches