Merge lp:~akopytov/percona-server/bug1233841-5.6 into lp:percona-server/5.6

Proposed by Alexey Kopytov
Status: Merged
Approved by: Alexey Kopytov
Approved revision: no longer in the source branch.
Merged at revision: 499
Proposed branch: lp:~akopytov/percona-server/bug1233841-5.6
Merge into: lp:percona-server/5.6
Diff against target: 124 lines (+83/-2)
3 files modified
Percona-Server/client/mysqldump.c (+7/-2)
Percona-Server/mysql-test/r/percona_mysqldump_innodb_optimize_keys.result (+49/-0)
Percona-Server/mysql-test/t/percona_mysqldump_innodb_optimize_keys.test (+27/-0)
To merge this branch: bzr merge lp:~akopytov/percona-server/bug1233841-5.6
Reviewer Review Type Date Requested Status
Alexey Kopytov (community) Approve
Review via email: mp+196491@code.launchpad.net

Description of the change

Cherry-picked fix for #1233841 from
lp:~pomyks/percona-server/5.5-bug1233841 as that branch was based on a
GCA revision.

To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) :
review: Approve
Revision history for this message
Laurynas Biveinis (laurynas-biveinis) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Percona-Server/client/mysqldump.c'
--- Percona-Server/client/mysqldump.c 2013-10-23 08:48:28 +0000
+++ Percona-Server/client/mysqldump.c 2013-11-25 08:15:58 +0000
@@ -2640,11 +2640,12 @@
2640 const char *constr_from;2640 const char *constr_from;
2641 const char *constr_to;2641 const char *constr_to;
2642 LIST *keydef_node;2642 LIST *keydef_node;
2643 my_bool keys_processed= FALSE;
26432644
2644 strend= create_str + strlen(create_str);2645 strend= create_str + strlen(create_str);
26452646
2646 ptr= create_str;2647 ptr= create_str;
2647 while (*ptr)2648 while (*ptr && !keys_processed)
2648 {2649 {
2649 char *tmp, *orig_ptr, c;2650 char *tmp, *orig_ptr, c;
26502651
@@ -2728,7 +2729,11 @@
2728 {2729 {
2729 char *end;2730 char *end;
27302731
2731 if (last_comma != NULL && *ptr != ')')2732 if (last_comma != NULL && *ptr == ')')
2733 {
2734 keys_processed= TRUE;
2735 }
2736 else if (last_comma != NULL && !keys_processed)
2732 {2737 {
2733 /*2738 /*
2734 It's not the last line of CREATE TABLE, so we have skipped a key2739 It's not the last line of CREATE TABLE, so we have skipped a key
27352740
=== modified file 'Percona-Server/mysql-test/r/percona_mysqldump_innodb_optimize_keys.result'
--- Percona-Server/mysql-test/r/percona_mysqldump_innodb_optimize_keys.result 2013-05-27 03:01:29 +0000
+++ Percona-Server/mysql-test/r/percona_mysqldump_innodb_optimize_keys.result 2013-11-25 08:15:58 +0000
@@ -524,3 +524,52 @@
524524
525######################################525######################################
526DROP TABLE t1;526DROP TABLE t1;
527CREATE TABLE `t1` (
528`id` int(11) NOT NULL AUTO_INCREMENT,
529`c1` int(11) DEFAULT NULL,
530PRIMARY KEY (`id`),
531KEY `c1` (`c1`)
532) ENGINE=InnoDB DEFAULT CHARSET=utf8
533/*!50100 PARTITION BY HASH (id)
534PARTITIONS 2*/;
535######################################
536
537/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
538/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
539/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
540/*!40101 SET NAMES utf8 */;
541/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
542/*!40103 SET TIME_ZONE='+00:00' */;
543/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
544/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
545/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
546/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
547DROP TABLE IF EXISTS `t1`;
548/*!40101 SET @saved_cs_client = @@character_set_client */;
549/*!40101 SET character_set_client = utf8 */;
550CREATE TABLE `t1` (
551 `id` int(11) NOT NULL AUTO_INCREMENT,
552 `c1` int(11) DEFAULT NULL,
553 PRIMARY KEY (`id`)
554) ENGINE=InnoDB DEFAULT CHARSET=utf8
555/*!50100 PARTITION BY HASH (id)
556PARTITIONS 2 */;
557/*!40101 SET character_set_client = @saved_cs_client */;
558
559LOCK TABLES `t1` WRITE;
560/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
561ALTER TABLE `t1` ADD KEY `c1` (`c1`);
562/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
563UNLOCK TABLES;
564/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
565
566/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
567/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
568/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
569/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
570/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
571/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
572/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
573
574######################################
575DROP TABLE t1;
527576
=== modified file 'Percona-Server/mysql-test/t/percona_mysqldump_innodb_optimize_keys.test'
--- Percona-Server/mysql-test/t/percona_mysqldump_innodb_optimize_keys.test 2013-03-26 04:07:47 +0000
+++ Percona-Server/mysql-test/t/percona_mysqldump_innodb_optimize_keys.test 2013-11-25 08:15:58 +0000
@@ -271,5 +271,32 @@
271271
272DROP TABLE t1;272DROP TABLE t1;
273273
274#############################################################################
275# Bug #1233841: mysqldump --innodb-optimize-keys produces incorrect
276# CREATE TABLE statement for partitioned tables
277#############################################################################
278
279CREATE TABLE `t1` (
280 `id` int(11) NOT NULL AUTO_INCREMENT,
281 `c1` int(11) DEFAULT NULL,
282 PRIMARY KEY (`id`),
283 KEY `c1` (`c1`)
284) ENGINE=InnoDB DEFAULT CHARSET=utf8
285/*!50100 PARTITION BY HASH (id)
286PARTITIONS 2*/;
287
288--exec $MYSQL_DUMP --skip-comments --innodb-optimize-keys test t1 >$file
289
290--echo ######################################
291--cat_file $file
292--echo ######################################
293
294# Check that the resulting dump can be imported back
295
296--exec $MYSQL test < $file
297
298--remove_file $file
299
300DROP TABLE t1;
274# Wait till we reached the initial number of concurrent sessions301# Wait till we reached the initial number of concurrent sessions
275--source include/wait_until_count_sessions.inc302--source include/wait_until_count_sessions.inc

Subscribers

People subscribed via source and target branches