Merge lp:~akopytov/percona-xtrabackup/rebase-2.1-on-newer-server-versions into lp:percona-xtrabackup/2.1

Proposed by Alexey Kopytov
Status: Merged
Approved by: Laurynas Biveinis
Approved revision: no longer in the source branch.
Merged at revision: 630
Proposed branch: lp:~akopytov/percona-xtrabackup/rebase-2.1-on-newer-server-versions
Merge into: lp:percona-xtrabackup/2.1
Diff against target: 4471 lines (+762/-724)
12 files modified
Makefile (+9/-39)
patches/innodb51.patch (+87/-88)
patches/innodb55.patch (+99/-92)
patches/innodb56.patch (+70/-67)
patches/xtradb51.patch (+114/-119)
patches/xtradb55.patch (+238/-228)
src/Makefile (+1/-1)
src/compact.cc (+1/-1)
src/innodb_int.cc (+58/-2)
src/innodb_int.h (+52/-2)
src/xtrabackup.cc (+8/-12)
utils/build.sh (+25/-73)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/rebase-2.1-on-newer-server-versions
Reviewer Review Type Date Requested Status
Laurynas Biveinis (community) Approve
Review via email: mp+176200@code.launchpad.net

Description of the change

Rebased XtraBackup on MySQL versions 5.1.70, 5.5.30, 5.6.11 and Percona
Server versions 5.1.70-rel14.8 and 5.5.31-rel30.3.

To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote :

http://jenkins.percona.com/view/XtraBackup/job/percona-xtrabackup-2.1-param/382/

innodb56/xtradb56 failures are bug #1203669.

galera55 failures are bug #1201686 and bug #1203668 (currently being looked at by Raghu).

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

Indentation or tabs vs spaces in diff lines 4377 to the end?

review: Needs Fixing
Revision history for this message
Alexey Kopytov (akopytov) wrote :

I have standardized on spaces for indentation for XB shell scripts, because that's what the majority of code uses. I fix that in existing code whenever I have to touch a line. I deliberately kept tabs on the lines I didn't have to touch to simplify the patch.

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

OK

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Makefile'
--- Makefile 2013-06-18 08:07:48 +0000
+++ Makefile 2013-07-22 14:01:36 +0000
@@ -4,61 +4,31 @@
44
5# Here we specify what server versions we build against5# Here we specify what server versions we build against
66
7MYSQL_51_SOURCE=mysql-5.1.59.tar.gz7MYSQL_51_SOURCE=mysql-5.1.70.tar.gz
8MYSQL_55_SOURCE=mysql-5.5.17.tar.gz8MYSQL_55_SOURCE=mysql-5.5.31.tar.gz
9MYSQL_56_SOURCE=mysql-5.6.10.tar.gz9MYSQL_56_SOURCE=mysql-5.6.11.tar.gz
10PS_51_VERSION=5.1.59-13.010PS_51_SOURCE=Percona-Server-5.1.70-rel14.8.tar.gz
11PS_51_SOURCE=Percona-Server-XtraBackup-$(PS_51_VERSION).tar.gz11PS_55_SOURCE=Percona-Server-5.5.31-rel30.3.tar.gz
12PS_55_VERSION=5.5.16-22.0
13PS_55_SOURCE=Percona-Server-XtraBackup-$(PS_55_VERSION).tar.gz
14BZR_REVNO=$(shell bzr revno 2>/dev/null || cat REVNO)12BZR_REVNO=$(shell bzr revno 2>/dev/null || cat REVNO)
15XTRABACKUP_VERSION=$(shell sed -e 's/XTRABACKUP_VERSION=//' < VERSION)13XTRABACKUP_VERSION=$(shell sed -e 's/XTRABACKUP_VERSION=//' < VERSION)
1614
17# targets for fetching server source tarballs15# targets for fetching server source tarballs
1816
19SERVER_SOURCE_TARBALLS=$(MYSQL_51_SOURCE) $(MYSQL_55_SOURCE) $(MYSQL_56_SOURCE)17SERVER_SOURCE_TARBALLS=$(MYSQL_51_SOURCE) $(MYSQL_55_SOURCE) \
20PS_SERVER=$(PS_51_SOURCE) $(PS_55_SOURCE)18 $(MYSQL_56_SOURCE) $(PS_51_SOURCE) $(PS_55_SOURCE)
21
22# PS server source tarballs are inadequate
23# for these older versions, so we have to make them ourselves
2419
25.PHONY: ps51source ps55source20.PHONY: ps51source ps55source
2621
27ps51source: $(PS_51_SOURCE)22ps51source: $(PS_51_SOURCE)
2823
29
30$(PS_51_SOURCE):
31 rm -rf percona-server-5.1-xtrabackup
32 bzr branch -r tag:Percona-Server-$(PS_51_VERSION) lp:percona-server/5.1 percona-server-5.1-xtrabackup
33 cd percona-server-5.1-xtrabackup && bzr export percona-server-5.1-xtrabackup.tar.gz
34 mv percona-server-5.1-xtrabackup/percona-server-5.1-xtrabackup.tar.gz .
35 rm -rf percona-server-5.1-xtrabackup
36 tar xfz percona-server-5.1-xtrabackup.tar.gz
37 cd percona-server-5.1-xtrabackup && make mysql-$(shell echo $(PS_51_VERSION) | sed -e 's/-.*//').tar.gz
38 rm percona-server-5.1-xtrabackup.tar.gz
39 tar cfz $(PS_51_SOURCE) percona-server-5.1-xtrabackup
40 rm -rf percona-server-5.1-xtrabackup
41
42ps55source: $(PS_55_SOURCE)24ps55source: $(PS_55_SOURCE)
4325
44$(PS_55_SOURCE):
45 rm -rf percona-server-5.5-xtrabackup
46 bzr branch -r tag:Percona-Server-$(PS_55_VERSION) lp:percona-server/5.5 percona-server-5.5-xtrabackup
47 cd percona-server-5.5-xtrabackup && bzr export percona-server-5.5-xtrabackup.tar.gz
48 mv percona-server-5.5-xtrabackup/percona-server-5.5-xtrabackup.tar.gz .
49 rm -rf percona-server-5.5-xtrabackup
50 tar xfz percona-server-5.5-xtrabackup.tar.gz
51 cd percona-server-5.5-xtrabackup && make mysql-$(shell echo $(PS_55_VERSION) | sed -e 's/-.*//').tar.gz
52 rm percona-server-5.5-xtrabackup.tar.gz
53 tar cfz $(PS_55_SOURCE) percona-server-5.5-xtrabackup
54 rm -rf percona-server-5.5-xtrabackup
55
56# source dist targets26# source dist targets
5727
58dist: $(SERVER_SOURCE_TARBALLS) $(PS_SERVER)28dist: $(SERVER_SOURCE_TARBALLS)
59 bzr export percona-xtrabackup-$(XTRABACKUP_VERSION).tar.gz29 bzr export percona-xtrabackup-$(XTRABACKUP_VERSION).tar.gz
60 tar xfz percona-xtrabackup-$(XTRABACKUP_VERSION).tar.gz30 tar xfz percona-xtrabackup-$(XTRABACKUP_VERSION).tar.gz
61 cp $(SERVER_SOURCE_TARBALLS) $(PS_SERVER) percona-xtrabackup-$(XTRABACKUP_VERSION)/31 cp $(SERVER_SOURCE_TARBALLS) percona-xtrabackup-$(XTRABACKUP_VERSION)/
62 echo $(BZR_REVNO) > percona-xtrabackup-$(XTRABACKUP_VERSION)/REVNO32 echo $(BZR_REVNO) > percona-xtrabackup-$(XTRABACKUP_VERSION)/REVNO
63 rm percona-xtrabackup-$(XTRABACKUP_VERSION).tar.gz33 rm percona-xtrabackup-$(XTRABACKUP_VERSION).tar.gz
64 tar cfz percona-xtrabackup-$(XTRABACKUP_VERSION)-$(BZR_REVNO).tar.gz percona-xtrabackup-$(XTRABACKUP_VERSION)34 tar cfz percona-xtrabackup-$(XTRABACKUP_VERSION)-$(BZR_REVNO).tar.gz percona-xtrabackup-$(XTRABACKUP_VERSION)
6535
=== modified file 'patches/innodb51.patch'
--- patches/innodb51.patch 2013-05-07 13:32:47 +0000
+++ patches/innodb51.patch 2013-07-22 14:01:36 +0000
@@ -9,7 +9,7 @@
9 buf_block_t*9 buf_block_t*
10 btr_root_block_get(10 btr_root_block_get(
11 /*===============*/11 /*===============*/
12@@ -1122,7 +1122,7 @@12@@ -1169,7 +1169,7 @@
13 /************************************************************//**13 /************************************************************//**
14 Returns the child page of a node pointer and x-latches it.14 Returns the child page of a node pointer and x-latches it.
15 @return child page, x-latched */15 @return child page, x-latched */
@@ -18,16 +18,6 @@
18 buf_block_t*18 buf_block_t*
19 btr_node_ptr_get_child(19 btr_node_ptr_get_child(
20 /*===================*/20 /*===================*/
21--- a/storage/innodb_plugin/btr/btr0cur.c
22+++ b/storage/innodb_plugin/btr/btr0cur.c
23@@ -3308,6 +3308,7 @@
24 byte* field;
25
26 field = rec_get_nth_field(rec, offsets, i, &rec_len);
27+ (void)field;
28
29 if (rec_len != UNIV_SQL_NULL) {
30 n_not_null[i]++;
31--- a/storage/innodb_plugin/buf/buf0buf.c21--- a/storage/innodb_plugin/buf/buf0buf.c
32+++ b/storage/innodb_plugin/buf/buf0buf.c22+++ b/storage/innodb_plugin/buf/buf0buf.c
33@@ -51,6 +51,7 @@23@@ -51,6 +51,7 @@
@@ -38,7 +28,7 @@
38 28
39 /*29 /*
40 IMPLEMENTATION OF THE BUFFER POOL30 IMPLEMENTATION OF THE BUFFER POOL
41@@ -358,7 +359,7 @@31@@ -350,7 +351,7 @@
42 return(TRUE);32 return(TRUE);
43 }33 }
44 34
@@ -47,7 +37,7 @@
47 if (recv_lsn_checks_on) {37 if (recv_lsn_checks_on) {
48 ib_uint64_t current_lsn;38 ib_uint64_t current_lsn;
49 39
50@@ -670,6 +671,7 @@40@@ -662,6 +663,7 @@
51 block->page.in_flush_list = FALSE;41 block->page.in_flush_list = FALSE;
52 block->page.in_free_list = FALSE;42 block->page.in_free_list = FALSE;
53 block->page.in_LRU_list = FALSE;43 block->page.in_LRU_list = FALSE;
@@ -55,7 +45,7 @@
55 block->in_unzip_LRU_list = FALSE;45 block->in_unzip_LRU_list = FALSE;
56 #endif /* UNIV_DEBUG */46 #endif /* UNIV_DEBUG */
57 #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG47 #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
58@@ -1690,7 +1692,9 @@48@@ -1588,7 +1590,9 @@
59 ut_ad(zip_size == fil_space_get_zip_size(space));49 ut_ad(zip_size == fil_space_get_zip_size(space));
60 ut_ad(ut_is_2pow(zip_size));50 ut_ad(ut_is_2pow(zip_size));
61 #ifndef UNIV_LOG_DEBUG51 #ifndef UNIV_LOG_DEBUG
@@ -66,7 +56,7 @@
66 #endif56 #endif
67 buf_pool->stat.n_page_gets++;57 buf_pool->stat.n_page_gets++;
68 loop:58 loop:
69@@ -2802,6 +2806,12 @@59@@ -2704,6 +2708,12 @@
70 frame = ((buf_block_t*) bpage)->frame;60 frame = ((buf_block_t*) bpage)->frame;
71 }61 }
72 62
@@ -79,7 +69,7 @@
79 /* If this page is not uninitialized and not in the69 /* If this page is not uninitialized and not in the
80 doublewrite buffer, then the page number and space id70 doublewrite buffer, then the page number and space id
81 should be the same as in block. */71 should be the same as in block. */
82@@ -2894,7 +2904,8 @@72@@ -2796,7 +2806,8 @@
83 recv_recover_page(TRUE, (buf_block_t*) bpage);73 recv_recover_page(TRUE, (buf_block_t*) bpage);
84 }74 }
85 75
@@ -199,7 +189,7 @@
199 189
200 /*190 /*
201 IMPLEMENTATION OF THE TABLESPACE MEMORY CACHE191 IMPLEMENTATION OF THE TABLESPACE MEMORY CACHE
202@@ -287,7 +289,7 @@192@@ -288,7 +290,7 @@
203 193
204 /** The tablespace memory cache. This variable is NULL before the module is194 /** The tablespace memory cache. This variable is NULL before the module is
205 initialized. */195 initialized. */
@@ -208,7 +198,7 @@
208 198
209 199
210 /********************************************************************//**200 /********************************************************************//**
211@@ -298,7 +300,7 @@201@@ -299,7 +301,7 @@
212 off the LRU list if it is in the LRU list. The caller must hold the fil_sys202 off the LRU list if it is in the LRU list. The caller must hold the fil_sys
213 mutex. */203 mutex. */
214 static204 static
@@ -217,7 +207,7 @@
217 fil_node_prepare_for_io(207 fil_node_prepare_for_io(
218 /*====================*/208 /*====================*/
219 fil_node_t* node, /*!< in: file node */209 fil_node_t* node, /*!< in: file node */
220@@ -623,7 +625,7 @@210@@ -624,7 +626,7 @@
221 Opens a the file of a node of a tablespace. The caller must own the fil_system211 Opens a the file of a node of a tablespace. The caller must own the fil_system
222 mutex. */212 mutex. */
223 static213 static
@@ -226,7 +216,7 @@
226 fil_node_open_file(216 fil_node_open_file(
227 /*===============*/217 /*===============*/
228 fil_node_t* node, /*!< in: file node */218 fil_node_t* node, /*!< in: file node */
229@@ -657,7 +659,17 @@219@@ -658,7 +660,17 @@
230 node->name, OS_FILE_OPEN, OS_FILE_READ_ONLY, &success);220 node->name, OS_FILE_OPEN, OS_FILE_READ_ONLY, &success);
231 if (!success) {221 if (!success) {
232 /* The following call prints an error message */222 /* The following call prints an error message */
@@ -245,7 +235,7 @@
245 235
246 ut_print_timestamp(stderr);236 ut_print_timestamp(stderr);
247 237
248@@ -718,12 +730,15 @@238@@ -719,12 +731,15 @@
249 239
250 if (UNIV_UNLIKELY(space_id != space->id)) {240 if (UNIV_UNLIKELY(space_id != space->id)) {
251 fprintf(stderr,241 fprintf(stderr,
@@ -264,7 +254,7 @@
264 }254 }
265 255
266 if (UNIV_UNLIKELY(space_id == ULINT_UNDEFINED256 if (UNIV_UNLIKELY(space_id == ULINT_UNDEFINED
267@@ -747,8 +762,8 @@257@@ -748,8 +763,8 @@
268 }258 }
269 259
270 if (size_bytes >= 1024 * 1024) {260 if (size_bytes >= 1024 * 1024) {
@@ -275,7 +265,7 @@
275 }265 }
276 266
277 if (!(flags & DICT_TF_ZSSIZE_MASK)) {267 if (!(flags & DICT_TF_ZSSIZE_MASK)) {
278@@ -793,6 +808,8 @@268@@ -794,6 +809,8 @@
279 /* Put the node to the LRU list */269 /* Put the node to the LRU list */
280 UT_LIST_ADD_FIRST(LRU, system->LRU, node);270 UT_LIST_ADD_FIRST(LRU, system->LRU, node);
281 }271 }
@@ -284,7 +274,7 @@
284 }274 }
285 275
286 /**********************************************************************//**276 /**********************************************************************//**
287@@ -1418,7 +1435,12 @@277@@ -1438,7 +1455,12 @@
288 the file yet; the following calls will open it and update the278 the file yet; the following calls will open it and update the
289 size fields */279 size fields */
290 280
@@ -298,7 +288,7 @@
298 fil_node_complete_io(node, fil_system, OS_FILE_READ);288 fil_node_complete_io(node, fil_system, OS_FILE_READ);
299 }289 }
300 290
301@@ -1470,7 +1492,12 @@291@@ -1490,7 +1512,12 @@
302 the file yet; the following calls will open it and update the292 the file yet; the following calls will open it and update the
303 size fields */293 size fields */
304 294
@@ -312,7 +302,7 @@
312 fil_node_complete_io(node, fil_system, OS_FILE_READ);302 fil_node_complete_io(node, fil_system, OS_FILE_READ);
313 }303 }
314 304
315@@ -1910,7 +1937,7 @@305@@ -1929,7 +1956,7 @@
316 mem_free(path);306 mem_free(path);
317 }307 }
318 308
@@ -321,7 +311,7 @@
321 /********************************************************//**311 /********************************************************//**
322 Writes a log record about an .ibd file create/rename/delete. */312 Writes a log record about an .ibd file create/rename/delete. */
323 static313 static
324@@ -2134,7 +2161,7 @@314@@ -2153,7 +2180,7 @@
325 if (fil_create_new_single_table_tablespace(315 if (fil_create_new_single_table_tablespace(
326 space_id, name, FALSE, flags,316 space_id, name, FALSE, flags,
327 FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {317 FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {
@@ -330,7 +320,7 @@
330 }320 }
331 }321 }
332 322
333@@ -2297,7 +2324,7 @@323@@ -2317,7 +2344,7 @@
334 }324 }
335 325
336 if (success) {326 if (success) {
@@ -339,16 +329,16 @@
339 /* Write a log record about the deletion of the .ibd329 /* Write a log record about the deletion of the .ibd
340 file, so that ibbackup can replay it in the330 file, so that ibbackup can replay it in the
341 --apply-log phase. We use a dummy mtr and the familiar331 --apply-log phase. We use a dummy mtr and the familiar
342@@ -2598,7 +2625,7 @@332@@ -2618,7 +2645,7 @@
343 333
344 mutex_exit(&fil_system->mutex);334 mutex_exit(&fil_system->mutex);
345 335
346-#ifndef UNIV_HOTBACKUP336-#ifndef UNIV_HOTBACKUP
347+#ifdef UNDEFINED337+#ifdef UNDEFINED
348 if (success) {338 if (success && !recv_recovery_on) {
349 mtr_t mtr;339 mtr_t mtr;
350 340
351@@ -2788,7 +2815,7 @@341@@ -2808,7 +2835,7 @@
352 342
353 fil_node_create(path, size, space_id, FALSE);343 fil_node_create(path, size, space_id, FALSE);
354 344
@@ -357,7 +347,7 @@
357 {347 {
358 mtr_t mtr;348 mtr_t mtr;
359 349
360@@ -3041,19 +3068,97 @@350@@ -3061,19 +3088,97 @@
361 "InnoDB: open the tablespace file ", stderr);351 "InnoDB: open the tablespace file ", stderr);
362 ut_print_filename(stderr, filepath);352 ut_print_filename(stderr, filepath);
363 fputs("!\n"353 fputs("!\n"
@@ -465,7 +455,7 @@
465 return(FALSE);455 return(FALSE);
466 }456 }
467 457
468@@ -3284,7 +3389,7 @@458@@ -3304,7 +3409,7 @@
469 cannot be ok. */459 cannot be ok. */
470 460
471 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;461 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;
@@ -474,7 +464,7 @@
474 if (size < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {464 if (size < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
475 fprintf(stderr,465 fprintf(stderr,
476 "InnoDB: Error: the size of single-table tablespace"466 "InnoDB: Error: the size of single-table tablespace"
477@@ -3414,7 +3519,51 @@467@@ -3434,7 +3539,51 @@
478 468
479 fil_node_create(filepath, 0, space_id, FALSE);469 fil_node_create(filepath, 0, space_id, FALSE);
480 func_exit:470 func_exit:
@@ -527,7 +517,7 @@
527 ut_free(buf2);517 ut_free(buf2);
528 mem_free(filepath);518 mem_free(filepath);
529 }519 }
530@@ -3425,7 +3574,7 @@520@@ -3445,7 +3594,7 @@
531 idea is to read as much good data as we can and jump over bad data.521 idea is to read as much good data as we can and jump over bad data.
532 @return 0 if ok, -1 if error even after the retries, 1 if at the end522 @return 0 if ok, -1 if error even after the retries, 1 if at the end
533 of the directory */523 of the directory */
@@ -536,7 +526,7 @@
536 int526 int
537 fil_file_readdir_next_file(527 fil_file_readdir_next_file(
538 /*=======================*/528 /*=======================*/
539@@ -3469,7 +3618,7 @@529@@ -3489,7 +3638,7 @@
540 @return DB_SUCCESS or error number */530 @return DB_SUCCESS or error number */
541 UNIV_INTERN531 UNIV_INTERN
542 ulint532 ulint
@@ -545,7 +535,7 @@
545 /*===================================*/535 /*===================================*/
546 {536 {
547 int ret;537 int ret;
548@@ -3525,7 +3674,9 @@538@@ -3545,7 +3694,9 @@
549 dbinfo.name);539 dbinfo.name);
550 srv_normalize_path_for_win(dbpath);540 srv_normalize_path_for_win(dbpath);
551 541
@@ -556,7 +546,7 @@
556 546
557 if (dbdir != NULL) {547 if (dbdir != NULL) {
558 /* printf("Opened dir %s\n", dbinfo.name); */548 /* printf("Opened dir %s\n", dbinfo.name); */
559@@ -3551,8 +3702,11 @@549@@ -3571,8 +3722,11 @@
560 ".ibd")) {550 ".ibd")) {
561 /* The name ends in .ibd; try opening551 /* The name ends in .ibd; try opening
562 the file */552 the file */
@@ -569,7 +559,7 @@
569 }559 }
570 next_file_item:560 next_file_item:
571 ret = fil_file_readdir_next_file(&err,561 ret = fil_file_readdir_next_file(&err,
572@@ -3724,15 +3878,97 @@562@@ -3744,15 +3898,97 @@
573 "InnoDB: in InnoDB data dictionary"563 "InnoDB: in InnoDB data dictionary"
574 " has tablespace id %lu,\n"564 " has tablespace id %lu,\n"
575 "InnoDB: but tablespace with that id"565 "InnoDB: but tablespace with that id"
@@ -675,7 +665,7 @@
675 } else {665 } else {
676 ut_print_timestamp(stderr);666 ut_print_timestamp(stderr);
677 fputs(" InnoDB: Error: table ", stderr);667 fputs(" InnoDB: Error: table ", stderr);
678@@ -4121,7 +4357,7 @@668@@ -4141,7 +4377,7 @@
679 off the LRU list if it is in the LRU list. The caller must hold the fil_sys669 off the LRU list if it is in the LRU list. The caller must hold the fil_sys
680 mutex. */670 mutex. */
681 static671 static
@@ -684,7 +674,7 @@
684 fil_node_prepare_for_io(674 fil_node_prepare_for_io(
685 /*====================*/675 /*====================*/
686 fil_node_t* node, /*!< in: file node */676 fil_node_t* node, /*!< in: file node */
687@@ -4141,10 +4377,13 @@677@@ -4161,10 +4397,13 @@
688 }678 }
689 679
690 if (node->open == FALSE) {680 if (node->open == FALSE) {
@@ -699,7 +689,7 @@
699 }689 }
700 690
701 if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE691 if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE
702@@ -4157,6 +4396,8 @@692@@ -4177,6 +4416,8 @@
703 }693 }
704 694
705 node->n_pending++;695 node->n_pending++;
@@ -708,7 +698,7 @@
708 }698 }
709 699
710 /********************************************************************//**700 /********************************************************************//**
711@@ -4292,7 +4533,9 @@701@@ -4312,7 +4553,9 @@
712 ut_ad(recv_no_ibuf_operations || (type == OS_FILE_WRITE)702 ut_ad(recv_no_ibuf_operations || (type == OS_FILE_WRITE)
713 || !ibuf_bitmap_page(zip_size, block_offset)703 || !ibuf_bitmap_page(zip_size, block_offset)
714 || sync || is_log);704 || sync || is_log);
@@ -719,7 +709,7 @@
719 || ibuf_page(space_id, zip_size, block_offset, NULL));709 || ibuf_page(space_id, zip_size, block_offset, NULL));
720 # endif /* UNIV_LOG_DEBUG */710 # endif /* UNIV_LOG_DEBUG */
721 if (sync) {711 if (sync) {
722@@ -4341,6 +4584,16 @@712@@ -4361,6 +4604,16 @@
723 713
724 ut_ad((mode != OS_AIO_IBUF) || (space->purpose == FIL_TABLESPACE));714 ut_ad((mode != OS_AIO_IBUF) || (space->purpose == FIL_TABLESPACE));
725 715
@@ -736,6 +726,26 @@
736 node = UT_LIST_GET_FIRST(space->chain);726 node = UT_LIST_GET_FIRST(space->chain);
737 727
738 for (;;) {728 for (;;) {
729@@ -4869,6 +5122,12 @@
730 const char* tmp_name) /*!< in: temp table name used while
731 swapping */
732 {
733+ (void)old_space_id;
734+ (void)old_name;
735+ (void)new_space_id;
736+ (void)new_name;
737+ (void)tmp_name;
738+#ifdef UNDEFINED
739 mtr_t mtr;
740 mtr_start(&mtr);
741 fil_op_write_log(MLOG_FILE_RENAME, old_space_id,
742@@ -4876,5 +5135,6 @@
743 fil_op_write_log(MLOG_FILE_RENAME, new_space_id,
744 0, 0, new_name, old_name, &mtr);
745 mtr_commit(&mtr);
746+#endif
747 }
748
739--- a/storage/innodb_plugin/ibuf/ibuf0ibuf.c749--- a/storage/innodb_plugin/ibuf/ibuf0ibuf.c
740+++ b/storage/innodb_plugin/ibuf/ibuf0ibuf.c750+++ b/storage/innodb_plugin/ibuf/ibuf0ibuf.c
741@@ -1061,6 +1061,9 @@751@@ -1061,6 +1061,9 @@
@@ -748,7 +758,7 @@
748 if (ibuf_fixed_addr_page(space, zip_size, page_no)) {758 if (ibuf_fixed_addr_page(space, zip_size, page_no)) {
749 759
750 return(TRUE);760 return(TRUE);
751@@ -2277,6 +2280,9 @@761@@ -2275,6 +2278,9 @@
752 ulint n_bytes;762 ulint n_bytes;
753 ulint n_pag2;763 ulint n_pag2;
754 764
@@ -760,7 +770,7 @@
760 770
761--- a/storage/innodb_plugin/include/fil0fil.h771--- a/storage/innodb_plugin/include/fil0fil.h
762+++ b/storage/innodb_plugin/include/fil0fil.h772+++ b/storage/innodb_plugin/include/fil0fil.h
763@@ -504,7 +504,7 @@773@@ -505,7 +505,7 @@
764 @return DB_SUCCESS or error number */774 @return DB_SUCCESS or error number */
765 UNIV_INTERN775 UNIV_INTERN
766 ulint776 ulint
@@ -771,7 +781,7 @@
771 Returns TRUE if a single-table tablespace does not exist in the memory cache,781 Returns TRUE if a single-table tablespace does not exist in the memory cache,
772--- a/storage/innodb_plugin/include/mem0mem.ic782--- a/storage/innodb_plugin/include/mem0mem.ic
773+++ b/storage/innodb_plugin/include/mem0mem.ic783+++ b/storage/innodb_plugin/include/mem0mem.ic
774@@ -367,7 +367,7 @@784@@ -363,7 +363,7 @@
775 buf = (byte*)buf + MEM_FIELD_HEADER_SIZE;785 buf = (byte*)buf + MEM_FIELD_HEADER_SIZE;
776 786
777 /* Check that the field lengths agree */787 /* Check that the field lengths agree */
@@ -782,7 +792,7 @@
782 return(buf);792 return(buf);
783--- a/storage/innodb_plugin/include/mtr0mtr.ic793--- a/storage/innodb_plugin/include/mtr0mtr.ic
784+++ b/storage/innodb_plugin/include/mtr0mtr.ic794+++ b/storage/innodb_plugin/include/mtr0mtr.ic
785@@ -160,7 +160,7 @@795@@ -161,7 +161,7 @@
786 while (offset > 0) {796 while (offset > 0) {
787 offset -= sizeof(mtr_memo_slot_t);797 offset -= sizeof(mtr_memo_slot_t);
788 798
@@ -989,7 +999,7 @@
989 ibool999 ibool
990 log_block_checksum_is_ok_or_old_format(1000 log_block_checksum_is_ok_or_old_format(
991 /*===================================*/1001 /*===================================*/
992@@ -1486,6 +1487,7 @@1002@@ -1492,6 +1493,7 @@
993 buf_block_get_page_no(block));1003 buf_block_get_page_no(block));
994 1004
995 if ((recv_addr == NULL)1005 if ((recv_addr == NULL)
@@ -997,7 +1007,7 @@
997 || (recv_addr->state == RECV_BEING_PROCESSED)1007 || (recv_addr->state == RECV_BEING_PROCESSED)
998 || (recv_addr->state == RECV_PROCESSED)) {1008 || (recv_addr->state == RECV_PROCESSED)) {
999 1009
1000@@ -1575,9 +1577,16 @@1010@@ -1581,9 +1583,16 @@
1001 if (page_zip) {1011 if (page_zip) {
1002 memset(FIL_PAGE_LSN + page_zip->data, 0, 8);1012 memset(FIL_PAGE_LSN + page_zip->data, 0, 8);
1003 }1013 }
@@ -1015,7 +1025,7 @@
1015 1025
1016 ib_uint64_t end_lsn;1026 ib_uint64_t end_lsn;
1017 1027
1018@@ -1762,6 +1771,18 @@1028@@ -1769,6 +1778,18 @@
1019 ulint zip_size = fil_space_get_zip_size(space);1029 ulint zip_size = fil_space_get_zip_size(space);
1020 ulint page_no = recv_addr->page_no;1030 ulint page_no = recv_addr->page_no;
1021 1031
@@ -1034,7 +1044,7 @@
1034 if (recv_addr->state == RECV_NOT_PROCESSED) {1044 if (recv_addr->state == RECV_NOT_PROCESSED) {
1035 if (!has_printed) {1045 if (!has_printed) {
1036 ut_print_timestamp(stderr);1046 ut_print_timestamp(stderr);
1037@@ -1795,7 +1816,7 @@1047@@ -1802,7 +1823,7 @@
1038 1048
1039 mutex_enter(&(recv_sys->mutex));1049 mutex_enter(&(recv_sys->mutex));
1040 }1050 }
@@ -1043,7 +1053,7 @@
1043 recv_addr = HASH_GET_NEXT(addr_hash, recv_addr);1053 recv_addr = HASH_GET_NEXT(addr_hash, recv_addr);
1044 }1054 }
1045 1055
1046@@ -2297,7 +2318,7 @@1056@@ -2304,7 +2325,7 @@
1047 || type == MLOG_FILE_RENAME1057 || type == MLOG_FILE_RENAME
1048 || type == MLOG_FILE_DELETE) {1058 || type == MLOG_FILE_DELETE) {
1049 ut_a(space);1059 ut_a(space);
@@ -1052,7 +1062,7 @@
1052 if (recv_replay_file_ops) {1062 if (recv_replay_file_ops) {
1053 1063
1054 /* In ibbackup --apply-log, replay an .ibd file1064 /* In ibbackup --apply-log, replay an .ibd file
1055@@ -2320,7 +2341,7 @@1065@@ -2327,7 +2348,7 @@
1056 ut_error;1066 ut_error;
1057 }1067 }
1058 }1068 }
@@ -1061,7 +1071,7 @@
1061 /* In normal mysqld crash recovery we do not try to1071 /* In normal mysqld crash recovery we do not try to
1062 replay file operations */1072 replay file operations */
1063 #ifdef UNIV_LOG_LSN_DEBUG1073 #ifdef UNIV_LOG_LSN_DEBUG
1064@@ -2737,8 +2758,11 @@1074@@ -2744,8 +2765,11 @@
1065 1075
1066 fprintf(stderr,1076 fprintf(stderr,
1067 "InnoDB: Doing recovery: scanned up to"1077 "InnoDB: Doing recovery: scanned up to"
@@ -1075,7 +1085,7 @@
1075 }1085 }
1076 }1086 }
1077 1087
1078@@ -2841,7 +2865,7 @@1088@@ -2848,7 +2872,7 @@
1079 "InnoDB: Reading tablespace information"1089 "InnoDB: Reading tablespace information"
1080 " from the .ibd files...\n");1090 " from the .ibd files...\n");
1081 1091
@@ -1084,7 +1094,7 @@
1084 1094
1085 /* If we are using the doublewrite method, we will1095 /* If we are using the doublewrite method, we will
1086 check if there are half-written pages in data files,1096 check if there are half-written pages in data files,
1087@@ -2850,12 +2874,14 @@1097@@ -2857,12 +2881,14 @@
1088 1098
1089 if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) {1099 if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) {
1090 1100
@@ -1100,7 +1110,7 @@
1100 }1110 }
1101 }1111 }
1102 1112
1103@@ -3005,6 +3031,7 @@1113@@ -3012,6 +3038,7 @@
1104 recv_sys->recovered_lsn = checkpoint_lsn;1114 recv_sys->recovered_lsn = checkpoint_lsn;
1105 1115
1106 srv_start_lsn = checkpoint_lsn;1116 srv_start_lsn = checkpoint_lsn;
@@ -1108,7 +1118,7 @@
1108 }1118 }
1109 1119
1110 contiguous_lsn = ut_uint64_align_down(recv_sys->scanned_lsn,1120 contiguous_lsn = ut_uint64_align_down(recv_sys->scanned_lsn,
1111@@ -3286,6 +3313,7 @@1121@@ -3293,6 +3320,7 @@
1112 that the data dictionary tables will be free of any locks.1122 that the data dictionary tables will be free of any locks.
1113 The data dictionary latch should guarantee that there is at1123 The data dictionary latch should guarantee that there is at
1114 most one data dictionary transaction active at a time. */1124 most one data dictionary transaction active at a time. */
@@ -1127,7 +1137,7 @@
1127 #if defined(UNIV_HOTBACKUP) || defined(__WIN__) || defined(__NETWARE__)1137 #if defined(UNIV_HOTBACKUP) || defined(__WIN__) || defined(__NETWARE__)
1128 /* InnoDB Hot Backup does not lock the data files.1138 /* InnoDB Hot Backup does not lock the data files.
1129 * On Windows, mandatory locking is used.1139 * On Windows, mandatory locking is used.
1130@@ -1316,8 +1316,9 @@1140@@ -1324,8 +1324,9 @@
1131 attributes = 0;1141 attributes = 0;
1132 ut_error;1142 ut_error;
1133 }1143 }
@@ -1138,7 +1148,7 @@
1138 GENERIC_READ | GENERIC_WRITE, /* read and write1148 GENERIC_READ | GENERIC_WRITE, /* read and write
1139 access */1149 access */
1140 share_mode, /* File can be read also by other1150 share_mode, /* File can be read also by other
1141@@ -1376,7 +1377,11 @@1151@@ -1391,7 +1392,11 @@
1142 if (create_mode == OS_FILE_OPEN || create_mode == OS_FILE_OPEN_RAW1152 if (create_mode == OS_FILE_OPEN || create_mode == OS_FILE_OPEN_RAW
1143 || create_mode == OS_FILE_OPEN_RETRY) {1153 || create_mode == OS_FILE_OPEN_RETRY) {
1144 mode_str = "OPEN";1154 mode_str = "OPEN";
@@ -1151,7 +1161,7 @@
1151 } else if (create_mode == OS_FILE_CREATE) {1161 } else if (create_mode == OS_FILE_CREATE) {
1152 mode_str = "CREATE";1162 mode_str = "CREATE";
1153 create_flag = O_RDWR | O_CREAT | O_EXCL;1163 create_flag = O_RDWR | O_CREAT | O_EXCL;
1154@@ -2545,6 +2550,9 @@1164@@ -2560,6 +2565,9 @@
1155 ut_a((offset & 0xFFFFFFFFUL) == offset);1165 ut_a((offset & 0xFFFFFFFFUL) == offset);
1156 ut_a((n & 0xFFFFFFFFUL) == n);1166 ut_a((n & 0xFFFFFFFFUL) == n);
1157 1167
@@ -1161,7 +1171,7 @@
1161 os_n_file_writes++;1171 os_n_file_writes++;
1162 1172
1163 ut_ad(file);1173 ut_ad(file);
1164@@ -2669,6 +2677,9 @@1174@@ -2684,6 +2692,9 @@
1165 #else1175 #else
1166 ssize_t ret;1176 ssize_t ret;
1167 1177
@@ -1193,7 +1203,7 @@
1193 1203
1194--- a/storage/innodb_plugin/srv/srv0srv.c1204--- a/storage/innodb_plugin/srv/srv0srv.c
1195+++ b/storage/innodb_plugin/srv/srv0srv.c1205+++ b/storage/innodb_plugin/srv/srv0srv.c
1196@@ -374,6 +374,10 @@1206@@ -383,6 +383,10 @@
1197 1207
1198 UNIV_INTERN ulong srv_replication_delay = 0;1208 UNIV_INTERN ulong srv_replication_delay = 0;
1199 1209
@@ -1204,7 +1214,7 @@
1204 /*-------------------------------------------*/1214 /*-------------------------------------------*/
1205 UNIV_INTERN ulong srv_n_spin_wait_rounds = 30;1215 UNIV_INTERN ulong srv_n_spin_wait_rounds = 30;
1206 UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500;1216 UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500;
1207@@ -1002,7 +1006,7 @@1217@@ -1011,7 +1015,7 @@
1208 }1218 }
1209 1219
1210 /* Initialize some INFORMATION SCHEMA internal structures */1220 /* Initialize some INFORMATION SCHEMA internal structures */
@@ -1213,7 +1223,7 @@
1213 }1223 }
1214 1224
1215 /*********************************************************************//**1225 /*********************************************************************//**
1216@@ -1013,6 +1017,7 @@1226@@ -1022,6 +1026,7 @@
1217 /*==========*/1227 /*==========*/
1218 {1228 {
1219 os_fast_mutex_free(&srv_conc_mutex);1229 os_fast_mutex_free(&srv_conc_mutex);
@@ -1221,7 +1231,7 @@
1221 mem_free(srv_conc_slots);1231 mem_free(srv_conc_slots);
1222 srv_conc_slots = NULL;1232 srv_conc_slots = NULL;
1223 1233
1224@@ -1026,6 +1031,7 @@1234@@ -1035,6 +1040,7 @@
1225 srv_mysql_table = NULL;1235 srv_mysql_table = NULL;
1226 1236
1227 trx_i_s_cache_free(trx_i_s_cache);1237 trx_i_s_cache_free(trx_i_s_cache);
@@ -1334,9 +1344,9 @@
1334 srv_was_started = TRUE;1344 srv_was_started = TRUE;
1335--- a/storage/innodb_plugin/trx/trx0purge.c1345--- a/storage/innodb_plugin/trx/trx0purge.c
1336+++ b/storage/innodb_plugin/trx/trx0purge.c1346+++ b/storage/innodb_plugin/trx/trx0purge.c
1337@@ -1087,6 +1087,9 @@1347@@ -1093,6 +1093,9 @@
1338 /* que_thr_t* thr2; */1348 /* que_thr_t* thr2; */
1339 ulint old_pages_handled;1349 ulonglong old_pages_handled;
1340 1350
1341+ if (srv_fake_write)1351+ if (srv_fake_write)
1342+ return(0);1352+ return(0);
@@ -1360,7 +1370,7 @@
1360 1370
1361--- a/storage/innodb_plugin/trx/trx0sys.c1371--- a/storage/innodb_plugin/trx/trx0sys.c
1362+++ b/storage/innodb_plugin/trx/trx0sys.c1372+++ b/storage/innodb_plugin/trx/trx0sys.c
1363@@ -1586,12 +1586,14 @@1373@@ -1583,12 +1583,14 @@
1364 mem_free(trx_doublewrite);1374 mem_free(trx_doublewrite);
1365 trx_doublewrite = NULL;1375 trx_doublewrite = NULL;
1366 1376
@@ -1375,7 +1385,7 @@
1375 1385
1376 /* There can't be any active transactions. */1386 /* There can't be any active transactions. */
1377 rseg = UT_LIST_GET_FIRST(trx_sys->rseg_list);1387 rseg = UT_LIST_GET_FIRST(trx_sys->rseg_list);
1378@@ -1617,10 +1619,12 @@1388@@ -1614,10 +1616,12 @@
1379 UT_LIST_REMOVE(view_list, trx_sys->view_list, prev_view);1389 UT_LIST_REMOVE(view_list, trx_sys->view_list, prev_view);
1380 }1390 }
1381 1391
@@ -1425,9 +1435,9 @@
1425 1435
1426 /*1436 /*
1427 WAIT ARRAY1437 WAIT ARRAY
1428@@ -927,6 +928,13 @@1438@@ -932,6 +933,13 @@
1429 ibool fatal = FALSE;1439 return(FALSE);
1430 double longest_diff = 0;1440 }
1431 1441
1432+ if (srv_rebuild_indexes) {1442+ if (srv_rebuild_indexes) {
1433+1443+
@@ -1436,12 +1446,12 @@
1436+ return(FALSE);1446+ return(FALSE);
1437+ }1447+ }
1438+1448+
1449 sync_array_enter(sync_primary_wait_array);
1450
1439 for (i = 0; i < sync_primary_wait_array->n_cells; i++) {1451 for (i = 0; i < sync_primary_wait_array->n_cells; i++) {
1440
1441 double diff;
1442--- a/storage/innodb_plugin/include/buf0buf.h1452--- a/storage/innodb_plugin/include/buf0buf.h
1443+++ b/storage/innodb_plugin/include/buf0buf.h1453+++ b/storage/innodb_plugin/include/buf0buf.h
1444@@ -1191,6 +1191,8 @@1454@@ -1270,6 +1270,8 @@
1445 frees a page in buffer pool */1455 frees a page in buffer pool */
1446 # endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */1456 # endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
1447 #endif /* !UNIV_HOTBACKUP */1457 #endif /* !UNIV_HOTBACKUP */
@@ -1493,14 +1503,3 @@
1493 1503
1494 UNIV_MEM_FREE(buf, n);1504 UNIV_MEM_FREE(buf, n);
1495 }1505 }
1496--- a/configure.in
1497+++ b/configure.in
1498@@ -22,7 +22,7 @@
1499 AM_INIT_AUTOMAKE([1.9 tar-ustar])
1500 AC_PROG_LIBTOOL
1501
1502-AM_CONFIG_HEADER([include/config.h])
1503+AC_CONFIG_HEADERS([include/config.h])
1504
1505 # Request support for automake silent-rules if available.
1506 # Default to verbose output. One can use the configure-time
15071506
=== modified file 'patches/innodb55.patch'
--- patches/innodb55.patch 2013-05-07 13:32:47 +0000
+++ patches/innodb55.patch 2013-07-22 14:01:36 +0000
@@ -1,6 +1,6 @@
1--- a/storage/innobase/btr/btr0btr.c1--- a/storage/innobase/btr/btr0btr.c
2+++ b/storage/innobase/btr/btr0btr.c2+++ b/storage/innobase/btr/btr0btr.c
3@@ -674,7 +674,7 @@3@@ -698,7 +698,7 @@
4 /**************************************************************//**4 /**************************************************************//**
5 Gets the root node of a tree and x-latches it.5 Gets the root node of a tree and x-latches it.
6 @return root page, x-latched */6 @return root page, x-latched */
@@ -9,7 +9,7 @@
9 buf_block_t*9 buf_block_t*
10 btr_root_block_get(10 btr_root_block_get(
11 /*===============*/11 /*===============*/
12@@ -1123,7 +1123,7 @@12@@ -1183,7 +1183,7 @@
13 /************************************************************//**13 /************************************************************//**
14 Returns the child page of a node pointer and x-latches it.14 Returns the child page of a node pointer and x-latches it.
15 @return child page, x-latched */15 @return child page, x-latched */
@@ -28,7 +28,7 @@
28 28
29 /*29 /*
30 IMPLEMENTATION OF THE BUFFER POOL30 IMPLEMENTATION OF THE BUFFER POOL
31@@ -518,7 +519,7 @@31@@ -538,7 +539,7 @@
32 return(TRUE);32 return(TRUE);
33 }33 }
34 34
@@ -37,7 +37,7 @@
37 if (recv_lsn_checks_on) {37 if (recv_lsn_checks_on) {
38 ib_uint64_t current_lsn;38 ib_uint64_t current_lsn;
39 39
40@@ -881,6 +882,7 @@40@@ -918,6 +919,7 @@
41 block->page.in_flush_list = FALSE;41 block->page.in_flush_list = FALSE;
42 block->page.in_free_list = FALSE;42 block->page.in_free_list = FALSE;
43 block->page.in_LRU_list = FALSE;43 block->page.in_LRU_list = FALSE;
@@ -45,7 +45,7 @@
45 block->in_unzip_LRU_list = FALSE;45 block->in_unzip_LRU_list = FALSE;
46 #endif /* UNIV_DEBUG */46 #endif /* UNIV_DEBUG */
47 #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG47 #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
48@@ -2299,7 +2301,8 @@48@@ -2256,7 +2258,8 @@
49 ut_ad(zip_size == fil_space_get_zip_size(space));49 ut_ad(zip_size == fil_space_get_zip_size(space));
50 ut_ad(ut_is_2pow(zip_size));50 ut_ad(ut_is_2pow(zip_size));
51 #ifndef UNIV_LOG_DEBUG51 #ifndef UNIV_LOG_DEBUG
@@ -55,7 +55,7 @@
55 || ibuf_page_low(space, zip_size, offset,55 || ibuf_page_low(space, zip_size, offset,
56 FALSE, file, line, NULL));56 FALSE, file, line, NULL));
57 #endif57 #endif
58@@ -3567,6 +3570,13 @@58@@ -3535,6 +3538,13 @@
59 frame = ((buf_block_t*) bpage)->frame;59 frame = ((buf_block_t*) bpage)->frame;
60 }60 }
61 61
@@ -69,7 +69,7 @@
69 /* If this page is not uninitialized and not in the69 /* If this page is not uninitialized and not in the
70 doublewrite buffer, then the page number and space id70 doublewrite buffer, then the page number and space id
71 should be the same as in block. */71 should be the same as in block. */
72@@ -3668,7 +3678,8 @@72@@ -3637,7 +3647,8 @@
73 recv_recover_page(TRUE, (buf_block_t*) bpage);73 recv_recover_page(TRUE, (buf_block_t*) bpage);
74 }74 }
75 75
@@ -81,7 +81,7 @@
81 bpage->offset, buf_page_get_zip_size(bpage),81 bpage->offset, buf_page_get_zip_size(bpage),
82--- a/storage/innobase/buf/buf0rea.c82--- a/storage/innobase/buf/buf0rea.c
83+++ b/storage/innobase/buf/buf0rea.c83+++ b/storage/innobase/buf/buf0rea.c
84@@ -124,6 +124,45 @@84@@ -162,6 +162,45 @@
85 bpage = buf_page_init_for_read(err, mode, space, zip_size, unzip,85 bpage = buf_page_init_for_read(err, mode, space, zip_size, unzip,
86 tablespace_version, offset);86 tablespace_version, offset);
87 if (bpage == NULL) {87 if (bpage == NULL) {
@@ -127,7 +127,7 @@
127 127
128 return(0);128 return(0);
129 }129 }
130@@ -768,6 +807,50 @@130@@ -820,6 +859,50 @@
131 /* It is a single table tablespace and the .ibd file is131 /* It is a single table tablespace and the .ibd file is
132 missing: do nothing */132 missing: do nothing */
133 133
@@ -189,7 +189,7 @@
189 #ifndef UNIV_HOTBACKUP189 #ifndef UNIV_HOTBACKUP
190 # include "buf0lru.h"190 # include "buf0lru.h"
191 # include "ibuf0ibuf.h"191 # include "ibuf0ibuf.h"
192@@ -297,7 +299,7 @@192@@ -300,7 +302,7 @@
193 193
194 /** The tablespace memory cache. This variable is NULL before the module is194 /** The tablespace memory cache. This variable is NULL before the module is
195 initialized. */195 initialized. */
@@ -198,7 +198,7 @@
198 198
199 #ifdef UNIV_DEBUG199 #ifdef UNIV_DEBUG
200 /** Try fil_validate() every this many times */200 /** Try fil_validate() every this many times */
201@@ -336,7 +338,7 @@201@@ -339,7 +341,7 @@
202 off the LRU list if it is in the LRU list. The caller must hold the fil_sys202 off the LRU list if it is in the LRU list. The caller must hold the fil_sys
203 mutex. */203 mutex. */
204 static204 static
@@ -207,7 +207,7 @@
207 fil_node_prepare_for_io(207 fil_node_prepare_for_io(
208 /*====================*/208 /*====================*/
209 fil_node_t* node, /*!< in: file node */209 fil_node_t* node, /*!< in: file node */
210@@ -661,7 +663,7 @@210@@ -664,7 +666,7 @@
211 Opens a the file of a node of a tablespace. The caller must own the fil_system211 Opens a the file of a node of a tablespace. The caller must own the fil_system
212 mutex. */212 mutex. */
213 static213 static
@@ -216,7 +216,7 @@
216 fil_node_open_file(216 fil_node_open_file(
217 /*===============*/217 /*===============*/
218 fil_node_t* node, /*!< in: file node */218 fil_node_t* node, /*!< in: file node */
219@@ -696,7 +698,17 @@219@@ -699,7 +701,17 @@
220 OS_FILE_READ_ONLY, &success);220 OS_FILE_READ_ONLY, &success);
221 if (!success) {221 if (!success) {
222 /* The following call prints an error message */222 /* The following call prints an error message */
@@ -235,7 +235,7 @@
235 235
236 ut_print_timestamp(stderr);236 ut_print_timestamp(stderr);
237 237
238@@ -757,12 +769,15 @@238@@ -760,12 +772,15 @@
239 239
240 if (UNIV_UNLIKELY(space_id != space->id)) {240 if (UNIV_UNLIKELY(space_id != space->id)) {
241 fprintf(stderr,241 fprintf(stderr,
@@ -254,7 +254,7 @@
254 }254 }
255 255
256 if (UNIV_UNLIKELY(space_id == ULINT_UNDEFINED256 if (UNIV_UNLIKELY(space_id == ULINT_UNDEFINED
257@@ -786,8 +801,8 @@257@@ -789,8 +804,8 @@
258 }258 }
259 259
260 if (size_bytes >= 1024 * 1024) {260 if (size_bytes >= 1024 * 1024) {
@@ -265,7 +265,7 @@
265 }265 }
266 266
267 if (!(flags & DICT_TF_ZSSIZE_MASK)) {267 if (!(flags & DICT_TF_ZSSIZE_MASK)) {
268@@ -838,6 +853,8 @@268@@ -841,6 +856,8 @@
269 /* Put the node to the LRU list */269 /* Put the node to the LRU list */
270 UT_LIST_ADD_FIRST(LRU, system->LRU, node);270 UT_LIST_ADD_FIRST(LRU, system->LRU, node);
271 }271 }
@@ -274,7 +274,7 @@
274 }274 }
275 275
276 /**********************************************************************//**276 /**********************************************************************//**
277@@ -1464,7 +1481,12 @@277@@ -1504,7 +1521,12 @@
278 the file yet; the following calls will open it and update the278 the file yet; the following calls will open it and update the
279 size fields */279 size fields */
280 280
@@ -288,7 +288,7 @@
288 fil_node_complete_io(node, fil_system, OS_FILE_READ);288 fil_node_complete_io(node, fil_system, OS_FILE_READ);
289 }289 }
290 290
291@@ -1516,7 +1538,12 @@291@@ -1573,7 +1595,12 @@
292 the file yet; the following calls will open it and update the292 the file yet; the following calls will open it and update the
293 size fields */293 size fields */
294 294
@@ -302,7 +302,7 @@
302 fil_node_complete_io(node, fil_system, OS_FILE_READ);302 fil_node_complete_io(node, fil_system, OS_FILE_READ);
303 }303 }
304 304
305@@ -1957,7 +1984,7 @@305@@ -2021,7 +2048,7 @@
306 mem_free(path);306 mem_free(path);
307 }307 }
308 308
@@ -311,7 +311,7 @@
311 /********************************************************//**311 /********************************************************//**
312 Writes a log record about an .ibd file create/rename/delete. */312 Writes a log record about an .ibd file create/rename/delete. */
313 static313 static
314@@ -2181,7 +2208,7 @@314@@ -2245,7 +2272,7 @@
315 if (fil_create_new_single_table_tablespace(315 if (fil_create_new_single_table_tablespace(
316 space_id, name, FALSE, flags,316 space_id, name, FALSE, flags,
317 FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {317 FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {
@@ -320,7 +320,7 @@
320 }320 }
321 }321 }
322 322
323@@ -2344,7 +2371,7 @@323@@ -2434,7 +2461,7 @@
324 }324 }
325 325
326 if (success) {326 if (success) {
@@ -329,16 +329,16 @@
329 /* Write a log record about the deletion of the .ibd329 /* Write a log record about the deletion of the .ibd
330 file, so that ibbackup can replay it in the330 file, so that ibbackup can replay it in the
331 --apply-log phase. We use a dummy mtr and the familiar331 --apply-log phase. We use a dummy mtr and the familiar
332@@ -2645,7 +2672,7 @@332@@ -2735,7 +2762,7 @@
333 333
334 mutex_exit(&fil_system->mutex);334 mutex_exit(&fil_system->mutex);
335 335
336-#ifndef UNIV_HOTBACKUP336-#ifndef UNIV_HOTBACKUP
337+#ifdef UNDEFINED337+#ifdef UNDEFINED
338 if (success) {338 if (success && !recv_recovery_on) {
339 mtr_t mtr;339 mtr_t mtr;
340 340
341@@ -2836,7 +2863,7 @@341@@ -2926,7 +2953,7 @@
342 342
343 fil_node_create(path, size, space_id, FALSE);343 fil_node_create(path, size, space_id, FALSE);
344 344
@@ -347,7 +347,7 @@
347 {347 {
348 mtr_t mtr;348 mtr_t mtr;
349 349
350@@ -3091,19 +3118,97 @@350@@ -3181,19 +3208,97 @@
351 "InnoDB: open the tablespace file ", stderr);351 "InnoDB: open the tablespace file ", stderr);
352 ut_print_filename(stderr, filepath);352 ut_print_filename(stderr, filepath);
353 fputs("!\n"353 fputs("!\n"
@@ -455,7 +455,7 @@
455 return(FALSE);455 return(FALSE);
456 }456 }
457 457
458@@ -3335,7 +3440,7 @@458@@ -3425,7 +3530,7 @@
459 cannot be ok. */459 cannot be ok. */
460 460
461 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;461 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;
@@ -464,7 +464,7 @@
464 if (size < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {464 if (size < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
465 fprintf(stderr,465 fprintf(stderr,
466 "InnoDB: Error: the size of single-table tablespace"466 "InnoDB: Error: the size of single-table tablespace"
467@@ -3465,7 +3570,51 @@467@@ -3555,7 +3660,51 @@
468 468
469 fil_node_create(filepath, 0, space_id, FALSE);469 fil_node_create(filepath, 0, space_id, FALSE);
470 func_exit:470 func_exit:
@@ -517,7 +517,7 @@
517 ut_free(buf2);517 ut_free(buf2);
518 mem_free(filepath);518 mem_free(filepath);
519 }519 }
520@@ -3476,7 +3625,7 @@520@@ -3566,7 +3715,7 @@
521 idea is to read as much good data as we can and jump over bad data.521 idea is to read as much good data as we can and jump over bad data.
522 @return 0 if ok, -1 if error even after the retries, 1 if at the end522 @return 0 if ok, -1 if error even after the retries, 1 if at the end
523 of the directory */523 of the directory */
@@ -526,7 +526,7 @@
526 int526 int
527 fil_file_readdir_next_file(527 fil_file_readdir_next_file(
528 /*=======================*/528 /*=======================*/
529@@ -3520,7 +3669,7 @@529@@ -3610,7 +3759,7 @@
530 @return DB_SUCCESS or error number */530 @return DB_SUCCESS or error number */
531 UNIV_INTERN531 UNIV_INTERN
532 ulint532 ulint
@@ -535,7 +535,7 @@
535 /*===================================*/535 /*===================================*/
536 {536 {
537 int ret;537 int ret;
538@@ -3576,7 +3725,9 @@538@@ -3666,7 +3815,9 @@
539 dbinfo.name);539 dbinfo.name);
540 srv_normalize_path_for_win(dbpath);540 srv_normalize_path_for_win(dbpath);
541 541
@@ -546,7 +546,7 @@
546 546
547 if (dbdir != NULL) {547 if (dbdir != NULL) {
548 /* printf("Opened dir %s\n", dbinfo.name); */548 /* printf("Opened dir %s\n", dbinfo.name); */
549@@ -3602,8 +3753,11 @@549@@ -3692,8 +3843,11 @@
550 ".ibd")) {550 ".ibd")) {
551 /* The name ends in .ibd; try opening551 /* The name ends in .ibd; try opening
552 the file */552 the file */
@@ -559,7 +559,7 @@
559 }559 }
560 next_file_item:560 next_file_item:
561 ret = fil_file_readdir_next_file(&err,561 ret = fil_file_readdir_next_file(&err,
562@@ -3775,15 +3929,97 @@562@@ -3865,15 +4019,97 @@
563 "InnoDB: in InnoDB data dictionary"563 "InnoDB: in InnoDB data dictionary"
564 " has tablespace id %lu,\n"564 " has tablespace id %lu,\n"
565 "InnoDB: but tablespace with that id"565 "InnoDB: but tablespace with that id"
@@ -665,7 +665,7 @@
665 } else {665 } else {
666 ut_print_timestamp(stderr);666 ut_print_timestamp(stderr);
667 fputs(" InnoDB: Error: table ", stderr);667 fputs(" InnoDB: Error: table ", stderr);
668@@ -4172,7 +4408,7 @@668@@ -4262,7 +4498,7 @@
669 off the LRU list if it is in the LRU list. The caller must hold the fil_sys669 off the LRU list if it is in the LRU list. The caller must hold the fil_sys
670 mutex. */670 mutex. */
671 static671 static
@@ -674,7 +674,7 @@
674 fil_node_prepare_for_io(674 fil_node_prepare_for_io(
675 /*====================*/675 /*====================*/
676 fil_node_t* node, /*!< in: file node */676 fil_node_t* node, /*!< in: file node */
677@@ -4192,10 +4428,13 @@677@@ -4282,10 +4518,13 @@
678 }678 }
679 679
680 if (node->open == FALSE) {680 if (node->open == FALSE) {
@@ -689,7 +689,7 @@
689 }689 }
690 690
691 if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE691 if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE
692@@ -4208,6 +4447,8 @@692@@ -4298,6 +4537,8 @@
693 }693 }
694 694
695 node->n_pending++;695 node->n_pending++;
@@ -698,7 +698,7 @@
698 }698 }
699 699
700 /********************************************************************//**700 /********************************************************************//**
701@@ -4390,6 +4631,16 @@701@@ -4482,6 +4723,16 @@
702 702
703 ut_ad((mode != OS_AIO_IBUF) || (space->purpose == FIL_TABLESPACE));703 ut_ad((mode != OS_AIO_IBUF) || (space->purpose == FIL_TABLESPACE));
704 704
@@ -715,9 +715,29 @@
715 node = UT_LIST_GET_FIRST(space->chain);715 node = UT_LIST_GET_FIRST(space->chain);
716 716
717 for (;;) {717 for (;;) {
718@@ -4997,6 +5248,12 @@
719 const char* tmp_name) /*!< in: temp table name used while
720 swapping */
721 {
722+ (void)old_space_id;
723+ (void)old_name;
724+ (void)new_space_id;
725+ (void)new_name;
726+ (void)tmp_name;
727+#ifdef UNDEFINED
728 mtr_t mtr;
729 mtr_start(&mtr);
730 fil_op_write_log(MLOG_FILE_RENAME, old_space_id,
731@@ -5004,5 +5261,6 @@
732 fil_op_write_log(MLOG_FILE_RENAME, new_space_id,
733 0, 0, new_name, old_name, &mtr);
734 mtr_commit(&mtr);
735+#endif
736 }
737
718--- a/storage/innobase/ibuf/ibuf0ibuf.c738--- a/storage/innobase/ibuf/ibuf0ibuf.c
719+++ b/storage/innobase/ibuf/ibuf0ibuf.c739+++ b/storage/innobase/ibuf/ibuf0ibuf.c
720@@ -1148,6 +1148,9 @@740@@ -1157,6 +1157,9 @@
721 ut_ad(!recv_no_ibuf_operations);741 ut_ad(!recv_no_ibuf_operations);
722 ut_ad(x_latch || mtr == NULL);742 ut_ad(x_latch || mtr == NULL);
723 743
@@ -727,7 +747,7 @@
727 if (ibuf_fixed_addr_page(space, zip_size, page_no)) {747 if (ibuf_fixed_addr_page(space, zip_size, page_no)) {
728 748
729 return(TRUE);749 return(TRUE);
730@@ -2715,6 +2718,9 @@750@@ -2729,6 +2732,9 @@
731 ulint n_bytes;751 ulint n_bytes;
732 ulint n_pag2;752 ulint n_pag2;
733 753
@@ -739,7 +759,7 @@
739 759
740--- a/storage/innobase/include/fil0fil.h760--- a/storage/innobase/include/fil0fil.h
741+++ b/storage/innobase/include/fil0fil.h761+++ b/storage/innobase/include/fil0fil.h
742@@ -505,7 +505,7 @@762@@ -513,7 +513,7 @@
743 @return DB_SUCCESS or error number */763 @return DB_SUCCESS or error number */
744 UNIV_INTERN764 UNIV_INTERN
745 ulint765 ulint
@@ -803,16 +823,16 @@
803 823
804 if (log_sys->n_pending_checkpoint_writes > 0) {824 if (log_sys->n_pending_checkpoint_writes > 0) {
805 /* A checkpoint write is running */825 /* A checkpoint write is running */
806@@ -3114,6 +3116,7 @@826@@ -3141,6 +3143,7 @@
807 shutdown, because the InnoDB layer may have committed or827 shutdown, because the InnoDB layer may have committed or
808 prepared transactions and we don't want to lose them. */828 prepared transactions and we don't want to lose them. */
809 829
810+ if (!srv_apply_log_only) {830+ if (!srv_apply_log_only) {
811 server_busy = trx_n_mysql_transactions > 0831 server_busy = trx_n_mysql_transactions > 0
812 || UT_LIST_GET_LEN(trx_sys->trx_list) > trx_n_prepared;832 || UT_LIST_GET_LEN(trx_sys->trx_list) > trx_n_prepared;
813 mutex_exit(&kernel_mutex);833
814@@ -3121,6 +3124,10 @@834@@ -3193,6 +3196,10 @@
815 if (server_busy || srv_is_any_background_thread_active()) {835
816 goto loop;836 goto loop;
817 }837 }
818+ }838+ }
@@ -902,7 +922,7 @@
902 ibool922 ibool
903 log_block_checksum_is_ok_or_old_format(923 log_block_checksum_is_ok_or_old_format(
904 /*===================================*/924 /*===================================*/
905@@ -1496,6 +1497,7 @@925@@ -1502,6 +1503,7 @@
906 buf_block_get_page_no(block));926 buf_block_get_page_no(block));
907 927
908 if ((recv_addr == NULL)928 if ((recv_addr == NULL)
@@ -910,7 +930,7 @@
910 || (recv_addr->state == RECV_BEING_PROCESSED)930 || (recv_addr->state == RECV_BEING_PROCESSED)
911 || (recv_addr->state == RECV_PROCESSED)) {931 || (recv_addr->state == RECV_PROCESSED)) {
912 932
913@@ -1585,9 +1587,16 @@933@@ -1591,9 +1593,16 @@
914 if (page_zip) {934 if (page_zip) {
915 memset(FIL_PAGE_LSN + page_zip->data, 0, 8);935 memset(FIL_PAGE_LSN + page_zip->data, 0, 8);
916 }936 }
@@ -928,7 +948,7 @@
928 948
929 ib_uint64_t end_lsn;949 ib_uint64_t end_lsn;
930 950
931@@ -1774,6 +1783,18 @@951@@ -1780,6 +1789,18 @@
932 ulint zip_size = fil_space_get_zip_size(space);952 ulint zip_size = fil_space_get_zip_size(space);
933 ulint page_no = recv_addr->page_no;953 ulint page_no = recv_addr->page_no;
934 954
@@ -947,7 +967,7 @@
947 if (recv_addr->state == RECV_NOT_PROCESSED) {967 if (recv_addr->state == RECV_NOT_PROCESSED) {
948 if (!has_printed) {968 if (!has_printed) {
949 ut_print_timestamp(stderr);969 ut_print_timestamp(stderr);
950@@ -1807,7 +1828,7 @@970@@ -1813,7 +1834,7 @@
951 971
952 mutex_enter(&(recv_sys->mutex));972 mutex_enter(&(recv_sys->mutex));
953 }973 }
@@ -956,7 +976,7 @@
956 recv_addr = HASH_GET_NEXT(addr_hash, recv_addr);976 recv_addr = HASH_GET_NEXT(addr_hash, recv_addr);
957 }977 }
958 978
959@@ -2308,7 +2329,7 @@979@@ -2314,7 +2335,7 @@
960 || type == MLOG_FILE_RENAME980 || type == MLOG_FILE_RENAME
961 || type == MLOG_FILE_DELETE) {981 || type == MLOG_FILE_DELETE) {
962 ut_a(space);982 ut_a(space);
@@ -965,7 +985,7 @@
965 if (recv_replay_file_ops) {985 if (recv_replay_file_ops) {
966 986
967 /* In ibbackup --apply-log, replay an .ibd file987 /* In ibbackup --apply-log, replay an .ibd file
968@@ -2331,7 +2352,7 @@988@@ -2337,7 +2358,7 @@
969 ut_error;989 ut_error;
970 }990 }
971 }991 }
@@ -974,7 +994,7 @@
974 /* In normal mysqld crash recovery we do not try to994 /* In normal mysqld crash recovery we do not try to
975 replay file operations */995 replay file operations */
976 #ifdef UNIV_LOG_LSN_DEBUG996 #ifdef UNIV_LOG_LSN_DEBUG
977@@ -2748,8 +2769,11 @@997@@ -2754,8 +2775,11 @@
978 998
979 fprintf(stderr,999 fprintf(stderr,
980 "InnoDB: Doing recovery: scanned up to"1000 "InnoDB: Doing recovery: scanned up to"
@@ -988,7 +1008,7 @@
988 }1008 }
989 }1009 }
990 1010
991@@ -2854,7 +2878,7 @@1011@@ -2860,7 +2884,7 @@
992 "InnoDB: Reading tablespace information"1012 "InnoDB: Reading tablespace information"
993 " from the .ibd files...\n");1013 " from the .ibd files...\n");
994 1014
@@ -997,7 +1017,7 @@
997 1017
998 /* If we are using the doublewrite method, we will1018 /* If we are using the doublewrite method, we will
999 check if there are half-written pages in data files,1019 check if there are half-written pages in data files,
1000@@ -2863,12 +2887,14 @@1020@@ -2869,12 +2893,14 @@
1001 1021
1002 if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) {1022 if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) {
1003 1023
@@ -1013,7 +1033,7 @@
1013 }1033 }
1014 }1034 }
1015 1035
1016@@ -3018,6 +3044,7 @@1036@@ -3024,6 +3050,7 @@
1017 recv_sys->recovered_lsn = checkpoint_lsn;1037 recv_sys->recovered_lsn = checkpoint_lsn;
1018 1038
1019 srv_start_lsn = checkpoint_lsn;1039 srv_start_lsn = checkpoint_lsn;
@@ -1021,7 +1041,7 @@
1021 }1041 }
1022 1042
1023 contiguous_lsn = ut_uint64_align_down(recv_sys->scanned_lsn,1043 contiguous_lsn = ut_uint64_align_down(recv_sys->scanned_lsn,
1024@@ -3299,6 +3326,7 @@1044@@ -3305,6 +3332,7 @@
1025 that the data dictionary tables will be free of any locks.1045 that the data dictionary tables will be free of any locks.
1026 The data dictionary latch should guarantee that there is at1046 The data dictionary latch should guarantee that there is at
1027 most one data dictionary transaction active at a time. */1047 most one data dictionary transaction active at a time. */
@@ -1031,7 +1051,7 @@
1031 1051
1032--- a/storage/innobase/os/os0file.c1052--- a/storage/innobase/os/os0file.c
1033+++ b/storage/innobase/os/os0file.c1053+++ b/storage/innobase/os/os0file.c
1034@@ -656,7 +656,7 @@1054@@ -658,7 +658,7 @@
1035 }1055 }
1036 1056
1037 #undef USE_FILE_LOCK1057 #undef USE_FILE_LOCK
@@ -1040,7 +1060,7 @@
1040 #if defined(UNIV_HOTBACKUP) || defined(__WIN__)1060 #if defined(UNIV_HOTBACKUP) || defined(__WIN__)
1041 /* InnoDB Hot Backup does not lock the data files.1061 /* InnoDB Hot Backup does not lock the data files.
1042 * On Windows, mandatory locking is used.1062 * On Windows, mandatory locking is used.
1043@@ -1456,8 +1456,9 @@1063@@ -1465,8 +1465,9 @@
1044 attributes = 0;1064 attributes = 0;
1045 ut_error;1065 ut_error;
1046 }1066 }
@@ -1051,7 +1071,7 @@
1051 GENERIC_READ | GENERIC_WRITE, /* read and write1071 GENERIC_READ | GENERIC_WRITE, /* read and write
1052 access */1072 access */
1053 share_mode, /* File can be read also by other1073 share_mode, /* File can be read also by other
1054@@ -1516,7 +1517,11 @@1074@@ -1531,7 +1532,11 @@
1055 if (create_mode == OS_FILE_OPEN || create_mode == OS_FILE_OPEN_RAW1075 if (create_mode == OS_FILE_OPEN || create_mode == OS_FILE_OPEN_RAW
1056 || create_mode == OS_FILE_OPEN_RETRY) {1076 || create_mode == OS_FILE_OPEN_RETRY) {
1057 mode_str = "OPEN";1077 mode_str = "OPEN";
@@ -1064,7 +1084,7 @@
1064 } else if (create_mode == OS_FILE_CREATE) {1084 } else if (create_mode == OS_FILE_CREATE) {
1065 mode_str = "CREATE";1085 mode_str = "CREATE";
1066 create_flag = O_RDWR | O_CREAT | O_EXCL;1086 create_flag = O_RDWR | O_CREAT | O_EXCL;
1067@@ -2694,6 +2699,9 @@1087@@ -2709,6 +2714,9 @@
1068 ut_a((offset & 0xFFFFFFFFUL) == offset);1088 ut_a((offset & 0xFFFFFFFFUL) == offset);
1069 ut_a((n & 0xFFFFFFFFUL) == n);1089 ut_a((n & 0xFFFFFFFFUL) == n);
1070 1090
@@ -1074,7 +1094,7 @@
1074 os_n_file_writes++;1094 os_n_file_writes++;
1075 1095
1076 ut_ad(file);1096 ut_ad(file);
1077@@ -2818,6 +2826,9 @@1097@@ -2833,6 +2841,9 @@
1078 #else1098 #else
1079 ssize_t ret;1099 ssize_t ret;
1080 1100
@@ -1105,7 +1125,7 @@
1105 }1125 }
1106--- a/storage/innobase/srv/srv0srv.c1126--- a/storage/innobase/srv/srv0srv.c
1107+++ b/storage/innobase/srv/srv0srv.c1127+++ b/storage/innobase/srv/srv0srv.c
1108@@ -399,6 +399,10 @@1128@@ -405,6 +405,10 @@
1109 1129
1110 UNIV_INTERN ulong srv_replication_delay = 0;1130 UNIV_INTERN ulong srv_replication_delay = 0;
1111 1131
@@ -1116,7 +1136,7 @@
1116 /*-------------------------------------------*/1136 /*-------------------------------------------*/
1117 UNIV_INTERN ulong srv_n_spin_wait_rounds = 30;1137 UNIV_INTERN ulong srv_n_spin_wait_rounds = 30;
1118 UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500;1138 UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500;
1119@@ -1078,7 +1082,7 @@1139@@ -1084,7 +1088,7 @@
1120 }1140 }
1121 1141
1122 /* Initialize some INFORMATION SCHEMA internal structures */1142 /* Initialize some INFORMATION SCHEMA internal structures */
@@ -1125,7 +1145,7 @@
1125 }1145 }
1126 1146
1127 /*********************************************************************//**1147 /*********************************************************************//**
1128@@ -1089,6 +1093,7 @@1148@@ -1095,6 +1099,7 @@
1129 /*==========*/1149 /*==========*/
1130 {1150 {
1131 os_fast_mutex_free(&srv_conc_mutex);1151 os_fast_mutex_free(&srv_conc_mutex);
@@ -1133,7 +1153,7 @@
1133 mem_free(srv_conc_slots);1153 mem_free(srv_conc_slots);
1134 srv_conc_slots = NULL;1154 srv_conc_slots = NULL;
1135 1155
1136@@ -1102,6 +1107,7 @@1156@@ -1108,6 +1113,7 @@
1137 srv_mysql_table = NULL;1157 srv_mysql_table = NULL;
1138 1158
1139 trx_i_s_cache_free(trx_i_s_cache);1159 trx_i_s_cache_free(trx_i_s_cache);
@@ -1141,7 +1161,7 @@
1141 }1161 }
1142 1162
1143 /*********************************************************************//**1163 /*********************************************************************//**
1144@@ -1717,7 +1723,7 @@1164@@ -1727,7 +1733,7 @@
1145 }1165 }
1146 1166
1147 /* Record the lock wait time for this thread */1167 /* Record the lock wait time for this thread */
@@ -1187,7 +1207,7 @@
1187 ulint1207 ulint
1188 open_or_create_data_files(1208 open_or_create_data_files(
1189 /*======================*/1209 /*======================*/
1190@@ -1419,7 +1422,7 @@1210@@ -1448,7 +1451,7 @@
1191 }1211 }
1192 #endif /* UNIV_LOG_ARCHIVE */1212 #endif /* UNIV_LOG_ARCHIVE */
1193 1213
@@ -1196,7 +1216,7 @@
1196 ut_print_timestamp(stderr);1216 ut_print_timestamp(stderr);
1197 fprintf(stderr,1217 fprintf(stderr,
1198 " InnoDB: Error: combined size of log files"1218 " InnoDB: Error: combined size of log files"
1199@@ -1714,6 +1717,10 @@1219@@ -1743,6 +1746,10 @@
1200 are initialized in trx_sys_init_at_db_start(). */1220 are initialized in trx_sys_init_at_db_start(). */
1201 1221
1202 recv_recovery_from_checkpoint_finish();1222 recv_recovery_from_checkpoint_finish();
@@ -1207,7 +1227,7 @@
1207 if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) {1227 if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) {
1208 /* The following call is necessary for the insert1228 /* The following call is necessary for the insert
1209 buffer to work with multiple tablespaces. We must1229 buffer to work with multiple tablespaces. We must
1210@@ -1873,6 +1880,17 @@1230@@ -1902,6 +1909,17 @@
1211 if (!srv_auto_extend_last_data_file1231 if (!srv_auto_extend_last_data_file
1212 && sum_of_data_file_sizes != tablespace_size_in_header) {1232 && sum_of_data_file_sizes != tablespace_size_in_header) {
1213 1233
@@ -1225,7 +1245,7 @@
1225 ut_print_timestamp(stderr);1245 ut_print_timestamp(stderr);
1226 fprintf(stderr,1246 fprintf(stderr,
1227 " InnoDB: Error: tablespace size"1247 " InnoDB: Error: tablespace size"
1228@@ -1952,6 +1970,7 @@1248@@ -1981,6 +1999,7 @@
1229 1249
1230 return(DB_ERROR);1250 return(DB_ERROR);
1231 }1251 }
@@ -1233,7 +1253,7 @@
1233 }1253 }
1234 1254
1235 /* Check that os_fast_mutexes work as expected */1255 /* Check that os_fast_mutexes work as expected */
1236@@ -1976,6 +1995,10 @@1256@@ -2005,6 +2024,10 @@
1237 1257
1238 os_fast_mutex_free(&srv_os_test_mutex);1258 os_fast_mutex_free(&srv_os_test_mutex);
1239 1259
@@ -1244,7 +1264,7 @@
1244 if (srv_print_verbose_log) {1264 if (srv_print_verbose_log) {
1245 ut_print_timestamp(stderr);1265 ut_print_timestamp(stderr);
1246 fprintf(stderr,1266 fprintf(stderr,
1247@@ -2064,6 +2087,7 @@1267@@ -2093,6 +2116,7 @@
1248 ibuf_update_max_tablespace_id();1268 ibuf_update_max_tablespace_id();
1249 }1269 }
1250 1270
@@ -1268,7 +1288,7 @@
1268 1288
1269--- a/storage/innobase/trx/trx0sys.c1289--- a/storage/innobase/trx/trx0sys.c
1270+++ b/storage/innobase/trx/trx0sys.c1290+++ b/storage/innobase/trx/trx0sys.c
1271@@ -1655,12 +1655,14 @@1291@@ -1656,12 +1656,14 @@
1272 mem_free(trx_doublewrite);1292 mem_free(trx_doublewrite);
1273 trx_doublewrite = NULL;1293 trx_doublewrite = NULL;
1274 1294
@@ -1283,7 +1303,7 @@
1283 1303
1284 /* There can't be any active transactions. */1304 /* There can't be any active transactions. */
1285 rseg = UT_LIST_GET_FIRST(trx_sys->rseg_list);1305 rseg = UT_LIST_GET_FIRST(trx_sys->rseg_list);
1286@@ -1686,10 +1688,12 @@1306@@ -1687,10 +1689,12 @@
1287 UT_LIST_REMOVE(view_list, trx_sys->view_list, prev_view);1307 UT_LIST_REMOVE(view_list, trx_sys->view_list, prev_view);
1288 }1308 }
1289 1309
@@ -1325,7 +1345,7 @@
1325 "InnoDB: Since"1345 "InnoDB: Since"
1326--- a/storage/innobase/trx/trx0purge.c1346--- a/storage/innobase/trx/trx0purge.c
1327+++ b/storage/innobase/trx/trx0purge.c1347+++ b/storage/innobase/trx/trx0purge.c
1328@@ -1129,6 +1129,9 @@1348@@ -1141,6 +1141,9 @@
1329 que_thr_t* thr;1349 que_thr_t* thr;
1330 ulint old_pages_handled;1350 ulint old_pages_handled;
1331 1351
@@ -1335,19 +1355,6 @@
1335 ut_a(purge_sys->trx->n_active_thrs == 0);1355 ut_a(purge_sys->trx->n_active_thrs == 0);
1336 1356
1337 rw_lock_x_lock(&purge_sys->latch);1357 rw_lock_x_lock(&purge_sys->latch);
1338--- a/configure.cmake
1339+++ b/configure.cmake
1340@@ -149,7 +149,9 @@
1341 SET(CMAKE_REQUIRED_LIBRARIES
1342 ${LIBM} ${LIBNSL} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT} ${LIBRT})
1343
1344- LIST(REMOVE_DUPLICATES CMAKE_REQUIRED_LIBRARIES)
1345+ IF(CMAKE_REQUIRED_LIBRARIES)
1346+ LIST(REMOVE_DUPLICATES CMAKE_REQUIRED_LIBRARIES)
1347+ ENDIF()
1348 LINK_LIBRARIES(${CMAKE_THREAD_LIBS_INIT})
1349
1350 OPTION(WITH_LIBWRAP "Compile with tcp wrappers support" OFF)
1351--- a/storage/innobase/sync/sync0arr.c1358--- a/storage/innobase/sync/sync0arr.c
1352+++ b/storage/innobase/sync/sync0arr.c1359+++ b/storage/innobase/sync/sync0arr.c
1353@@ -41,6 +41,7 @@1360@@ -41,6 +41,7 @@
@@ -1358,9 +1365,9 @@
1358 1365
1359 /*1366 /*
1360 WAIT ARRAY1367 WAIT ARRAY
1361@@ -928,6 +929,13 @@1368@@ -929,6 +930,13 @@
1362 ibool fatal = FALSE;1369 return(FALSE);
1363 double longest_diff = 0;1370 }
1364 1371
1365+ if (srv_rebuild_indexes) {1372+ if (srv_rebuild_indexes) {
1366+1373+
@@ -1374,7 +1381,7 @@
1374 extremely slowly. UNIV_DEBUG_VALGRIND does not necessary mean that1381 extremely slowly. UNIV_DEBUG_VALGRIND does not necessary mean that
1375--- a/storage/innobase/include/buf0buf.h1382--- a/storage/innobase/include/buf0buf.h
1376+++ b/storage/innobase/include/buf0buf.h1383+++ b/storage/innobase/include/buf0buf.h
1377@@ -1441,6 +1441,8 @@1384@@ -1531,6 +1531,8 @@
1378 frees a page in buffer pool */1385 frees a page in buffer pool */
1379 # endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */1386 # endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
1380 #endif /* !UNIV_HOTBACKUP */1387 #endif /* !UNIV_HOTBACKUP */
@@ -1385,7 +1392,7 @@
1385 /** The buffer control block structure */1392 /** The buffer control block structure */
1386--- a/storage/innobase/mem/mem0dbg.c1393--- a/storage/innobase/mem/mem0dbg.c
1387+++ b/storage/innobase/mem/mem0dbg.c1394+++ b/storage/innobase/mem/mem0dbg.c
1388@@ -280,18 +280,10 @@1395@@ -282,18 +282,10 @@
1389 byte* buf, /*!< in: pointer to buffer */1396 byte* buf, /*!< in: pointer to buffer */
1390 ulint n) /*!< in: length of buffer */1397 ulint n) /*!< in: length of buffer */
1391 {1398 {
@@ -1406,7 +1413,7 @@
1406 1413
1407 UNIV_MEM_INVALID(buf, n);1414 UNIV_MEM_INVALID(buf, n);
1408 }1415 }
1409@@ -306,17 +298,10 @@1416@@ -308,17 +300,10 @@
1410 byte* buf, /*!< in: pointer to buffer */1417 byte* buf, /*!< in: pointer to buffer */
1411 ulint n) /*!< in: length of buffer */1418 ulint n) /*!< in: length of buffer */
1412 {1419 {
14131420
=== modified file 'patches/innodb56.patch'
--- patches/innodb56.patch 2013-07-10 12:29:40 +0000
+++ patches/innodb56.patch 2013-07-22 14:01:36 +0000
@@ -52,7 +52,7 @@
52 block->in_unzip_LRU_list = FALSE;52 block->in_unzip_LRU_list = FALSE;
53 #endif /* UNIV_DEBUG */53 #endif /* UNIV_DEBUG */
54 #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG54 #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
55@@ -3951,6 +3959,13 @@55@@ -3963,6 +3971,13 @@
56 frame = ((buf_block_t*) bpage)->frame;56 frame = ((buf_block_t*) bpage)->frame;
57 }57 }
58 58
@@ -66,7 +66,7 @@
66 /* If this page is not uninitialized and not in the66 /* If this page is not uninitialized and not in the
67 doublewrite buffer, then the page number and space id67 doublewrite buffer, then the page number and space id
68 should be the same as in block. */68 should be the same as in block. */
69@@ -4068,7 +4083,7 @@69@@ -4080,7 +4095,7 @@
70 recv_recover_page(TRUE, (buf_block_t*) bpage);70 recv_recover_page(TRUE, (buf_block_t*) bpage);
71 }71 }
72 72
@@ -177,7 +177,7 @@
177 }177 }
178 178
179 /**********************************************************************//**179 /**********************************************************************//**
180@@ -1491,7 +1510,12 @@180@@ -1506,7 +1525,12 @@
181 the file yet; the following calls will open it and update the181 the file yet; the following calls will open it and update the
182 size fields */182 size fields */
183 183
@@ -191,7 +191,7 @@
191 fil_node_complete_io(node, fil_system, OS_FILE_READ);191 fil_node_complete_io(node, fil_system, OS_FILE_READ);
192 }192 }
193 193
194@@ -2095,7 +2119,7 @@194@@ -2109,7 +2133,7 @@
195 mem_free(path);195 mem_free(path);
196 }196 }
197 197
@@ -200,7 +200,7 @@
200 /********************************************************//**200 /********************************************************//**
201 Writes a log record about an .ibd file create/rename/delete. */201 Writes a log record about an .ibd file create/rename/delete. */
202 static202 static
203@@ -2329,7 +2353,7 @@203@@ -2343,7 +2367,7 @@
204 space_id, name, path, flags,204 space_id, name, path, flags,
205 DICT_TF2_USE_TABLESPACE,205 DICT_TF2_USE_TABLESPACE,
206 FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {206 FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {
@@ -209,7 +209,7 @@
209 }209 }
210 }210 }
211 211
212@@ -2687,7 +2711,7 @@212@@ -2702,7 +2726,7 @@
213 }213 }
214 214
215 if (err == DB_SUCCESS) {215 if (err == DB_SUCCESS) {
@@ -218,7 +218,7 @@
218 /* Write a log record about the deletion of the .ibd218 /* Write a log record about the deletion of the .ibd
219 file, so that ibbackup can replay it in the219 file, so that ibbackup can replay it in the
220 --apply-log phase. We use a dummy mtr and the familiar220 --apply-log phase. We use a dummy mtr and the familiar
221@@ -3042,7 +3066,7 @@221@@ -3057,7 +3081,7 @@
222 222
223 mutex_exit(&fil_system->mutex);223 mutex_exit(&fil_system->mutex);
224 224
@@ -227,7 +227,7 @@
227 if (success && !recv_recovery_on) {227 if (success && !recv_recovery_on) {
228 mtr_t mtr;228 mtr_t mtr;
229 229
230@@ -3426,7 +3450,7 @@230@@ -3441,7 +3465,7 @@
231 goto error_exit_1;231 goto error_exit_1;
232 }232 }
233 233
@@ -236,7 +236,7 @@
236 {236 {
237 mtr_t mtr;237 mtr_t mtr;
238 ulint mlog_file_flag = 0;238 ulint mlog_file_flag = 0;
239@@ -3504,6 +3528,97 @@239@@ -3519,6 +3543,97 @@
240 #endif /* UNIV_LOG_ARCHIVE */240 #endif /* UNIV_LOG_ARCHIVE */
241 };241 };
242 242
@@ -334,7 +334,7 @@
334 /********************************************************************//**334 /********************************************************************//**
335 Tries to open a single-table tablespace and optionally checks that the335 Tries to open a single-table tablespace and optionally checks that the
336 space id in it is correct. If this does not succeed, print an error message336 space id in it is correct. If this does not succeed, print an error message
337@@ -3569,6 +3684,9 @@337@@ -3584,6 +3699,9 @@
338 in the default location. If it is remote, it should not be here. */338 in the default location. If it is remote, it should not be here. */
339 def.filepath = fil_make_ibd_name(tablename, false);339 def.filepath = fil_make_ibd_name(tablename, false);
340 340
@@ -344,7 +344,7 @@
344 /* The path_in was read from SYS_DATAFILES. */344 /* The path_in was read from SYS_DATAFILES. */
345 if (path_in) {345 if (path_in) {
346 if (strcmp(def.filepath, path_in)) {346 if (strcmp(def.filepath, path_in)) {
347@@ -3616,6 +3734,7 @@347@@ -3631,6 +3749,7 @@
348 tablespaces_found++;348 tablespaces_found++;
349 }349 }
350 }350 }
@@ -352,7 +352,7 @@
352 352
353 /* Always look for a file at the default location. */353 /* Always look for a file at the default location. */
354 ut_a(def.filepath);354 ut_a(def.filepath);
355@@ -3712,11 +3831,15 @@355@@ -3727,11 +3846,15 @@
356 /* The following call prints an error message */356 /* The following call prints an error message */
357 os_file_get_last_error(true);357 os_file_get_last_error(true);
358 358
@@ -369,7 +369,7 @@
369 369
370 err = DB_CORRUPTION;370 err = DB_CORRUPTION;
371 371
372@@ -3974,6 +4097,9 @@372@@ -3989,6 +4112,9 @@
373 #ifdef UNIV_HOTBACKUP373 #ifdef UNIV_HOTBACKUP
374 fil_space_t* space;374 fil_space_t* space;
375 #endif375 #endif
@@ -379,7 +379,7 @@
379 379
380 memset(&def, 0, sizeof(def));380 memset(&def, 0, sizeof(def));
381 memset(&remote, 0, sizeof(remote));381 memset(&remote, 0, sizeof(remote));
382@@ -4018,6 +4144,9 @@382@@ -4033,6 +4159,9 @@
383 # endif /* !UNIV_HOTBACKUP */383 # endif /* !UNIV_HOTBACKUP */
384 #endif384 #endif
385 385
@@ -389,7 +389,7 @@
389 /* Check for a link file which locates a remote tablespace. */389 /* Check for a link file which locates a remote tablespace. */
390 remote.success = fil_open_linked_file(390 remote.success = fil_open_linked_file(
391 tablename, &remote.filepath, &remote.file);391 tablename, &remote.filepath, &remote.file);
392@@ -4028,8 +4157,20 @@392@@ -4043,8 +4172,20 @@
393 if (!remote.success) {393 if (!remote.success) {
394 os_file_close(remote.file);394 os_file_close(remote.file);
395 mem_free(remote.filepath);395 mem_free(remote.filepath);
@@ -410,7 +410,7 @@
410 410
411 411
412 /* Try to open the tablespace in the datadir. */412 /* Try to open the tablespace in the datadir. */
413@@ -4042,6 +4183,17 @@413@@ -4057,6 +4198,17 @@
414 fil_validate_single_table_tablespace(tablename, &def);414 fil_validate_single_table_tablespace(tablename, &def);
415 if (!def.success) {415 if (!def.success) {
416 os_file_close(def.file);416 os_file_close(def.file);
@@ -428,7 +428,7 @@
428 }428 }
429 }429 }
430 430
431@@ -4114,7 +4266,7 @@431@@ -4129,7 +4281,7 @@
432 /* At this point, only one tablespace is open */432 /* At this point, only one tablespace is open */
433 ut_a(def.success == !remote.success);433 ut_a(def.success == !remote.success);
434 434
@@ -437,7 +437,7 @@
437 437
438 /* Get and test the file size. */438 /* Get and test the file size. */
439 size = os_file_get_size(fsp->file);439 size = os_file_get_size(fsp->file);
440@@ -4133,9 +4285,9 @@440@@ -4148,9 +4300,9 @@
441 441
442 /* Every .ibd file is created >= 4 pages in size. Smaller files442 /* Every .ibd file is created >= 4 pages in size. Smaller files
443 cannot be ok. */443 cannot be ok. */
@@ -449,7 +449,7 @@
449 ib_logf(IB_LOG_LEVEL_ERROR,449 ib_logf(IB_LOG_LEVEL_ERROR,
450 "The size of single-table tablespace file %s "450 "The size of single-table tablespace file %s "
451 "is only " UINT64PF ", should be at least %lu!",451 "is only " UINT64PF ", should be at least %lu!",
452@@ -4216,7 +4368,7 @@452@@ -4231,7 +4383,7 @@
453 }453 }
454 mutex_exit(&fil_system->mutex);454 mutex_exit(&fil_system->mutex);
455 #endif /* UNIV_HOTBACKUP */455 #endif /* UNIV_HOTBACKUP */
@@ -458,7 +458,7 @@
458 tablename, fsp->id, fsp->flags, FIL_TABLESPACE);458 tablename, fsp->id, fsp->flags, FIL_TABLESPACE);
459 459
460 if (!file_space_create_success) {460 if (!file_space_create_success) {
461@@ -4243,13 +4395,55 @@461@@ -4258,13 +4410,55 @@
462 }462 }
463 463
464 func_exit:464 func_exit:
@@ -518,7 +518,7 @@
518 mem_free(tablename);518 mem_free(tablename);
519 if (remote.success) {519 if (remote.success) {
520 mem_free(remote.filepath);520 mem_free(remote.filepath);
521@@ -4263,7 +4457,7 @@521@@ -4278,7 +4472,7 @@
522 idea is to read as much good data as we can and jump over bad data.522 idea is to read as much good data as we can and jump over bad data.
523 @return 0 if ok, -1 if error even after the retries, 1 if at the end523 @return 0 if ok, -1 if error even after the retries, 1 if at the end
524 of the directory */524 of the directory */
@@ -527,7 +527,7 @@
527 int527 int
528 fil_file_readdir_next_file(528 fil_file_readdir_next_file(
529 /*=======================*/529 /*=======================*/
530@@ -4303,7 +4497,7 @@530@@ -4318,7 +4512,7 @@
531 @return DB_SUCCESS or error number */531 @return DB_SUCCESS or error number */
532 UNIV_INTERN532 UNIV_INTERN
533 dberr_t533 dberr_t
@@ -536,7 +536,7 @@
536 /*===================================*/536 /*===================================*/
537 {537 {
538 int ret;538 int ret;
539@@ -4359,7 +4553,9 @@539@@ -4374,7 +4568,9 @@
540 "%s/%s", fil_path_to_mysql_datadir, dbinfo.name);540 "%s/%s", fil_path_to_mysql_datadir, dbinfo.name);
541 srv_normalize_path_for_win(dbpath);541 srv_normalize_path_for_win(dbpath);
542 542
@@ -547,7 +547,7 @@
547 547
548 if (dbdir != NULL) {548 if (dbdir != NULL) {
549 549
550@@ -4380,9 +4576,15 @@550@@ -4395,9 +4591,15 @@
551 && (0 == strcmp(fileinfo.name551 && (0 == strcmp(fileinfo.name
552 + strlen(fileinfo.name) - 4,552 + strlen(fileinfo.name) - 4,
553 ".ibd")553 ".ibd")
@@ -565,7 +565,7 @@
565 /* The name ends in .ibd or .isl;565 /* The name ends in .ibd or .isl;
566 try opening the file */566 try opening the file */
567 fil_load_single_table_tablespace(567 fil_load_single_table_tablespace(
568@@ -4538,6 +4740,7 @@568@@ -4553,6 +4755,7 @@
569 {569 {
570 fil_space_t* fnamespace;570 fil_space_t* fnamespace;
571 fil_space_t* space;571 fil_space_t* space;
@@ -573,7 +573,7 @@
573 573
574 ut_ad(fil_system);574 ut_ad(fil_system);
575 575
576@@ -4615,6 +4818,10 @@576@@ -4630,6 +4833,10 @@
577 if (fnamespace == NULL) {577 if (fnamespace == NULL) {
578 if (print_error_if_does_not_exist) {578 if (print_error_if_does_not_exist) {
579 fil_report_missing_tablespace(name, id);579 fil_report_missing_tablespace(name, id);
@@ -584,7 +584,7 @@
584 }584 }
585 } else {585 } else {
586 ut_print_timestamp(stderr);586 ut_print_timestamp(stderr);
587@@ -4638,6 +4845,10 @@587@@ -4653,6 +4860,10 @@
588 588
589 mutex_exit(&fil_system->mutex);589 mutex_exit(&fil_system->mutex);
590 590
@@ -595,7 +595,7 @@
595 return(FALSE);595 return(FALSE);
596 }596 }
597 597
598@@ -4728,6 +4939,7 @@598@@ -4743,6 +4954,7 @@
599 ulint page_size;599 ulint page_size;
600 ulint pages_added;600 ulint pages_added;
601 ibool success;601 ibool success;
@@ -603,7 +603,7 @@
603 603
604 ut_ad(!srv_read_only_mode);604 ut_ad(!srv_read_only_mode);
605 605
606@@ -4772,13 +4984,17 @@606@@ -4787,13 +4999,17 @@
607 goto retry;607 goto retry;
608 }608 }
609 609
@@ -622,7 +622,7 @@
622 start_page_no = space->size;622 start_page_no = space->size;
623 file_start_page_no = space->size - node->size;623 file_start_page_no = space->size - node->size;
624 624
625@@ -5024,7 +5240,7 @@625@@ -5039,7 +5255,7 @@
626 off the LRU list if it is in the LRU list. The caller must hold the fil_sys626 off the LRU list if it is in the LRU list. The caller must hold the fil_sys
627 mutex. */627 mutex. */
628 static628 static
@@ -631,7 +631,7 @@
631 fil_node_prepare_for_io(631 fil_node_prepare_for_io(
632 /*====================*/632 /*====================*/
633 fil_node_t* node, /*!< in: file node */633 fil_node_t* node, /*!< in: file node */
634@@ -5044,9 +5260,12 @@634@@ -5059,9 +5275,12 @@
635 }635 }
636 636
637 if (node->open == FALSE) {637 if (node->open == FALSE) {
@@ -645,7 +645,7 @@
645 }645 }
646 646
647 if (node->n_pending == 0 && fil_space_belongs_in_lru(space)) {647 if (node->n_pending == 0 && fil_space_belongs_in_lru(space)) {
648@@ -5058,6 +5277,8 @@648@@ -5073,6 +5292,8 @@
649 }649 }
650 650
651 node->n_pending++;651 node->n_pending++;
@@ -654,7 +654,7 @@
654 }654 }
655 655
656 /********************************************************************//**656 /********************************************************************//**
657@@ -5259,6 +5480,16 @@657@@ -5274,6 +5495,16 @@
658 658
659 ut_ad(mode != OS_AIO_IBUF || space->purpose == FIL_TABLESPACE);659 ut_ad(mode != OS_AIO_IBUF || space->purpose == FIL_TABLESPACE);
660 660
@@ -671,7 +671,7 @@
671 node = UT_LIST_GET_FIRST(space->chain);671 node = UT_LIST_GET_FIRST(space->chain);
672 672
673 for (;;) {673 for (;;) {
674@@ -5290,7 +5521,11 @@674@@ -5305,7 +5536,11 @@
675 }675 }
676 676
677 /* Open file if closed */677 /* Open file if closed */
@@ -684,7 +684,7 @@
684 684
685 /* Check that at least the start offset is within the bounds of a685 /* Check that at least the start offset is within the bounds of a
686 single-table tablespace, including rollback tablespaces. */686 single-table tablespace, including rollback tablespaces. */
687@@ -6164,6 +6399,7 @@687@@ -6179,6 +6414,7 @@
688 return(err);688 return(err);
689 }689 }
690 690
@@ -692,11 +692,10 @@
692 /****************************************************************//**692 /****************************************************************//**
693 Generate redo logs for swapping two .ibd files */693 Generate redo logs for swapping two .ibd files */
694 UNIV_INTERN694 UNIV_INTERN
695@@ -6187,4 +6423,4 @@695@@ -6205,3 +6441,4 @@
696 0, 0, new_name, old_name, &mtr);696 0, 0, new_name, old_name, mtr);
697 mtr_commit(&mtr);697 }
698 }698 }
699-
700+#endif699+#endif
701--- a/storage/innobase/handler/ha_innodb.cc700--- a/storage/innobase/handler/ha_innodb.cc
702+++ b/storage/innobase/handler/ha_innodb.cc701+++ b/storage/innobase/handler/ha_innodb.cc
@@ -709,7 +708,7 @@
709 708
710 if (thd && thd_sql_command(thd) == SQLCOM_DROP_TABLE) {709 if (thd && thd_sql_command(thd) == SQLCOM_DROP_TABLE) {
711 710
712@@ -2423,43 +2423,19 @@711@@ -2459,43 +2459,19 @@
713 ulint buflen, /*!< in: length of buf, in bytes */712 ulint buflen, /*!< in: length of buf, in bytes */
714 const char* id, /*!< in: identifier to convert */713 const char* id, /*!< in: identifier to convert */
715 ulint idlen, /*!< in: length of id, in bytes */714 ulint idlen, /*!< in: length of id, in bytes */
@@ -758,7 +757,7 @@
758 if (UNIV_UNLIKELY(idlen > buflen)) {757 if (UNIV_UNLIKELY(idlen > buflen)) {
759 idlen = buflen;758 idlen = buflen;
760 }759 }
761@@ -16642,45 +16618,24 @@760@@ -16774,45 +16750,24 @@
762 void761 void
763 ib_logf(762 ib_logf(
764 /*====*/763 /*====*/
@@ -1022,20 +1021,6 @@
1022 #if defined(UNIV_HOTBACKUP) || defined(__WIN__)1021 #if defined(UNIV_HOTBACKUP) || defined(__WIN__)
1023 /* InnoDB Hot Backup does not lock the data files.1022 /* InnoDB Hot Backup does not lock the data files.
1024 * On Windows, mandatory locking is used.1023 * On Windows, mandatory locking is used.
1025--- a/storage/innobase/row/row0merge.cc
1026+++ b/storage/innobase/row/row0merge.cc
1027@@ -3227,9 +3227,11 @@
1028 goto err_exit;
1029 }
1030
1031+#if 0
1032 /* Generate the redo logs for file operations */
1033 fil_mtr_rename_log(old_table->space, old_name,
1034 new_table->space, new_table->name, tmp_name);
1035+#endif
1036
1037 /* What if the redo logs are flushed to disk here? This is
1038 tested with following crash point */
1039--- a/storage/innobase/srv/srv0srv.cc1024--- a/storage/innobase/srv/srv0srv.cc
1040+++ b/storage/innobase/srv/srv0srv.cc1025+++ b/storage/innobase/srv/srv0srv.cc
1041@@ -349,6 +349,10 @@1026@@ -349,6 +349,10 @@
@@ -1049,7 +1034,7 @@
1049 /*-------------------------------------------*/1034 /*-------------------------------------------*/
1050 UNIV_INTERN ulong srv_n_spin_wait_rounds = 30;1035 UNIV_INTERN ulong srv_n_spin_wait_rounds = 30;
1051 UNIV_INTERN ulong srv_spin_wait_delay = 6;1036 UNIV_INTERN ulong srv_spin_wait_delay = 6;
1052@@ -1808,7 +1812,8 @@1037@@ -1814,7 +1818,8 @@
1053 if (ret == SRV_NONE1038 if (ret == SRV_NONE
1054 && srv_shutdown_state != SRV_SHUTDOWN_NONE1039 && srv_shutdown_state != SRV_SHUTDOWN_NONE
1055 && trx_purge_state() != PURGE_STATE_DISABLED1040 && trx_purge_state() != PURGE_STATE_DISABLED
@@ -1173,7 +1158,7 @@
1173 if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) {1158 if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) {
1174 /* The following call is necessary for the insert1159 /* The following call is necessary for the insert
1175 buffer to work with multiple tablespaces. We must1160 buffer to work with multiple tablespaces. We must
1176@@ -2439,7 +2452,9 @@1161@@ -2439,7 +2453,9 @@
1177 value. Important to note that we can do it ONLY after1162 value. Important to note that we can do it ONLY after
1178 we have finished the recovery process so that the1163 we have finished the recovery process so that the
1179 image of TRX_SYS_PAGE_NO is not stale. */1164 image of TRX_SYS_PAGE_NO is not stale. */
@@ -1184,7 +1169,7 @@
1184 }1169 }
1185 1170
1186 if (!create_new_db && sum_of_new_sizes > 0) {1171 if (!create_new_db && sum_of_new_sizes > 0) {
1187@@ -2647,6 +2662,7 @@1172@@ -2647,6 +2663,7 @@
1188 && srv_auto_extend_last_data_file1173 && srv_auto_extend_last_data_file
1189 && sum_of_data_file_sizes < tablespace_size_in_header) {1174 && sum_of_data_file_sizes < tablespace_size_in_header) {
1190 1175
@@ -1192,7 +1177,7 @@
1192 ut_print_timestamp(stderr);1177 ut_print_timestamp(stderr);
1193 fprintf(stderr,1178 fprintf(stderr,
1194 " InnoDB: Error: tablespace size stored in header"1179 " InnoDB: Error: tablespace size stored in header"
1195@@ -2683,6 +2698,7 @@1180@@ -2683,6 +2700,7 @@
1196 1181
1197 return(DB_ERROR);1182 return(DB_ERROR);
1198 }1183 }
@@ -1200,7 +1185,7 @@
1200 }1185 }
1201 1186
1202 /* Check that os_fast_mutexes work as expected */1187 /* Check that os_fast_mutexes work as expected */
1203@@ -2707,6 +2723,10 @@1188@@ -2707,6 +2725,10 @@
1204 1189
1205 os_fast_mutex_free(&srv_os_test_mutex);1190 os_fast_mutex_free(&srv_os_test_mutex);
1206 1191
@@ -1211,7 +1196,7 @@
1211 if (srv_print_verbose_log) {1196 if (srv_print_verbose_log) {
1212 ib_logf(IB_LOG_LEVEL_INFO,1197 ib_logf(IB_LOG_LEVEL_INFO,
1213 "%s started; log sequence number " LSN_PF "",1198 "%s started; log sequence number " LSN_PF "",
1214@@ -2739,6 +2759,7 @@1199@@ -2739,6 +2761,7 @@
1215 fts_optimize_init();1200 fts_optimize_init();
1216 }1201 }
1217 1202
@@ -1219,7 +1204,7 @@
1219 srv_was_started = TRUE;1204 srv_was_started = TRUE;
1220 1205
1221 return(DB_SUCCESS);1206 return(DB_SUCCESS);
1222@@ -2794,7 +2815,7 @@1207@@ -2794,7 +2817,7 @@
1223 return(DB_SUCCESS);1208 return(DB_SUCCESS);
1224 }1209 }
1225 1210
@@ -1285,7 +1270,7 @@
1285 total_trx = UT_LIST_GET_LEN(trx_sys->rw_trx_list)1270 total_trx = UT_LIST_GET_LEN(trx_sys->rw_trx_list)
1286--- a/storage/innobase/trx/trx0trx.cc1271--- a/storage/innobase/trx/trx0trx.cc
1287+++ b/storage/innobase/trx/trx0trx.cc1272+++ b/storage/innobase/trx/trx0trx.cc
1288@@ -2053,7 +2053,8 @@1273@@ -2084,7 +2084,8 @@
1289 scenario where some undo generated by a transaction,1274 scenario where some undo generated by a transaction,
1290 has XA stuff, and other undo, generated by the same1275 has XA stuff, and other undo, generated by the same
1291 transaction, doesn't. */1276 transaction, doesn't. */
@@ -1320,7 +1305,7 @@
1320 1305
1321 /*1306 /*
1322 WAIT ARRAY1307 WAIT ARRAY
1323@@ -903,6 +904,13 @@1308@@ -899,6 +900,13 @@
1324 ibool fatal = FALSE;1309 ibool fatal = FALSE;
1325 double longest_diff = 0;1310 double longest_diff = 0;
1326 1311
@@ -1336,7 +1321,7 @@
1336 return(FALSE);1321 return(FALSE);
1337--- a/storage/innobase/include/buf0buf.h1322--- a/storage/innobase/include/buf0buf.h
1338+++ b/storage/innobase/include/buf0buf.h1323+++ b/storage/innobase/include/buf0buf.h
1339@@ -1583,6 +1583,8 @@1324@@ -1580,6 +1580,8 @@
1340 or buf_block_t::mutex. */1325 or buf_block_t::mutex. */
1341 # endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */1326 # endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
1342 #endif /* !UNIV_HOTBACKUP */1327 #endif /* !UNIV_HOTBACKUP */
@@ -1390,7 +1375,7 @@
1390 }1375 }
1391--- a/storage/innobase/include/srv0start.h1376--- a/storage/innobase/include/srv0start.h
1392+++ b/storage/innobase/include/srv0start.h1377+++ b/storage/innobase/include/srv0start.h
1393@@ -77,6 +77,23 @@1378@@ -68,6 +68,23 @@
1394 srv_add_path_separator_if_needed(1379 srv_add_path_separator_if_needed(
1395 /*=============================*/1380 /*=============================*/
1396 char* str); /*!< in: null-terminated character string */1381 char* str); /*!< in: null-terminated character string */
@@ -1416,7 +1401,7 @@
1416 Starts Innobase and creates a new database if database files1401 Starts Innobase and creates a new database if database files
1417--- a/configure.cmake1402--- a/configure.cmake
1418+++ b/configure.cmake1403+++ b/configure.cmake
1419@@ -965,14 +965,6 @@1404@@ -979,14 +979,6 @@
1420 ENDIF()1405 ENDIF()
1421 1406
1422 CHECK_C_SOURCE_COMPILES("1407 CHECK_C_SOURCE_COMPILES("
@@ -1448,3 +1433,21 @@
1448 return tmp && tmp->init ? &tmp->dbug : 0;1433 return tmp && tmp->init ? &tmp->dbug : 0;
1449 }1434 }
1450 #endif /* DBUG_OFF */1435 #endif /* DBUG_OFF */
1436--- a/storage/innobase/handler/handler0alter.cc
1437+++ b/storage/innobase/handler/handler0alter.cc
1438@@ -5434,6 +5434,7 @@
1439 = static_cast<ha_innobase_inplace_ctx*>(*pctx);
1440
1441 DBUG_ASSERT(ctx->need_rebuild());
1442+#if 0
1443 /* Generate the redo log for the file
1444 operations that will be performed in
1445 commit_cache_rebuild(). */
1446@@ -5442,6 +5443,7 @@
1447 ctx->new_table->space,
1448 ctx->new_table->name,
1449 ctx->tmp_name, &mtr);
1450+#endif
1451 DBUG_INJECT_CRASH("ib_commit_inplace_crash",
1452 crash_inject_count++);
1453 }
14511454
=== modified file 'patches/xtradb51.patch'
--- patches/xtradb51.patch 2013-05-07 13:32:47 +0000
+++ patches/xtradb51.patch 2013-07-22 14:01:36 +0000
@@ -1,6 +1,6 @@
1--- a/storage/innodb_plugin/btr/btr0btr.c1--- a/storage/innodb_plugin/btr/btr0btr.c
2+++ b/storage/innodb_plugin/btr/btr0btr.c2+++ b/storage/innodb_plugin/btr/btr0btr.c
3@@ -674,7 +674,7 @@3@@ -680,7 +680,7 @@
4 /**************************************************************//**4 /**************************************************************//**
5 Gets the root node of a tree and x-latches it.5 Gets the root node of a tree and x-latches it.
6 @return root page, x-latched */6 @return root page, x-latched */
@@ -9,7 +9,7 @@
9 buf_block_t*9 buf_block_t*
10 btr_root_block_get(10 btr_root_block_get(
11 /*===============*/11 /*===============*/
12@@ -1134,7 +1134,7 @@12@@ -1198,7 +1198,7 @@
13 /************************************************************//**13 /************************************************************//**
14 Returns the child page of a node pointer and x-latches it.14 Returns the child page of a node pointer and x-latches it.
15 @return child page, x-latched */15 @return child page, x-latched */
@@ -28,7 +28,7 @@
28 28
29 /* prototypes for new functions added to ha_innodb.cc */29 /* prototypes for new functions added to ha_innodb.cc */
30 trx_t* innobase_get_trx();30 trx_t* innobase_get_trx();
31@@ -412,7 +413,7 @@31@@ -414,7 +415,7 @@
32 return(TRUE);32 return(TRUE);
33 }33 }
34 34
@@ -37,7 +37,7 @@
37 if (recv_lsn_checks_on) {37 if (recv_lsn_checks_on) {
38 ib_uint64_t current_lsn;38 ib_uint64_t current_lsn;
39 39
40@@ -744,6 +745,7 @@40@@ -746,6 +747,7 @@
41 block->page.zip_list.prev = NULL;41 block->page.zip_list.prev = NULL;
42 block->page.zip_list.next = NULL;42 block->page.zip_list.next = NULL;
43 block->page.in_LRU_list = FALSE;43 block->page.in_LRU_list = FALSE;
@@ -45,7 +45,7 @@
45 block->in_unzip_LRU_list = FALSE;45 block->in_unzip_LRU_list = FALSE;
46 #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG46 #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
47 block->n_pointers = 0;47 block->n_pointers = 0;
48@@ -1888,7 +1890,9 @@48@@ -1787,7 +1789,9 @@
49 ut_ad(zip_size == fil_space_get_zip_size(space));49 ut_ad(zip_size == fil_space_get_zip_size(space));
50 ut_ad(ut_is_2pow(zip_size));50 ut_ad(ut_is_2pow(zip_size));
51 #ifndef UNIV_LOG_DEBUG51 #ifndef UNIV_LOG_DEBUG
@@ -56,7 +56,7 @@
56 #endif56 #endif
57 if (innobase_get_slow_log()) {57 if (innobase_get_slow_log()) {
58 trx = innobase_get_trx();58 trx = innobase_get_trx();
59@@ -3190,6 +3194,13 @@59@@ -3096,6 +3100,13 @@
60 frame = ((buf_block_t*) bpage)->frame;60 frame = ((buf_block_t*) bpage)->frame;
61 }61 }
62 62
@@ -70,7 +70,7 @@
70 /* If this page is not uninitialized and not in the70 /* If this page is not uninitialized and not in the
71 doublewrite buffer, then the page number and space id71 doublewrite buffer, then the page number and space id
72 should be the same as in block. */72 should be the same as in block. */
73@@ -3302,7 +3313,8 @@73@@ -3208,7 +3219,8 @@
74 recv_recover_page(TRUE, (buf_block_t*) bpage);74 recv_recover_page(TRUE, (buf_block_t*) bpage);
75 }75 }
76 76
@@ -82,7 +82,7 @@
82 (srv_pass_corrupt_table && bpage->is_corrupt) ? NULL :82 (srv_pass_corrupt_table && bpage->is_corrupt) ? NULL :
83--- a/storage/innodb_plugin/fil/fil0fil.c83--- a/storage/innodb_plugin/fil/fil0fil.c
84+++ b/storage/innodb_plugin/fil/fil0fil.c84+++ b/storage/innodb_plugin/fil/fil0fil.c
85@@ -297,7 +297,7 @@85@@ -298,7 +298,7 @@
86 86
87 /** The tablespace memory cache. This variable is NULL before the module is87 /** The tablespace memory cache. This variable is NULL before the module is
88 initialized. */88 initialized. */
@@ -91,7 +91,7 @@
91 91
92 92
93 /********************************************************************//**93 /********************************************************************//**
94@@ -308,7 +308,7 @@94@@ -309,7 +309,7 @@
95 off the LRU list if it is in the LRU list. The caller must hold the fil_sys95 off the LRU list if it is in the LRU list. The caller must hold the fil_sys
96 mutex. */96 mutex. */
97 static97 static
@@ -100,7 +100,7 @@
100 fil_node_prepare_for_io(100 fil_node_prepare_for_io(
101 /*====================*/101 /*====================*/
102 fil_node_t* node, /*!< in: file node */102 fil_node_t* node, /*!< in: file node */
103@@ -633,7 +633,7 @@103@@ -634,7 +634,7 @@
104 Opens a the file of a node of a tablespace. The caller must own the fil_system104 Opens a the file of a node of a tablespace. The caller must own the fil_system
105 mutex. */105 mutex. */
106 static106 static
@@ -109,7 +109,7 @@
109 fil_node_open_file(109 fil_node_open_file(
110 /*===============*/110 /*===============*/
111 fil_node_t* node, /*!< in: file node */111 fil_node_t* node, /*!< in: file node */
112@@ -667,7 +667,17 @@112@@ -668,7 +668,17 @@
113 node->name, OS_FILE_OPEN, OS_FILE_READ_ONLY, &success);113 node->name, OS_FILE_OPEN, OS_FILE_READ_ONLY, &success);
114 if (!success) {114 if (!success) {
115 /* The following call prints an error message */115 /* The following call prints an error message */
@@ -128,7 +128,7 @@
128 128
129 ut_print_timestamp(stderr);129 ut_print_timestamp(stderr);
130 130
131@@ -728,12 +738,14 @@131@@ -729,12 +739,14 @@
132 132
133 if (UNIV_UNLIKELY(space_id != space->id)) {133 if (UNIV_UNLIKELY(space_id != space->id)) {
134 fprintf(stderr,134 fprintf(stderr,
@@ -147,7 +147,7 @@
147 }147 }
148 148
149 if (UNIV_UNLIKELY(space_id == ULINT_UNDEFINED149 if (UNIV_UNLIKELY(space_id == ULINT_UNDEFINED
150@@ -757,8 +769,8 @@150@@ -758,8 +770,8 @@
151 }151 }
152 152
153 if (size_bytes >= 1024 * 1024) {153 if (size_bytes >= 1024 * 1024) {
@@ -158,7 +158,7 @@
158 }158 }
159 159
160 if (!(flags & DICT_TF_ZSSIZE_MASK)) {160 if (!(flags & DICT_TF_ZSSIZE_MASK)) {
161@@ -803,6 +815,8 @@161@@ -804,6 +816,8 @@
162 /* Put the node to the LRU list */162 /* Put the node to the LRU list */
163 UT_LIST_ADD_FIRST(LRU, system->LRU, node);163 UT_LIST_ADD_FIRST(LRU, system->LRU, node);
164 }164 }
@@ -167,7 +167,7 @@
167 }167 }
168 168
169 /**********************************************************************//**169 /**********************************************************************//**
170@@ -1431,7 +1445,12 @@170@@ -1451,7 +1465,12 @@
171 the file yet; the following calls will open it and update the171 the file yet; the following calls will open it and update the
172 size fields */172 size fields */
173 173
@@ -181,7 +181,7 @@
181 fil_node_complete_io(node, fil_system, OS_FILE_READ);181 fil_node_complete_io(node, fil_system, OS_FILE_READ);
182 }182 }
183 183
184@@ -1483,7 +1502,12 @@184@@ -1503,7 +1522,12 @@
185 the file yet; the following calls will open it and update the185 the file yet; the following calls will open it and update the
186 size fields */186 size fields */
187 187
@@ -195,7 +195,7 @@
195 fil_node_complete_io(node, fil_system, OS_FILE_READ);195 fil_node_complete_io(node, fil_system, OS_FILE_READ);
196 }196 }
197 197
198@@ -1933,7 +1957,7 @@198@@ -1952,7 +1976,7 @@
199 mem_free(path);199 mem_free(path);
200 }200 }
201 201
@@ -204,7 +204,7 @@
204 /********************************************************//**204 /********************************************************//**
205 Writes a log record about an .ibd file create/rename/delete. */205 Writes a log record about an .ibd file create/rename/delete. */
206 static206 static
207@@ -2157,7 +2181,7 @@207@@ -2176,7 +2200,7 @@
208 if (fil_create_new_single_table_tablespace(208 if (fil_create_new_single_table_tablespace(
209 space_id, name, FALSE, flags,209 space_id, name, FALSE, flags,
210 FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {210 FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {
@@ -213,7 +213,7 @@
213 }213 }
214 }214 }
215 215
216@@ -2324,7 +2348,7 @@216@@ -2344,7 +2368,7 @@
217 }217 }
218 218
219 if (success) {219 if (success) {
@@ -222,16 +222,16 @@
222 /* Write a log record about the deletion of the .ibd222 /* Write a log record about the deletion of the .ibd
223 file, so that ibbackup can replay it in the223 file, so that ibbackup can replay it in the
224 --apply-log phase. We use a dummy mtr and the familiar224 --apply-log phase. We use a dummy mtr and the familiar
225@@ -2625,7 +2649,7 @@225@@ -2645,7 +2669,7 @@
226 226
227 mutex_exit(&fil_system->mutex);227 mutex_exit(&fil_system->mutex);
228 228
229-#ifndef UNIV_HOTBACKUP229-#ifndef UNIV_HOTBACKUP
230+#ifdef UNDEFINED230+#ifdef UNDEFINED
231 if (success) {231 if (success && !recv_recovery_on) {
232 mtr_t mtr;232 mtr_t mtr;
233 233
234@@ -2815,7 +2839,7 @@234@@ -2835,7 +2859,7 @@
235 235
236 fil_node_create(path, size, space_id, FALSE);236 fil_node_create(path, size, space_id, FALSE);
237 237
@@ -240,7 +240,7 @@
240 {240 {
241 mtr_t mtr;241 mtr_t mtr;
242 242
243@@ -3159,19 +3183,97 @@243@@ -3182,19 +3206,97 @@
244 "InnoDB: open the tablespace file ", stderr);244 "InnoDB: open the tablespace file ", stderr);
245 ut_print_filename(stderr, filepath);245 ut_print_filename(stderr, filepath);
246 fputs("!\n"246 fputs("!\n"
@@ -348,7 +348,7 @@
348 return(FALSE);348 return(FALSE);
349 }349 }
350 350
351@@ -4106,7 +4208,7 @@351@@ -4138,7 +4240,7 @@
352 cannot be ok. */352 cannot be ok. */
353 353
354 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;354 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;
@@ -357,7 +357,7 @@
357 if (size < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {357 if (size < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {
358 fprintf(stderr,358 fprintf(stderr,
359 "InnoDB: Error: the size of single-table tablespace"359 "InnoDB: Error: the size of single-table tablespace"
360@@ -4236,7 +4338,51 @@360@@ -4268,7 +4370,51 @@
361 361
362 fil_node_create(filepath, 0, space_id, FALSE);362 fil_node_create(filepath, 0, space_id, FALSE);
363 func_exit:363 func_exit:
@@ -410,7 +410,7 @@
410 ut_free(buf2);410 ut_free(buf2);
411 mem_free(filepath);411 mem_free(filepath);
412 }412 }
413@@ -4247,7 +4393,7 @@413@@ -4279,7 +4425,7 @@
414 idea is to read as much good data as we can and jump over bad data.414 idea is to read as much good data as we can and jump over bad data.
415 @return 0 if ok, -1 if error even after the retries, 1 if at the end415 @return 0 if ok, -1 if error even after the retries, 1 if at the end
416 of the directory */416 of the directory */
@@ -419,7 +419,7 @@
419 int419 int
420 fil_file_readdir_next_file(420 fil_file_readdir_next_file(
421 /*=======================*/421 /*=======================*/
422@@ -4291,7 +4437,7 @@422@@ -4323,7 +4469,7 @@
423 @return DB_SUCCESS or error number */423 @return DB_SUCCESS or error number */
424 UNIV_INTERN424 UNIV_INTERN
425 ulint425 ulint
@@ -428,7 +428,7 @@
428 /*===================================*/428 /*===================================*/
429 {429 {
430 int ret;430 int ret;
431@@ -4347,7 +4493,9 @@431@@ -4379,7 +4525,9 @@
432 dbinfo.name);432 dbinfo.name);
433 srv_normalize_path_for_win(dbpath);433 srv_normalize_path_for_win(dbpath);
434 434
@@ -439,7 +439,7 @@
439 439
440 if (dbdir != NULL) {440 if (dbdir != NULL) {
441 /* printf("Opened dir %s\n", dbinfo.name); */441 /* printf("Opened dir %s\n", dbinfo.name); */
442@@ -4373,8 +4521,11 @@442@@ -4405,8 +4553,11 @@
443 ".ibd")) {443 ".ibd")) {
444 /* The name ends in .ibd; try opening444 /* The name ends in .ibd; try opening
445 the file */445 the file */
@@ -452,7 +452,7 @@
452 }452 }
453 next_file_item:453 next_file_item:
454 ret = fil_file_readdir_next_file(&err,454 ret = fil_file_readdir_next_file(&err,
455@@ -4546,15 +4697,97 @@455@@ -4578,15 +4729,97 @@
456 "InnoDB: in InnoDB data dictionary"456 "InnoDB: in InnoDB data dictionary"
457 " has tablespace id %lu,\n"457 " has tablespace id %lu,\n"
458 "InnoDB: but tablespace with that id"458 "InnoDB: but tablespace with that id"
@@ -558,7 +558,7 @@
558 } else {558 } else {
559 ut_print_timestamp(stderr);559 ut_print_timestamp(stderr);
560 fputs(" InnoDB: Error: table ", stderr);560 fputs(" InnoDB: Error: table ", stderr);
561@@ -4953,7 +5186,7 @@561@@ -4985,7 +5218,7 @@
562 off the LRU list if it is in the LRU list. The caller must hold the fil_sys562 off the LRU list if it is in the LRU list. The caller must hold the fil_sys
563 mutex. */563 mutex. */
564 static564 static
@@ -567,7 +567,7 @@
567 fil_node_prepare_for_io(567 fil_node_prepare_for_io(
568 /*====================*/568 /*====================*/
569 fil_node_t* node, /*!< in: file node */569 fil_node_t* node, /*!< in: file node */
570@@ -4973,10 +5206,13 @@570@@ -5005,10 +5238,13 @@
571 }571 }
572 572
573 if (node->open == FALSE) {573 if (node->open == FALSE) {
@@ -582,7 +582,7 @@
582 }582 }
583 583
584 if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE584 if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE
585@@ -4989,6 +5225,8 @@585@@ -5021,6 +5257,8 @@
586 }586 }
587 587
588 node->n_pending++;588 node->n_pending++;
@@ -591,7 +591,7 @@
591 }591 }
592 592
593 /********************************************************************//**593 /********************************************************************//**
594@@ -5125,7 +5363,9 @@594@@ -5157,7 +5395,9 @@
595 ut_ad(recv_no_ibuf_operations || (type == OS_FILE_WRITE)595 ut_ad(recv_no_ibuf_operations || (type == OS_FILE_WRITE)
596 || !ibuf_bitmap_page(zip_size, block_offset)596 || !ibuf_bitmap_page(zip_size, block_offset)
597 || sync || is_log);597 || sync || is_log);
@@ -602,7 +602,7 @@
602 || ibuf_page(space_id, zip_size, block_offset, NULL));602 || ibuf_page(space_id, zip_size, block_offset, NULL));
603 # endif /* UNIV_LOG_DEBUG */603 # endif /* UNIV_LOG_DEBUG */
604 if (sync) {604 if (sync) {
605@@ -5190,6 +5430,16 @@605@@ -5222,6 +5462,16 @@
606 606
607 ut_ad((mode != OS_AIO_IBUF) || (space->purpose == FIL_TABLESPACE));607 ut_ad((mode != OS_AIO_IBUF) || (space->purpose == FIL_TABLESPACE));
608 608
@@ -619,9 +619,24 @@
619 node = UT_LIST_GET_FIRST(space->chain);619 node = UT_LIST_GET_FIRST(space->chain);
620 620
621 for (;;) {621 for (;;) {
622@@ -5924,6 +6174,7 @@
623 const char* tmp_name) /*!< in: temp table name used while
624 swapping */
625 {
626+#ifdef UNDEFINED
627 mtr_t mtr;
628 mtr_start(&mtr);
629 fil_op_write_log(MLOG_FILE_RENAME, old_space_id,
630@@ -5931,5 +6182,6 @@
631 fil_op_write_log(MLOG_FILE_RENAME, new_space_id,
632 0, 0, new_name, old_name, &mtr);
633 mtr_commit(&mtr);
634+#endif
635 }
636
622--- a/storage/innodb_plugin/handler/ha_innodb.cc637--- a/storage/innodb_plugin/handler/ha_innodb.cc
623+++ b/storage/innodb_plugin/handler/ha_innodb.cc638+++ b/storage/innodb_plugin/handler/ha_innodb.cc
624@@ -365,12 +365,6 @@639@@ -388,12 +388,6 @@
625 "Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout.",640 "Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout.",
626 NULL, NULL, 50, 1, 1024 * 1024 * 1024, 0);641 NULL, NULL, 50, 1, 1024 * 1024 * 1024, 0);
627 642
@@ -634,7 +649,7 @@
634 static MYSQL_THDVAR_BOOL(fake_changes, PLUGIN_VAR_OPCMDARG,649 static MYSQL_THDVAR_BOOL(fake_changes, PLUGIN_VAR_OPCMDARG,
635 "In the transaction after enabled, UPDATE, INSERT and DELETE only move the cursor to the records "650 "In the transaction after enabled, UPDATE, INSERT and DELETE only move the cursor to the records "
636 "and do nothing other operations (no changes, no ibuf, no undo, no transaction log) in the transaction. "651 "and do nothing other operations (no changes, no ibuf, no undo, no transaction log) in the transaction. "
637@@ -760,17 +754,6 @@652@@ -789,17 +783,6 @@
638 }653 }
639 654
640 /******************************************************************//**655 /******************************************************************//**
@@ -652,7 +667,7 @@
652 Returns true if expand_fast_index_creation is enabled for the current667 Returns true if expand_fast_index_creation is enabled for the current
653 session.668 session.
654 @return the value of the server's expand_fast_index_creation variable */669 @return the value of the server's expand_fast_index_creation variable */
655@@ -11966,7 +11949,6 @@670@@ -12551,7 +12534,6 @@
656 MYSQL_SYSVAR(flush_neighbor_pages),671 MYSQL_SYSVAR(flush_neighbor_pages),
657 MYSQL_SYSVAR(read_ahead),672 MYSQL_SYSVAR(read_ahead),
658 MYSQL_SYSVAR(adaptive_checkpoint),673 MYSQL_SYSVAR(adaptive_checkpoint),
@@ -672,7 +687,7 @@
672 if (ibuf_fixed_addr_page(space, zip_size, page_no)) {687 if (ibuf_fixed_addr_page(space, zip_size, page_no)) {
673 688
674 return(TRUE);689 return(TRUE);
675@@ -2280,6 +2283,9 @@690@@ -2278,6 +2281,9 @@
676 ulint n_bytes;691 ulint n_bytes;
677 ulint n_pag2;692 ulint n_pag2;
678 693
@@ -684,7 +699,7 @@
684 699
685--- a/storage/innodb_plugin/include/fil0fil.h700--- a/storage/innodb_plugin/include/fil0fil.h
686+++ b/storage/innodb_plugin/include/fil0fil.h701+++ b/storage/innodb_plugin/include/fil0fil.h
687@@ -505,7 +505,7 @@702@@ -509,7 +509,7 @@
688 @return DB_SUCCESS or error number */703 @return DB_SUCCESS or error number */
689 UNIV_INTERN704 UNIV_INTERN
690 ulint705 ulint
@@ -712,7 +727,7 @@
712 @return the value of the server's innodb_expand_fast_index_creation variable */727 @return the value of the server's innodb_expand_fast_index_creation variable */
713--- a/storage/innodb_plugin/include/log0recv.h728--- a/storage/innodb_plugin/include/log0recv.h
714+++ b/storage/innodb_plugin/include/log0recv.h729+++ b/storage/innodb_plugin/include/log0recv.h
715@@ -444,7 +444,7 @@730@@ -481,7 +481,7 @@
716 /* defined in os0file.c */731 /* defined in os0file.c */
717 #define OS_AIO_MERGE_N_CONSECUTIVE 64732 #define OS_AIO_MERGE_N_CONSECUTIVE 64
718 /* defined in log0recv.c */733 /* defined in log0recv.c */
@@ -723,7 +738,7 @@
723 738
724--- a/storage/innodb_plugin/include/mem0mem.ic739--- a/storage/innodb_plugin/include/mem0mem.ic
725+++ b/storage/innodb_plugin/include/mem0mem.ic740+++ b/storage/innodb_plugin/include/mem0mem.ic
726@@ -367,7 +367,7 @@741@@ -363,7 +363,7 @@
727 buf = (byte*)buf + MEM_FIELD_HEADER_SIZE;742 buf = (byte*)buf + MEM_FIELD_HEADER_SIZE;
728 743
729 /* Check that the field lengths agree */744 /* Check that the field lengths agree */
@@ -734,7 +749,7 @@
734 return(buf);749 return(buf);
735--- a/storage/innodb_plugin/include/srv0srv.h750--- a/storage/innodb_plugin/include/srv0srv.h
736+++ b/storage/innodb_plugin/include/srv0srv.h751+++ b/storage/innodb_plugin/include/srv0srv.h
737@@ -226,6 +226,11 @@752@@ -243,6 +243,11 @@
738 753
739 extern ulong srv_replication_delay;754 extern ulong srv_replication_delay;
740 755
@@ -816,7 +831,7 @@
816 831
817--- a/storage/innodb_plugin/log/log0log.c832--- a/storage/innodb_plugin/log/log0log.c
818+++ b/storage/innodb_plugin/log/log0log.c833+++ b/storage/innodb_plugin/log/log0log.c
819@@ -1370,7 +1370,7 @@834@@ -1449,7 +1449,7 @@
820 #endif /* UNIV_DEBUG */835 #endif /* UNIV_DEBUG */
821 ulint unlock;836 ulint unlock;
822 837
@@ -825,7 +840,7 @@
825 /* Recovery is running and no operations on the log files are840 /* Recovery is running and no operations on the log files are
826 allowed yet (the variable name .._no_ibuf_.. is misleading) */841 allowed yet (the variable name .._no_ibuf_.. is misleading) */
827 842
828@@ -2032,7 +2032,7 @@843@@ -2117,7 +2117,7 @@
829 return(TRUE);844 return(TRUE);
830 }845 }
831 846
@@ -834,7 +849,7 @@
834 849
835 if (log_sys->n_pending_checkpoint_writes > 0) {850 if (log_sys->n_pending_checkpoint_writes > 0) {
836 /* A checkpoint write is running */851 /* A checkpoint write is running */
837@@ -3127,6 +3127,7 @@852@@ -3232,6 +3232,7 @@
838 shutdown, because the InnoDB layer may have committed or853 shutdown, because the InnoDB layer may have committed or
839 prepared transactions and we don't want to lose them. */854 prepared transactions and we don't want to lose them. */
840 855
@@ -842,7 +857,7 @@
842 if (trx_n_mysql_transactions > 0857 if (trx_n_mysql_transactions > 0
843 || UT_LIST_GET_LEN(trx_sys->trx_list) > trx_n_prepared) {858 || UT_LIST_GET_LEN(trx_sys->trx_list) > trx_n_prepared) {
844 859
845@@ -3134,6 +3135,7 @@860@@ -3239,6 +3240,7 @@
846 861
847 goto loop;862 goto loop;
848 }863 }
@@ -885,7 +900,7 @@
885 900
886 /** The recovery system */901 /** The recovery system */
887 UNIV_INTERN recv_sys_t* recv_sys = NULL;902 UNIV_INTERN recv_sys_t* recv_sys = NULL;
888@@ -621,7 +622,7 @@903@@ -622,7 +623,7 @@
889 /***********************************************************************//**904 /***********************************************************************//**
890 Checks the consistency of the checkpoint info905 Checks the consistency of the checkpoint info
891 @return TRUE if ok */906 @return TRUE if ok */
@@ -894,7 +909,7 @@
894 ibool909 ibool
895 recv_check_cp_is_consistent(910 recv_check_cp_is_consistent(
896 /*========================*/911 /*========================*/
897@@ -651,7 +652,7 @@912@@ -652,7 +653,7 @@
898 /********************************************************//**913 /********************************************************//**
899 Looks for the maximum consistent checkpoint from the log groups.914 Looks for the maximum consistent checkpoint from the log groups.
900 @return error code or DB_SUCCESS */915 @return error code or DB_SUCCESS */
@@ -903,16 +918,7 @@
903 ulint918 ulint
904 recv_find_max_checkpoint(919 recv_find_max_checkpoint(
905 /*=====================*/920 /*=====================*/
906@@ -840,7 +841,7 @@921@@ -1636,9 +1637,16 @@
907 InnoDB-3.23.52 where the checksum field contains the log block number.
908 @return TRUE if ok, or if the log block may be in the format of InnoDB
909 version predating 3.23.52 */
910-static
911+//static
912 ibool
913 log_block_checksum_is_ok_or_old_format(
914 /*===================================*/
915@@ -1629,9 +1630,16 @@
916 if (page_zip) {922 if (page_zip) {
917 memset(FIL_PAGE_LSN + page_zip->data, 0, 8);923 memset(FIL_PAGE_LSN + page_zip->data, 0, 8);
918 }924 }
@@ -930,7 +936,7 @@
930 936
931 ib_uint64_t end_lsn;937 ib_uint64_t end_lsn;
932 938
933@@ -1830,6 +1838,18 @@939@@ -1838,6 +1846,18 @@
934 ulint zip_size = fil_space_get_zip_size(space);940 ulint zip_size = fil_space_get_zip_size(space);
935 ulint page_no = recv_addr->page_no;941 ulint page_no = recv_addr->page_no;
936 942
@@ -949,7 +955,7 @@
949 if (recv_addr->state == RECV_NOT_PROCESSED) {955 if (recv_addr->state == RECV_NOT_PROCESSED) {
950 if (!has_printed) {956 if (!has_printed) {
951 ut_print_timestamp(stderr);957 ut_print_timestamp(stderr);
952@@ -1863,7 +1883,7 @@958@@ -1871,7 +1891,7 @@
953 959
954 mutex_enter(&(recv_sys->mutex));960 mutex_enter(&(recv_sys->mutex));
955 }961 }
@@ -958,7 +964,7 @@
958 recv_addr = HASH_GET_NEXT(addr_hash, recv_addr);964 recv_addr = HASH_GET_NEXT(addr_hash, recv_addr);
959 }965 }
960 966
961@@ -2369,7 +2389,7 @@967@@ -2377,7 +2397,7 @@
962 || type == MLOG_FILE_RENAME968 || type == MLOG_FILE_RENAME
963 || type == MLOG_FILE_DELETE) {969 || type == MLOG_FILE_DELETE) {
964 ut_a(space);970 ut_a(space);
@@ -967,7 +973,7 @@
967 if (recv_replay_file_ops) {973 if (recv_replay_file_ops) {
968 974
969 /* In ibbackup --apply-log, replay an .ibd file975 /* In ibbackup --apply-log, replay an .ibd file
970@@ -2392,7 +2412,7 @@976@@ -2400,7 +2420,7 @@
971 ut_error;977 ut_error;
972 }978 }
973 }979 }
@@ -976,7 +982,7 @@
976 /* In normal mysqld crash recovery we do not try to982 /* In normal mysqld crash recovery we do not try to
977 replay file operations */983 replay file operations */
978 #ifdef UNIV_LOG_LSN_DEBUG984 #ifdef UNIV_LOG_LSN_DEBUG
979@@ -2809,8 +2829,11 @@985@@ -2817,8 +2837,11 @@
980 986
981 fprintf(stderr,987 fprintf(stderr,
982 "InnoDB: Doing recovery: scanned up to"988 "InnoDB: Doing recovery: scanned up to"
@@ -990,7 +996,7 @@
990 }996 }
991 }997 }
992 998
993@@ -2913,7 +2936,7 @@999@@ -2921,7 +2944,7 @@
994 "InnoDB: Reading tablespace information"1000 "InnoDB: Reading tablespace information"
995 " from the .ibd files...\n");1001 " from the .ibd files...\n");
996 1002
@@ -999,7 +1005,7 @@
999 1005
1000 /* If we are using the doublewrite method, we will1006 /* If we are using the doublewrite method, we will
1001 check if there are half-written pages in data files,1007 check if there are half-written pages in data files,
1002@@ -2922,12 +2945,14 @@1008@@ -2930,12 +2953,14 @@
1003 1009
1004 if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) {1010 if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) {
1005 1011
@@ -1015,7 +1021,7 @@
1015 }1021 }
1016 }1022 }
1017 1023
1018@@ -3095,6 +3120,7 @@1024@@ -3103,6 +3128,7 @@
1019 recv_sys->recovered_lsn = checkpoint_lsn;1025 recv_sys->recovered_lsn = checkpoint_lsn;
1020 1026
1021 srv_start_lsn = checkpoint_lsn;1027 srv_start_lsn = checkpoint_lsn;
@@ -1023,7 +1029,7 @@
1023 }1029 }
1024 1030
1025 contiguous_lsn = ut_uint64_align_down(recv_sys->scanned_lsn,1031 contiguous_lsn = ut_uint64_align_down(recv_sys->scanned_lsn,
1026@@ -3453,6 +3479,7 @@1032@@ -3461,6 +3487,7 @@
1027 that the data dictionary tables will be free of any locks.1033 that the data dictionary tables will be free of any locks.
1028 The data dictionary latch should guarantee that there is at1034 The data dictionary latch should guarantee that there is at
1029 most one data dictionary transaction active at a time. */1035 most one data dictionary transaction active at a time. */
@@ -1042,7 +1048,7 @@
1042 #if defined(UNIV_HOTBACKUP) || defined(__WIN__) || defined(__NETWARE__)1048 #if defined(UNIV_HOTBACKUP) || defined(__WIN__) || defined(__NETWARE__)
1043 /* InnoDB Hot Backup does not lock the data files.1049 /* InnoDB Hot Backup does not lock the data files.
1044 * On Windows, mandatory locking is used.1050 * On Windows, mandatory locking is used.
1045@@ -1357,8 +1357,9 @@1051@@ -1365,8 +1365,9 @@
1046 attributes = 0;1052 attributes = 0;
1047 ut_error;1053 ut_error;
1048 }1054 }
@@ -1053,7 +1059,7 @@
1053 GENERIC_READ | GENERIC_WRITE, /* read and write1059 GENERIC_READ | GENERIC_WRITE, /* read and write
1054 access */1060 access */
1055 share_mode, /* File can be read also by other1061 share_mode, /* File can be read also by other
1056@@ -1417,7 +1418,11 @@1062@@ -1432,7 +1433,11 @@
1057 if (create_mode == OS_FILE_OPEN || create_mode == OS_FILE_OPEN_RAW1063 if (create_mode == OS_FILE_OPEN || create_mode == OS_FILE_OPEN_RAW
1058 || create_mode == OS_FILE_OPEN_RETRY) {1064 || create_mode == OS_FILE_OPEN_RETRY) {
1059 mode_str = "OPEN";1065 mode_str = "OPEN";
@@ -1066,7 +1072,7 @@
1066 } else if (create_mode == OS_FILE_CREATE) {1072 } else if (create_mode == OS_FILE_CREATE) {
1067 mode_str = "CREATE";1073 mode_str = "CREATE";
1068 create_flag = O_RDWR | O_CREAT | O_EXCL;1074 create_flag = O_RDWR | O_CREAT | O_EXCL;
1069@@ -2682,6 +2687,9 @@1075@@ -2716,6 +2721,9 @@
1070 ut_a((offset & 0xFFFFFFFFUL) == offset);1076 ut_a((offset & 0xFFFFFFFFUL) == offset);
1071 ut_a((n & 0xFFFFFFFFUL) == n);1077 ut_a((n & 0xFFFFFFFFUL) == n);
1072 1078
@@ -1076,7 +1082,7 @@
1076 os_n_file_writes++;1082 os_n_file_writes++;
1077 1083
1078 ut_ad(file);1084 ut_ad(file);
1079@@ -2806,6 +2814,9 @@1085@@ -2840,6 +2848,9 @@
1080 #else1086 #else
1081 ssize_t ret;1087 ssize_t ret;
1082 1088
@@ -1108,9 +1114,9 @@
1108 1114
1109--- a/storage/innodb_plugin/srv/srv0srv.c1115--- a/storage/innodb_plugin/srv/srv0srv.c
1110+++ b/storage/innodb_plugin/srv/srv0srv.c1116+++ b/storage/innodb_plugin/srv/srv0srv.c
1111@@ -86,11 +86,6 @@1117@@ -96,11 +96,6 @@
1112 #include "trx0i_s.h"1118 # include "my_sys.h" /* DEBUG_SYNC_C */
1113 #include "os0sync.h" /* for HAVE_ATOMIC_BUILTINS */1119 #endif
1114 1120
1115-/* prototypes of new functions added to ha_innodb.cc for kill_idle_transaction */1121-/* prototypes of new functions added to ha_innodb.cc for kill_idle_transaction */
1116-ibool innobase_thd_is_idle(const void* thd);1122-ibool innobase_thd_is_idle(const void* thd);
@@ -1120,7 +1126,7 @@
1120 /* prototypes for new functions added to ha_innodb.cc */1126 /* prototypes for new functions added to ha_innodb.cc */
1121 ibool innobase_get_slow_log();1127 ibool innobase_get_slow_log();
1122 1128
1123@@ -415,6 +410,11 @@1129@@ -438,6 +433,11 @@
1124 1130
1125 UNIV_INTERN ulong srv_replication_delay = 0;1131 UNIV_INTERN ulong srv_replication_delay = 0;
1126 1132
@@ -1132,7 +1138,7 @@
1132 UNIV_INTERN long long srv_ibuf_max_size = 0;1138 UNIV_INTERN long long srv_ibuf_max_size = 0;
1133 UNIV_INTERN ulint srv_ibuf_active_contract = 0; /* 0:disable 1:enable */1139 UNIV_INTERN ulint srv_ibuf_active_contract = 0; /* 0:disable 1:enable */
1134 UNIV_INTERN ulint srv_ibuf_accel_rate = 100;1140 UNIV_INTERN ulint srv_ibuf_accel_rate = 100;
1135@@ -1065,7 +1065,7 @@1141@@ -1095,7 +1095,7 @@
1136 }1142 }
1137 1143
1138 /* Initialize some INFORMATION SCHEMA internal structures */1144 /* Initialize some INFORMATION SCHEMA internal structures */
@@ -1141,7 +1147,7 @@
1141 }1147 }
1142 1148
1143 /*********************************************************************//**1149 /*********************************************************************//**
1144@@ -1076,6 +1076,7 @@1150@@ -1106,6 +1106,7 @@
1145 /*==========*/1151 /*==========*/
1146 {1152 {
1147 os_fast_mutex_free(&srv_conc_mutex);1153 os_fast_mutex_free(&srv_conc_mutex);
@@ -1149,7 +1155,7 @@
1149 mem_free(srv_conc_slots);1155 mem_free(srv_conc_slots);
1150 srv_conc_slots = NULL;1156 srv_conc_slots = NULL;
1151 1157
1152@@ -1089,6 +1090,7 @@1158@@ -1119,6 +1120,7 @@
1153 srv_mysql_table = NULL;1159 srv_mysql_table = NULL;
1154 1160
1155 trx_i_s_cache_free(trx_i_s_cache);1161 trx_i_s_cache_free(trx_i_s_cache);
@@ -1157,7 +1163,7 @@
1157 }1163 }
1158 1164
1159 /*********************************************************************//**1165 /*********************************************************************//**
1160@@ -2570,36 +2572,6 @@1166@@ -2634,36 +2636,6 @@
1161 old_sema = sema;1167 old_sema = sema;
1162 }1168 }
1163 1169
@@ -1196,7 +1202,7 @@
1196 1202
1197--- a/storage/innodb_plugin/srv/srv0start.c1203--- a/storage/innodb_plugin/srv/srv0start.c
1198+++ b/storage/innodb_plugin/srv/srv0start.c1204+++ b/storage/innodb_plugin/srv/srv0start.c
1199@@ -62,6 +62,7 @@1205@@ -63,6 +63,7 @@
1200 #include "ibuf0ibuf.h"1206 #include "ibuf0ibuf.h"
1201 #include "srv0start.h"1207 #include "srv0start.h"
1202 #include "srv0srv.h"1208 #include "srv0srv.h"
@@ -1204,7 +1210,7 @@
1204 #ifndef UNIV_HOTBACKUP1210 #ifndef UNIV_HOTBACKUP
1205 # include "os0proc.h"1211 # include "os0proc.h"
1206 # include "sync0sync.h"1212 # include "sync0sync.h"
1207@@ -95,6 +96,8 @@1213@@ -96,6 +97,8 @@
1208 /** Log sequence number at shutdown */1214 /** Log sequence number at shutdown */
1209 UNIV_INTERN ib_uint64_t srv_shutdown_lsn;1215 UNIV_INTERN ib_uint64_t srv_shutdown_lsn;
1210 1216
@@ -1213,7 +1219,7 @@
1213 #ifdef HAVE_DARWIN_THREADS1219 #ifdef HAVE_DARWIN_THREADS
1214 # include <sys/utsname.h>1220 # include <sys/utsname.h>
1215 /** TRUE if the F_FULLFSYNC option is available */1221 /** TRUE if the F_FULLFSYNC option is available */
1216@@ -545,7 +548,7 @@1222@@ -540,7 +543,7 @@
1217 /*********************************************************************//**1223 /*********************************************************************//**
1218 Creates or opens the log files and closes them.1224 Creates or opens the log files and closes them.
1219 @return DB_SUCCESS or error code */1225 @return DB_SUCCESS or error code */
@@ -1222,7 +1228,7 @@
1222 ulint1228 ulint
1223 open_or_create_log_file(1229 open_or_create_log_file(
1224 /*====================*/1230 /*====================*/
1225@@ -703,7 +706,7 @@1231@@ -698,7 +701,7 @@
1226 /*********************************************************************//**1232 /*********************************************************************//**
1227 Creates or opens database data files and closes them.1233 Creates or opens database data files and closes them.
1228 @return DB_SUCCESS or error code */1234 @return DB_SUCCESS or error code */
@@ -1231,7 +1237,7 @@
1231 ulint1237 ulint
1232 open_or_create_data_files(1238 open_or_create_data_files(
1233 /*======================*/1239 /*======================*/
1234@@ -1782,6 +1785,10 @@1240@@ -1804,6 +1807,10 @@
1235 are initialized in trx_sys_init_at_db_start(). */1241 are initialized in trx_sys_init_at_db_start(). */
1236 1242
1237 recv_recovery_from_checkpoint_finish();1243 recv_recovery_from_checkpoint_finish();
@@ -1242,7 +1248,7 @@
1242 if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) {1248 if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) {
1243 /* The following call is necessary for the insert1249 /* The following call is necessary for the insert
1244 buffer to work with multiple tablespaces. We must1250 buffer to work with multiple tablespaces. We must
1245@@ -1962,7 +1969,18 @@1251@@ -1990,7 +1997,18 @@
1246 1252
1247 if (srv_auto_extend_last_data_file1253 if (srv_auto_extend_last_data_file
1248 && sum_of_data_file_sizes < tablespace_size_in_header) {1254 && sum_of_data_file_sizes < tablespace_size_in_header) {
@@ -1261,7 +1267,7 @@
1261 fprintf(stderr,1267 fprintf(stderr,
1262 "InnoDB: Error: tablespace size stored in header"1268 "InnoDB: Error: tablespace size stored in header"
1263 " is %lu pages, but\n"1269 " is %lu pages, but\n"
1264@@ -1987,6 +2005,7 @@1270@@ -2015,6 +2033,7 @@
1265 1271
1266 return(DB_ERROR);1272 return(DB_ERROR);
1267 }1273 }
@@ -1269,7 +1275,7 @@
1269 }1275 }
1270 1276
1271 /* Check that os_fast_mutexes work as expected */1277 /* Check that os_fast_mutexes work as expected */
1272@@ -2008,6 +2027,10 @@1278@@ -2036,6 +2055,10 @@
1273 1279
1274 os_fast_mutex_free(&srv_os_test_mutex);1280 os_fast_mutex_free(&srv_os_test_mutex);
1275 1281
@@ -1280,7 +1286,7 @@
1280 if (!srv_file_per_table_original_value1286 if (!srv_file_per_table_original_value
1281 && srv_pass_corrupt_table) {1287 && srv_pass_corrupt_table) {
1282 fprintf(stderr, "InnoDB: Warning:"1288 fprintf(stderr, "InnoDB: Warning:"
1283@@ -2089,6 +2112,7 @@1289@@ -2117,6 +2140,7 @@
1284 ibuf_update_max_tablespace_id();1290 ibuf_update_max_tablespace_id();
1285 }1291 }
1286 1292
@@ -1290,9 +1296,9 @@
1290 srv_was_started = TRUE;1296 srv_was_started = TRUE;
1291--- a/storage/innodb_plugin/trx/trx0purge.c1297--- a/storage/innodb_plugin/trx/trx0purge.c
1292+++ b/storage/innodb_plugin/trx/trx0purge.c1298+++ b/storage/innodb_plugin/trx/trx0purge.c
1293@@ -1113,6 +1113,9 @@1299@@ -1119,6 +1119,9 @@
1294 /* que_thr_t* thr2; */1300 /* que_thr_t* thr2; */
1295 ulint old_pages_handled;1301 ulonglong old_pages_handled;
1296 1302
1297+ if (srv_fake_write)1303+ if (srv_fake_write)
1298+ return(0);1304+ return(0);
@@ -1316,7 +1322,7 @@
1316 1322
1317--- a/storage/innodb_plugin/trx/trx0sys.c1323--- a/storage/innodb_plugin/trx/trx0sys.c
1318+++ b/storage/innodb_plugin/trx/trx0sys.c1324+++ b/storage/innodb_plugin/trx/trx0sys.c
1319@@ -1910,12 +1910,14 @@1325@@ -1944,12 +1944,14 @@
1320 mem_free(trx_doublewrite);1326 mem_free(trx_doublewrite);
1321 trx_doublewrite = NULL;1327 trx_doublewrite = NULL;
1322 1328
@@ -1331,7 +1337,7 @@
1331 1337
1332 /* There can't be any active transactions. */1338 /* There can't be any active transactions. */
1333 rseg = UT_LIST_GET_FIRST(trx_sys->rseg_list);1339 rseg = UT_LIST_GET_FIRST(trx_sys->rseg_list);
1334@@ -1941,10 +1943,12 @@1340@@ -1975,10 +1977,12 @@
1335 UT_LIST_REMOVE(view_list, trx_sys->view_list, prev_view);1341 UT_LIST_REMOVE(view_list, trx_sys->view_list, prev_view);
1336 }1342 }
1337 1343
@@ -1389,7 +1395,7 @@
1389 mutex_enter(&kernel_mutex);1395 mutex_enter(&kernel_mutex);
1390 1396
1391 ret = trx_start_low(trx, rseg_id);1397 ret = trx_start_low(trx, rseg_id);
1392@@ -990,7 +984,6 @@1398@@ -1000,7 +994,6 @@
1393 trx->read_view = NULL;1399 trx->read_view = NULL;
1394 1400
1395 if (lsn) {1401 if (lsn) {
@@ -1397,7 +1403,7 @@
1397 1403
1398 mutex_exit(&kernel_mutex);1404 mutex_exit(&kernel_mutex);
1399 1405
1400@@ -999,11 +992,6 @@1406@@ -1009,11 +1002,6 @@
1401 trx_undo_insert_cleanup(trx);1407 trx_undo_insert_cleanup(trx);
1402 }1408 }
1403 1409
@@ -1409,7 +1415,7 @@
1409 1415
1410 /* NOTE that we could possibly make a group commit more1416 /* NOTE that we could possibly make a group commit more
1411 efficient here: call os_thread_yield here to allow also other1417 efficient here: call os_thread_yield here to allow also other
1412@@ -1036,9 +1024,9 @@1418@@ -1046,9 +1034,9 @@
1413 if (trx->flush_log_later) {1419 if (trx->flush_log_later) {
1414 /* Do nothing yet */1420 /* Do nothing yet */
1415 trx->must_flush_log_later = TRUE;1421 trx->must_flush_log_later = TRUE;
@@ -1421,7 +1427,7 @@
1421 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {1427 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {
1422 /* Write the log but do not flush it to disk */1428 /* Write the log but do not flush it to disk */
1423 1429
1424@@ -1050,7 +1038,7 @@1430@@ -1060,7 +1048,7 @@
1425 1431
1426 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);1432 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);
1427 }1433 }
@@ -1430,7 +1436,7 @@
1430 1436
1431 /* Write the log but do not flush it to disk */1437 /* Write the log but do not flush it to disk */
1432 1438
1433@@ -1730,23 +1718,16 @@1439@@ -1742,23 +1730,16 @@
1434 trx_t* trx) /*!< in: trx handle */1440 trx_t* trx) /*!< in: trx handle */
1435 {1441 {
1436 ib_uint64_t lsn = trx->commit_lsn;1442 ib_uint64_t lsn = trx->commit_lsn;
@@ -1456,7 +1462,7 @@
1456 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {1462 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {
1457 /* Write the log but do not flush it to disk */1463 /* Write the log but do not flush it to disk */
1458 1464
1459@@ -1757,7 +1738,7 @@1465@@ -1769,7 +1750,7 @@
1460 1466
1461 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);1467 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);
1462 }1468 }
@@ -1465,7 +1471,7 @@
1465 1471
1466 /* Write the log but do not flush it to disk */1472 /* Write the log but do not flush it to disk */
1467 1473
1468@@ -2018,8 +1999,6 @@1474@@ -2047,8 +2028,6 @@
1469 /*--------------------------------------*/1475 /*--------------------------------------*/
1470 1476
1471 if (lsn) {1477 if (lsn) {
@@ -1474,7 +1480,7 @@
1474 /* Depending on the my.cnf options, we may now write the log1480 /* Depending on the my.cnf options, we may now write the log
1475 buffer to the log files, making the prepared state of the1481 buffer to the log files, making the prepared state of the
1476 transaction durable if the OS does not crash. We may also1482 transaction durable if the OS does not crash. We may also
1477@@ -2039,15 +2018,9 @@1483@@ -2068,15 +2047,9 @@
1478 1484
1479 mutex_exit(&kernel_mutex);1485 mutex_exit(&kernel_mutex);
1480 1486
@@ -1492,7 +1498,7 @@
1492 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {1498 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {
1493 /* Write the log but do not flush it to disk */1499 /* Write the log but do not flush it to disk */
1494 1500
1495@@ -2059,7 +2032,7 @@1501@@ -2088,7 +2061,7 @@
1496 1502
1497 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);1503 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);
1498 }1504 }
@@ -1511,9 +1517,9 @@
1511 1517
1512 /*1518 /*
1513 WAIT ARRAY1519 WAIT ARRAY
1514@@ -926,6 +927,13 @@1520@@ -931,6 +932,13 @@
1515 ibool fatal = FALSE;1521 return(FALSE);
1516 double longest_diff = 0;1522 }
1517 1523
1518+ if (srv_rebuild_indexes) {1524+ if (srv_rebuild_indexes) {
1519+1525+
@@ -1522,12 +1528,12 @@
1522+ return(FALSE);1528+ return(FALSE);
1523+ }1529+ }
1524+1530+
1531 sync_array_enter(sync_primary_wait_array);
1532
1525 for (i = 0; i < sync_primary_wait_array->n_cells; i++) {1533 for (i = 0; i < sync_primary_wait_array->n_cells; i++) {
1526
1527 double diff;
1528--- a/storage/innodb_plugin/include/buf0buf.h1534--- a/storage/innodb_plugin/include/buf0buf.h
1529+++ b/storage/innodb_plugin/include/buf0buf.h1535+++ b/storage/innodb_plugin/include/buf0buf.h
1530@@ -1211,6 +1211,8 @@1536@@ -1295,6 +1295,8 @@
1531 frees a page in buffer pool */1537 frees a page in buffer pool */
1532 # endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */1538 # endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
1533 #endif /* !UNIV_HOTBACKUP */1539 #endif /* !UNIV_HOTBACKUP */
@@ -1579,14 +1585,3 @@
1579 1585
1580 UNIV_MEM_FREE(buf, n);1586 UNIV_MEM_FREE(buf, n);
1581 }1587 }
1582--- a/configure.in
1583+++ b/configure.in
1584@@ -22,7 +22,7 @@
1585 AM_INIT_AUTOMAKE([1.9 tar-ustar])
1586 AC_PROG_LIBTOOL
1587
1588-AM_CONFIG_HEADER([include/config.h])
1589+AC_CONFIG_HEADERS([include/config.h])
1590
1591 # Request support for automake silent-rules if available.
1592 # Default to verbose output. One can use the configure-time
15931588
=== modified file 'patches/xtradb55.patch'
--- patches/xtradb55.patch 2013-05-07 13:32:47 +0000
+++ patches/xtradb55.patch 2013-07-22 14:01:36 +0000
@@ -1,6 +1,7 @@
1=== modified file 'Percona-Server/storage/innobase/btr/btr0btr.c'
1--- a/storage/innobase/btr/btr0btr.c2--- a/storage/innobase/btr/btr0btr.c
2+++ b/storage/innobase/btr/btr0btr.c3+++ b/storage/innobase/btr/btr0btr.c
3@@ -674,7 +674,7 @@4@@ -704,7 +704,7 @@
4 /**************************************************************//**5 /**************************************************************//**
5 Gets the root node of a tree and x-latches it.6 Gets the root node of a tree and x-latches it.
6 @return root page, x-latched */7 @return root page, x-latched */
@@ -9,7 +10,7 @@
9 buf_block_t*10 buf_block_t*
10 btr_root_block_get(11 btr_root_block_get(
11 /*===============*/12 /*===============*/
12@@ -1134,7 +1134,7 @@13@@ -1209,7 +1209,7 @@
13 /************************************************************//**14 /************************************************************//**
14 Returns the child page of a node pointer and x-latches it.15 Returns the child page of a node pointer and x-latches it.
15 @return child page, x-latched */16 @return child page, x-latched */
@@ -28,7 +29,7 @@
28 29
29 /* prototypes for new functions added to ha_innodb.cc */30 /* prototypes for new functions added to ha_innodb.cc */
30 trx_t* innobase_get_trx();31 trx_t* innobase_get_trx();
31@@ -581,7 +582,7 @@32@@ -599,7 +600,7 @@
32 return(TRUE);33 return(TRUE);
33 }34 }
34 35
@@ -37,7 +38,7 @@
37 if (recv_lsn_checks_on) {38 if (recv_lsn_checks_on) {
38 ib_uint64_t current_lsn;39 ib_uint64_t current_lsn;
39 40
40@@ -965,6 +966,7 @@41@@ -1000,6 +1001,7 @@
41 block->page.zip_list.prev = NULL;42 block->page.zip_list.prev = NULL;
42 block->page.zip_list.next = NULL;43 block->page.zip_list.next = NULL;
43 block->page.in_LRU_list = FALSE;44 block->page.in_LRU_list = FALSE;
@@ -45,7 +46,7 @@
45 block->in_unzip_LRU_list = FALSE;46 block->in_unzip_LRU_list = FALSE;
46 #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG47 #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
47 block->n_pointers = 0;48 block->n_pointers = 0;
48@@ -2542,7 +2544,8 @@49@@ -2471,7 +2473,8 @@
49 ut_ad(zip_size == fil_space_get_zip_size(space));50 ut_ad(zip_size == fil_space_get_zip_size(space));
50 ut_ad(ut_is_2pow(zip_size));51 ut_ad(ut_is_2pow(zip_size));
51 #ifndef UNIV_LOG_DEBUG52 #ifndef UNIV_LOG_DEBUG
@@ -55,7 +56,7 @@
55 || ibuf_page_low(space, zip_size, offset,56 || ibuf_page_low(space, zip_size, offset,
56 FALSE, file, line, NULL));57 FALSE, file, line, NULL));
57 #endif58 #endif
58@@ -3952,6 +3955,13 @@59@@ -3902,6 +3905,13 @@
59 frame = ((buf_block_t*) bpage)->frame;60 frame = ((buf_block_t*) bpage)->frame;
60 }61 }
61 62
@@ -69,19 +70,19 @@
69 /* If this page is not uninitialized and not in the70 /* If this page is not uninitialized and not in the
70 doublewrite buffer, then the page number and space id71 doublewrite buffer, then the page number and space id
71 should be the same as in block. */72 should be the same as in block. */
72@@ -4064,7 +4074,8 @@73@@ -4025,7 +4035,8 @@
73 recv_recover_page(TRUE, (buf_block_t*) bpage);74 recv_recover_page(TRUE, (buf_block_t*) bpage);
74 }75 }
75 76
76- if (uncompressed && !recv_no_ibuf_operations) {77- if (uncompressed && !recv_no_ibuf_operations) {
77+ if (uncompressed && !recv_no_ibuf_operations &&78+ if (uncompressed && !recv_no_ibuf_operations &&
78+ !srv_fake_write && !bpage->is_compacted) {79+ !srv_fake_write && !bpage->is_compacted) {
79 ibuf_merge_or_delete_for_page(80
80 /* Delete possible entries, if bpage is_corrupt */81 buf_block_t* block;
81 (srv_pass_corrupt_table && bpage->is_corrupt) ? NULL :82 ibool update_ibuf_bitmap;
82--- a/storage/innobase/fil/fil0fil.c83--- a/storage/innobase/fil/fil0fil.c
83+++ b/storage/innobase/fil/fil0fil.c84+++ b/storage/innobase/fil/fil0fil.c
84@@ -307,7 +307,7 @@85@@ -310,7 +310,7 @@
85 86
86 /** The tablespace memory cache. This variable is NULL before the module is87 /** The tablespace memory cache. This variable is NULL before the module is
87 initialized. */88 initialized. */
@@ -90,7 +91,7 @@
90 91
91 #ifdef UNIV_DEBUG92 #ifdef UNIV_DEBUG
92 /** Try fil_validate() every this many times */93 /** Try fil_validate() every this many times */
93@@ -346,7 +346,7 @@94@@ -349,7 +349,7 @@
94 off the LRU list if it is in the LRU list. The caller must hold the fil_sys95 off the LRU list if it is in the LRU list. The caller must hold the fil_sys
95 mutex. */96 mutex. */
96 static97 static
@@ -99,7 +100,7 @@
99 fil_node_prepare_for_io(100 fil_node_prepare_for_io(
100 /*====================*/101 /*====================*/
101 fil_node_t* node, /*!< in: file node */102 fil_node_t* node, /*!< in: file node */
102@@ -671,7 +671,7 @@103@@ -674,7 +674,7 @@
103 Opens a the file of a node of a tablespace. The caller must own the fil_system104 Opens a the file of a node of a tablespace. The caller must own the fil_system
104 mutex. */105 mutex. */
105 static106 static
@@ -108,7 +109,7 @@
108 fil_node_open_file(109 fil_node_open_file(
109 /*===============*/110 /*===============*/
110 fil_node_t* node, /*!< in: file node */111 fil_node_t* node, /*!< in: file node */
111@@ -706,7 +706,17 @@112@@ -709,7 +709,17 @@
112 OS_FILE_READ_ONLY, &success);113 OS_FILE_READ_ONLY, &success);
113 if (!success) {114 if (!success) {
114 /* The following call prints an error message */115 /* The following call prints an error message */
@@ -127,7 +128,7 @@
127 128
128 ut_print_timestamp(stderr);129 ut_print_timestamp(stderr);
129 130
130@@ -767,12 +777,15 @@131@@ -770,12 +780,15 @@
131 132
132 if (UNIV_UNLIKELY(space_id != space->id)) {133 if (UNIV_UNLIKELY(space_id != space->id)) {
133 fprintf(stderr,134 fprintf(stderr,
@@ -146,7 +147,7 @@
146 }147 }
147 148
148 if (UNIV_UNLIKELY(space_id == ULINT_UNDEFINED149 if (UNIV_UNLIKELY(space_id == ULINT_UNDEFINED
149@@ -796,8 +809,8 @@150@@ -799,8 +812,8 @@
150 }151 }
151 152
152 if (size_bytes >= 1024 * 1024) {153 if (size_bytes >= 1024 * 1024) {
@@ -157,7 +158,7 @@
157 }158 }
158 159
159 if (!(flags & DICT_TF_ZSSIZE_MASK)) {160 if (!(flags & DICT_TF_ZSSIZE_MASK)) {
160@@ -848,6 +861,8 @@161@@ -851,6 +864,8 @@
161 /* Put the node to the LRU list */162 /* Put the node to the LRU list */
162 UT_LIST_ADD_FIRST(LRU, system->LRU, node);163 UT_LIST_ADD_FIRST(LRU, system->LRU, node);
163 }164 }
@@ -166,7 +167,7 @@
166 }167 }
167 168
168 /**********************************************************************//**169 /**********************************************************************//**
169@@ -1477,7 +1492,12 @@170@@ -1517,7 +1532,12 @@
170 the file yet; the following calls will open it and update the171 the file yet; the following calls will open it and update the
171 size fields */172 size fields */
172 173
@@ -180,7 +181,7 @@
180 fil_node_complete_io(node, fil_system, OS_FILE_READ);181 fil_node_complete_io(node, fil_system, OS_FILE_READ);
181 }182 }
182 183
183@@ -1529,7 +1549,12 @@184@@ -1586,7 +1606,12 @@
184 the file yet; the following calls will open it and update the185 the file yet; the following calls will open it and update the
185 size fields */186 size fields */
186 187
@@ -194,7 +195,7 @@
194 fil_node_complete_io(node, fil_system, OS_FILE_READ);195 fil_node_complete_io(node, fil_system, OS_FILE_READ);
195 }196 }
196 197
197@@ -1981,7 +2006,7 @@198@@ -2045,7 +2070,7 @@
198 mem_free(path);199 mem_free(path);
199 }200 }
200 201
@@ -203,7 +204,7 @@
203 /********************************************************//**204 /********************************************************//**
204 Writes a log record about an .ibd file create/rename/delete. */205 Writes a log record about an .ibd file create/rename/delete. */
205 static206 static
206@@ -2205,7 +2230,7 @@207@@ -2269,7 +2294,7 @@
207 if (fil_create_new_single_table_tablespace(208 if (fil_create_new_single_table_tablespace(
208 space_id, name, FALSE, flags,209 space_id, name, FALSE, flags,
209 FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {210 FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {
@@ -212,7 +213,7 @@
212 }213 }
213 }214 }
214 215
215@@ -2372,7 +2397,7 @@216@@ -2460,7 +2485,7 @@
216 }217 }
217 218
218 if (success) {219 if (success) {
@@ -221,16 +222,16 @@
221 /* Write a log record about the deletion of the .ibd222 /* Write a log record about the deletion of the .ibd
222 file, so that ibbackup can replay it in the223 file, so that ibbackup can replay it in the
223 --apply-log phase. We use a dummy mtr and the familiar224 --apply-log phase. We use a dummy mtr and the familiar
224@@ -2673,7 +2698,7 @@225@@ -2761,7 +2786,7 @@
225 226
226 mutex_exit(&fil_system->mutex);227 mutex_exit(&fil_system->mutex);
227 228
228-#ifndef UNIV_HOTBACKUP229-#ifndef UNIV_HOTBACKUP
229+#ifdef UNDEFINED230+#ifdef UNDEFINED
230 if (success) {231 if (success && !recv_recovery_on) {
231 mtr_t mtr;232 mtr_t mtr;
232 233
233@@ -2864,7 +2889,7 @@234@@ -2952,7 +2977,7 @@
234 235
235 fil_node_create(path, size, space_id, FALSE);236 fil_node_create(path, size, space_id, FALSE);
236 237
@@ -239,7 +240,7 @@
239 {240 {
240 mtr_t mtr;241 mtr_t mtr;
241 242
242@@ -3210,19 +3235,97 @@243@@ -3301,19 +3326,97 @@
243 "InnoDB: open the tablespace file ", stderr);244 "InnoDB: open the tablespace file ", stderr);
244 ut_print_filename(stderr, filepath);245 ut_print_filename(stderr, filepath);
245 fputs("!\n"246 fputs("!\n"
@@ -347,7 +348,7 @@
347 return(FALSE);348 return(FALSE);
348 }349 }
349 350
350@@ -4158,7 +4261,7 @@351@@ -4258,7 +4361,7 @@
351 cannot be ok. */352 cannot be ok. */
352 353
353 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;354 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;
@@ -356,7 +357,7 @@
356 if (size < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {357 if (size < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {
357 fprintf(stderr,358 fprintf(stderr,
358 "InnoDB: Error: the size of single-table tablespace"359 "InnoDB: Error: the size of single-table tablespace"
359@@ -4288,7 +4391,51 @@360@@ -4388,7 +4491,51 @@
360 361
361 fil_node_create(filepath, 0, space_id, FALSE);362 fil_node_create(filepath, 0, space_id, FALSE);
362 func_exit:363 func_exit:
@@ -409,7 +410,7 @@
409 ut_free(buf2);410 ut_free(buf2);
410 mem_free(filepath);411 mem_free(filepath);
411 }412 }
412@@ -4299,7 +4446,7 @@413@@ -4399,7 +4546,7 @@
413 idea is to read as much good data as we can and jump over bad data.414 idea is to read as much good data as we can and jump over bad data.
414 @return 0 if ok, -1 if error even after the retries, 1 if at the end415 @return 0 if ok, -1 if error even after the retries, 1 if at the end
415 of the directory */416 of the directory */
@@ -418,7 +419,7 @@
418 int419 int
419 fil_file_readdir_next_file(420 fil_file_readdir_next_file(
420 /*=======================*/421 /*=======================*/
421@@ -4343,7 +4490,7 @@422@@ -4443,7 +4590,7 @@
422 @return DB_SUCCESS or error number */423 @return DB_SUCCESS or error number */
423 UNIV_INTERN424 UNIV_INTERN
424 ulint425 ulint
@@ -427,7 +428,7 @@
427 /*===================================*/428 /*===================================*/
428 {429 {
429 int ret;430 int ret;
430@@ -4399,7 +4546,9 @@431@@ -4499,7 +4646,9 @@
431 dbinfo.name);432 dbinfo.name);
432 srv_normalize_path_for_win(dbpath);433 srv_normalize_path_for_win(dbpath);
433 434
@@ -438,7 +439,7 @@
438 439
439 if (dbdir != NULL) {440 if (dbdir != NULL) {
440 /* printf("Opened dir %s\n", dbinfo.name); */441 /* printf("Opened dir %s\n", dbinfo.name); */
441@@ -4425,8 +4574,11 @@442@@ -4525,8 +4674,11 @@
442 ".ibd")) {443 ".ibd")) {
443 /* The name ends in .ibd; try opening444 /* The name ends in .ibd; try opening
444 the file */445 the file */
@@ -451,7 +452,7 @@
451 }452 }
452 next_file_item:453 next_file_item:
453 ret = fil_file_readdir_next_file(&err,454 ret = fil_file_readdir_next_file(&err,
454@@ -4598,15 +4750,97 @@455@@ -4698,15 +4850,97 @@
455 "InnoDB: in InnoDB data dictionary"456 "InnoDB: in InnoDB data dictionary"
456 " has tablespace id %lu,\n"457 " has tablespace id %lu,\n"
457 "InnoDB: but tablespace with that id"458 "InnoDB: but tablespace with that id"
@@ -557,7 +558,7 @@
557 } else {558 } else {
558 ut_print_timestamp(stderr);559 ut_print_timestamp(stderr);
559 fputs(" InnoDB: Error: table ", stderr);560 fputs(" InnoDB: Error: table ", stderr);
560@@ -5005,7 +5239,7 @@561@@ -5129,7 +5363,7 @@
561 off the LRU list if it is in the LRU list. The caller must hold the fil_sys562 off the LRU list if it is in the LRU list. The caller must hold the fil_sys
562 mutex. */563 mutex. */
563 static564 static
@@ -566,7 +567,7 @@
566 fil_node_prepare_for_io(567 fil_node_prepare_for_io(
567 /*====================*/568 /*====================*/
568 fil_node_t* node, /*!< in: file node */569 fil_node_t* node, /*!< in: file node */
569@@ -5025,10 +5259,13 @@570@@ -5149,10 +5383,13 @@
570 }571 }
571 572
572 if (node->open == FALSE) {573 if (node->open == FALSE) {
@@ -581,7 +582,7 @@
581 }582 }
582 583
583 if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE584 if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE
584@@ -5041,6 +5278,8 @@585@@ -5165,6 +5402,8 @@
585 }586 }
586 587
587 node->n_pending++;588 node->n_pending++;
@@ -590,7 +591,7 @@
590 }591 }
591 592
592 /********************************************************************//**593 /********************************************************************//**
593@@ -5240,6 +5479,16 @@594@@ -5350,6 +5589,16 @@
594 595
595 ut_ad((mode != OS_AIO_IBUF) || (space->purpose == FIL_TABLESPACE));596 ut_ad((mode != OS_AIO_IBUF) || (space->purpose == FIL_TABLESPACE));
596 597
@@ -607,9 +608,28 @@
607 node = UT_LIST_GET_FIRST(space->chain);608 node = UT_LIST_GET_FIRST(space->chain);
608 609
609 for (;;) {610 for (;;) {
611@@ -6028,6 +6277,12 @@
612 const char* tmp_name) /*!< in: temp table name used while
613 swapping */
614 {
615+ (void)old_space_id;
616+ (void)old_name;
617+ (void)new_space_id;
618+ (void)new_name;
619+ (void)tmp_name;
620+#ifdef UNDEFINED
621 mtr_t mtr;
622 mtr_start(&mtr);
623 fil_op_write_log(MLOG_FILE_RENAME, old_space_id,
624@@ -6035,4 +6290,5 @@
625 fil_op_write_log(MLOG_FILE_RENAME, new_space_id,
626 0, 0, new_name, old_name, &mtr);
627 mtr_commit(&mtr);
628+#endif
629 }
610--- a/storage/innobase/handler/ha_innodb.cc630--- a/storage/innobase/handler/ha_innodb.cc
611+++ b/storage/innobase/handler/ha_innodb.cc631+++ b/storage/innobase/handler/ha_innodb.cc
612@@ -482,12 +482,6 @@632@@ -514,12 +514,6 @@
613 "Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout.",633 "Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout.",
614 NULL, NULL, 50, 1, 1024 * 1024 * 1024, 0);634 NULL, NULL, 50, 1, 1024 * 1024 * 1024, 0);
615 635
@@ -622,7 +642,7 @@
622 static MYSQL_THDVAR_BOOL(fake_changes, PLUGIN_VAR_OPCMDARG,642 static MYSQL_THDVAR_BOOL(fake_changes, PLUGIN_VAR_OPCMDARG,
623 "In the transaction after enabled, UPDATE, INSERT and DELETE only move the cursor to the records "643 "In the transaction after enabled, UPDATE, INSERT and DELETE only move the cursor to the records "
624 "and do nothing other operations (no changes, no ibuf, no undo, no transaction log) in the transaction. "644 "and do nothing other operations (no changes, no ibuf, no undo, no transaction log) in the transaction. "
625@@ -989,17 +983,6 @@645@@ -1038,17 +1032,6 @@
626 }646 }
627 647
628 /******************************************************************//**648 /******************************************************************//**
@@ -640,7 +660,7 @@
640 Returns true if expand_fast_index_creation is enabled for the current660 Returns true if expand_fast_index_creation is enabled for the current
641 session.661 session.
642 @return the value of the server's expand_fast_index_creation variable */662 @return the value of the server's expand_fast_index_creation variable */
643@@ -11806,17 +11789,12 @@663@@ -12637,17 +12620,12 @@
644 innodb_file_format_max_update, "Antelope");664 innodb_file_format_max_update, "Antelope");
645 665
646 /* Changed to the THDVAR */666 /* Changed to the THDVAR */
@@ -664,7 +684,7 @@
664 684
665 static MYSQL_SYSVAR_STR(flush_method, innobase_file_flush_method,685 static MYSQL_SYSVAR_STR(flush_method, innobase_file_flush_method,
666 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,686 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
667@@ -12294,7 +12272,6 @@687@@ -13234,7 +13212,6 @@
668 MYSQL_SYSVAR(file_format_check),688 MYSQL_SYSVAR(file_format_check),
669 MYSQL_SYSVAR(file_format_max),689 MYSQL_SYSVAR(file_format_max),
670 MYSQL_SYSVAR(flush_log_at_trx_commit),690 MYSQL_SYSVAR(flush_log_at_trx_commit),
@@ -674,7 +694,7 @@
674 MYSQL_SYSVAR(large_prefix),694 MYSQL_SYSVAR(large_prefix),
675--- a/storage/innobase/ibuf/ibuf0ibuf.c695--- a/storage/innobase/ibuf/ibuf0ibuf.c
676+++ b/storage/innobase/ibuf/ibuf0ibuf.c696+++ b/storage/innobase/ibuf/ibuf0ibuf.c
677@@ -1190,6 +1190,9 @@697@@ -1199,6 +1199,9 @@
678 ut_ad(!recv_no_ibuf_operations);698 ut_ad(!recv_no_ibuf_operations);
679 ut_ad(x_latch || mtr == NULL);699 ut_ad(x_latch || mtr == NULL);
680 700
@@ -684,7 +704,7 @@
684 if (ibuf_fixed_addr_page(space, zip_size, page_no)) {704 if (ibuf_fixed_addr_page(space, zip_size, page_no)) {
685 705
686 return(TRUE);706 return(TRUE);
687@@ -2757,6 +2760,9 @@707@@ -2771,6 +2774,9 @@
688 ulint n_bytes;708 ulint n_bytes;
689 ulint n_pag2;709 ulint n_pag2;
690 710
@@ -694,9 +714,20 @@
694 while (sum_pages < n_pages) {714 while (sum_pages < n_pages) {
695 n_bytes = ibuf_contract_ext(&n_pag2, sync);715 n_bytes = ibuf_contract_ext(&n_pag2, sync);
696 716
717--- a/storage/innobase/include/buf0buf.h
718+++ b/storage/innobase/include/buf0buf.h
719@@ -1594,6 +1594,8 @@
720 frees a page in buffer pool */
721 # endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
722 #endif /* !UNIV_HOTBACKUP */
723+ ibool is_compacted; /*!< TRUE if the page was skipped in
724+ compact backups */
725 };
726
727 /** The buffer control block structure */
697--- a/storage/innobase/include/fil0fil.h728--- a/storage/innobase/include/fil0fil.h
698+++ b/storage/innobase/include/fil0fil.h729+++ b/storage/innobase/include/fil0fil.h
699@@ -506,7 +506,7 @@730@@ -518,7 +518,7 @@
700 @return DB_SUCCESS or error number */731 @return DB_SUCCESS or error number */
701 UNIV_INTERN732 UNIV_INTERN
702 ulint733 ulint
@@ -723,7 +754,7 @@
723 Get the current setting of the lower_case_table_names global parameter from754 Get the current setting of the lower_case_table_names global parameter from
724--- a/storage/innobase/include/log0recv.h755--- a/storage/innobase/include/log0recv.h
725+++ b/storage/innobase/include/log0recv.h756+++ b/storage/innobase/include/log0recv.h
726@@ -444,7 +444,7 @@757@@ -481,7 +481,7 @@
727 /* defined in os0file.c */758 /* defined in os0file.c */
728 #define OS_AIO_MERGE_N_CONSECUTIVE 64759 #define OS_AIO_MERGE_N_CONSECUTIVE 64
729 /* defined in log0recv.c */760 /* defined in log0recv.c */
@@ -734,7 +765,7 @@
734 765
735--- a/storage/innobase/include/srv0srv.h766--- a/storage/innobase/include/srv0srv.h
736+++ b/storage/innobase/include/srv0srv.h767+++ b/storage/innobase/include/srv0srv.h
737@@ -145,8 +145,7 @@768@@ -159,8 +159,7 @@
738 extern ulint srv_n_log_files;769 extern ulint srv_n_log_files;
739 extern ulint srv_log_file_size;770 extern ulint srv_log_file_size;
740 extern ulint srv_log_buffer_size;771 extern ulint srv_log_buffer_size;
@@ -743,19 +774,19 @@
743+extern ulong srv_flush_log_at_trx_commit;774+extern ulong srv_flush_log_at_trx_commit;
744 extern char srv_adaptive_flushing;775 extern char srv_adaptive_flushing;
745 776
746 777 /* If this flag is TRUE, then we will load the indexes' (and tables') metadata
747@@ -247,6 +246,11 @@778@@ -271,6 +270,11 @@
748 extern ulint srv_dict_size_limit;779 extern ulint srv_expand_import;
749 780 extern ulint srv_pass_corrupt_table;
750 extern ulint srv_lazy_drop_table;781
751+
752+extern ibool srv_read_only;782+extern ibool srv_read_only;
753+extern ibool srv_fake_write;783+extern ibool srv_fake_write;
754+extern ibool srv_apply_log_only;784+extern ibool srv_apply_log_only;
755+extern ibool srv_backup_mode;785+extern ibool srv_backup_mode;
756 /*-------------------------------------------*/786+
757 787 /* Helper macro to support srv_pass_corrupt_table checks. If 'cond' is FALSE,
758 extern ulint srv_n_rows_inserted;788 execute 'code' if srv_pass_corrupt_table is non-zero, or trigger a fatal error
789 otherwise. The break statement in 'code' will obviously not work as expected. */
759--- a/storage/innobase/include/srv0start.h790--- a/storage/innobase/include/srv0start.h
760+++ b/storage/innobase/include/srv0start.h791+++ b/storage/innobase/include/srv0start.h
761@@ -91,6 +91,8 @@792@@ -91,6 +91,8 @@
@@ -769,7 +800,7 @@
769 extern ibool srv_have_fullfsync;800 extern ibool srv_have_fullfsync;
770--- a/storage/innobase/log/log0log.c801--- a/storage/innobase/log/log0log.c
771+++ b/storage/innobase/log/log0log.c802+++ b/storage/innobase/log/log0log.c
772@@ -1154,7 +1154,7 @@803@@ -1237,7 +1237,7 @@
773 if (srv_unix_file_flush_method != SRV_UNIX_O_DSYNC804 if (srv_unix_file_flush_method != SRV_UNIX_O_DSYNC
774 && srv_unix_file_flush_method != SRV_UNIX_ALL_O_DIRECT805 && srv_unix_file_flush_method != SRV_UNIX_ALL_O_DIRECT
775 && srv_unix_file_flush_method != SRV_UNIX_NOSYNC806 && srv_unix_file_flush_method != SRV_UNIX_NOSYNC
@@ -778,7 +809,7 @@
778 809
779 fil_flush(group->space_id, FALSE);810 fil_flush(group->space_id, FALSE);
780 }811 }
781@@ -1389,7 +1389,7 @@812@@ -1472,7 +1472,7 @@
782 #endif /* UNIV_DEBUG */813 #endif /* UNIV_DEBUG */
783 ulint unlock;814 ulint unlock;
784 815
@@ -787,7 +818,7 @@
787 /* Recovery is running and no operations on the log files are818 /* Recovery is running and no operations on the log files are
788 allowed yet (the variable name .._no_ibuf_.. is misleading) */819 allowed yet (the variable name .._no_ibuf_.. is misleading) */
789 820
790@@ -2051,7 +2051,7 @@821@@ -2140,7 +2140,7 @@
791 return(TRUE);822 return(TRUE);
792 }823 }
793 824
@@ -796,16 +827,16 @@
796 827
797 if (log_sys->n_pending_checkpoint_writes > 0) {828 if (log_sys->n_pending_checkpoint_writes > 0) {
798 /* A checkpoint write is running */829 /* A checkpoint write is running */
799@@ -3151,6 +3151,7 @@830@@ -3277,6 +3277,7 @@
800 shutdown, because the InnoDB layer may have committed or831 shutdown, because the InnoDB layer may have committed or
801 prepared transactions and we don't want to lose them. */832 prepared transactions and we don't want to lose them. */
802 833
803+ if (!srv_apply_log_only) {834+ if (!srv_apply_log_only) {
804 server_busy = trx_n_mysql_transactions > 0835 server_busy = trx_n_mysql_transactions > 0
805 || UT_LIST_GET_LEN(trx_sys->trx_list) > trx_n_prepared;836 || UT_LIST_GET_LEN(trx_sys->trx_list) > trx_n_prepared;
806 mutex_exit(&kernel_mutex);837
807@@ -3158,6 +3159,9 @@838@@ -3329,6 +3330,9 @@
808 if (server_busy || srv_is_any_background_thread_active()) {839
809 goto loop;840 goto loop;
810 }841 }
811+ } else {842+ } else {
@@ -867,16 +898,7 @@
867 ulint898 ulint
868 recv_find_max_checkpoint(899 recv_find_max_checkpoint(
869 /*=====================*/900 /*=====================*/
870@@ -850,7 +851,7 @@901@@ -1645,9 +1646,16 @@
871 InnoDB-3.23.52 where the checksum field contains the log block number.
872 @return TRUE if ok, or if the log block may be in the format of InnoDB
873 version predating 3.23.52 */
874-static
875+//static
876 ibool
877 log_block_checksum_is_ok_or_old_format(
878 /*===================================*/
879@@ -1639,9 +1640,16 @@
880 if (page_zip) {902 if (page_zip) {
881 memset(FIL_PAGE_LSN + page_zip->data, 0, 8);903 memset(FIL_PAGE_LSN + page_zip->data, 0, 8);
882 }904 }
@@ -894,7 +916,7 @@
894 916
895 ib_uint64_t end_lsn;917 ib_uint64_t end_lsn;
896 918
897@@ -1842,6 +1850,18 @@919@@ -1848,6 +1856,18 @@
898 ulint zip_size = fil_space_get_zip_size(space);920 ulint zip_size = fil_space_get_zip_size(space);
899 ulint page_no = recv_addr->page_no;921 ulint page_no = recv_addr->page_no;
900 922
@@ -913,7 +935,7 @@
913 if (recv_addr->state == RECV_NOT_PROCESSED) {935 if (recv_addr->state == RECV_NOT_PROCESSED) {
914 if (!has_printed) {936 if (!has_printed) {
915 ut_print_timestamp(stderr);937 ut_print_timestamp(stderr);
916@@ -1875,7 +1895,7 @@938@@ -1881,7 +1901,7 @@
917 939
918 mutex_enter(&(recv_sys->mutex));940 mutex_enter(&(recv_sys->mutex));
919 }941 }
@@ -922,7 +944,7 @@
922 recv_addr = HASH_GET_NEXT(addr_hash, recv_addr);944 recv_addr = HASH_GET_NEXT(addr_hash, recv_addr);
923 }945 }
924 946
925@@ -2380,7 +2400,7 @@947@@ -2386,7 +2406,7 @@
926 || type == MLOG_FILE_RENAME948 || type == MLOG_FILE_RENAME
927 || type == MLOG_FILE_DELETE) {949 || type == MLOG_FILE_DELETE) {
928 ut_a(space);950 ut_a(space);
@@ -931,7 +953,7 @@
931 if (recv_replay_file_ops) {953 if (recv_replay_file_ops) {
932 954
933 /* In ibbackup --apply-log, replay an .ibd file955 /* In ibbackup --apply-log, replay an .ibd file
934@@ -2403,7 +2423,7 @@956@@ -2409,7 +2429,7 @@
935 ut_error;957 ut_error;
936 }958 }
937 }959 }
@@ -940,7 +962,7 @@
940 /* In normal mysqld crash recovery we do not try to962 /* In normal mysqld crash recovery we do not try to
941 replay file operations */963 replay file operations */
942 #ifdef UNIV_LOG_LSN_DEBUG964 #ifdef UNIV_LOG_LSN_DEBUG
943@@ -2820,8 +2840,11 @@965@@ -2826,8 +2846,11 @@
944 966
945 fprintf(stderr,967 fprintf(stderr,
946 "InnoDB: Doing recovery: scanned up to"968 "InnoDB: Doing recovery: scanned up to"
@@ -954,7 +976,7 @@
954 }976 }
955 }977 }
956 978
957@@ -2926,7 +2949,7 @@979@@ -2932,7 +2955,7 @@
958 "InnoDB: Reading tablespace information"980 "InnoDB: Reading tablespace information"
959 " from the .ibd files...\n");981 " from the .ibd files...\n");
960 982
@@ -963,7 +985,7 @@
963 985
964 /* If we are using the doublewrite method, we will986 /* If we are using the doublewrite method, we will
965 check if there are half-written pages in data files,987 check if there are half-written pages in data files,
966@@ -2935,12 +2958,14 @@988@@ -2941,12 +2964,14 @@
967 989
968 if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) {990 if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) {
969 991
@@ -979,7 +1001,7 @@
979 }1001 }
980 }1002 }
981 1003
982@@ -3109,6 +3134,7 @@1004@@ -3115,6 +3140,7 @@
983 recv_sys->recovered_lsn = checkpoint_lsn;1005 recv_sys->recovered_lsn = checkpoint_lsn;
984 1006
985 srv_start_lsn = checkpoint_lsn;1007 srv_start_lsn = checkpoint_lsn;
@@ -987,7 +1009,7 @@
987 }1009 }
988 1010
989 contiguous_lsn = ut_uint64_align_down(recv_sys->scanned_lsn,1011 contiguous_lsn = ut_uint64_align_down(recv_sys->scanned_lsn,
990@@ -3474,6 +3500,7 @@1012@@ -3480,6 +3506,7 @@
991 that the data dictionary tables will be free of any locks.1013 that the data dictionary tables will be free of any locks.
992 The data dictionary latch should guarantee that there is at1014 The data dictionary latch should guarantee that there is at
993 most one data dictionary transaction active at a time. */1015 most one data dictionary transaction active at a time. */
@@ -995,9 +1017,52 @@
995 trx_rollback_or_clean_recovered(FALSE);1017 trx_rollback_or_clean_recovered(FALSE);
996 }1018 }
997 1019
1020--- a/storage/innobase/mem/mem0dbg.c
1021+++ b/storage/innobase/mem/mem0dbg.c
1022@@ -282,18 +282,10 @@
1023 byte* buf, /*!< in: pointer to buffer */
1024 ulint n) /*!< in: length of buffer */
1025 {
1026- byte* ptr;
1027-
1028 UNIV_MEM_ASSERT_W(buf, n);
1029
1030- for (ptr = buf; ptr < buf + n; ptr++) {
1031-
1032- if (ut_rnd_gen_ibool()) {
1033- *ptr = 0xBA;
1034- } else {
1035- *ptr = 0xBE;
1036- }
1037- }
1038+ /* Fix https://bugs.launchpad.net/percona-xtrabackup/+bug/1158154 */
1039+ memset(buf, 0xBA, n);
1040
1041 UNIV_MEM_INVALID(buf, n);
1042 }
1043@@ -308,17 +300,10 @@
1044 byte* buf, /*!< in: pointer to buffer */
1045 ulint n) /*!< in: length of buffer */
1046 {
1047- byte* ptr;
1048-
1049 UNIV_MEM_ASSERT_W(buf, n);
1050
1051- for (ptr = buf; ptr < buf + n; ptr++) {
1052- if (ut_rnd_gen_ibool()) {
1053- *ptr = 0xDE;
1054- } else {
1055- *ptr = 0xAD;
1056- }
1057- }
1058+ /* Fix https://bugs.launchpad.net/percona-xtrabackup/+bug/1158154 */
1059+ memset(buf, 0xDE, n);
1060
1061 UNIV_MEM_FREE(buf, n);
1062 }
998--- a/storage/innobase/os/os0file.c1063--- a/storage/innobase/os/os0file.c
999+++ b/storage/innobase/os/os0file.c1064+++ b/storage/innobase/os/os0file.c
1000@@ -660,7 +660,7 @@1065@@ -670,7 +670,7 @@
1001 }1066 }
1002 1067
1003 #undef USE_FILE_LOCK1068 #undef USE_FILE_LOCK
@@ -1006,7 +1071,7 @@
1006 #if defined(UNIV_HOTBACKUP) || defined(__WIN__)1071 #if defined(UNIV_HOTBACKUP) || defined(__WIN__)
1007 /* InnoDB Hot Backup does not lock the data files.1072 /* InnoDB Hot Backup does not lock the data files.
1008 * On Windows, mandatory locking is used.1073 * On Windows, mandatory locking is used.
1009@@ -1428,7 +1428,7 @@1074@@ -1474,7 +1474,7 @@
1010 #endif1075 #endif
1011 #ifdef UNIV_NON_BUFFERED_IO1076 #ifdef UNIV_NON_BUFFERED_IO
1012 # ifndef UNIV_HOTBACKUP1077 # ifndef UNIV_HOTBACKUP
@@ -1015,7 +1080,7 @@
1015 /* Do not use unbuffered i/o to log files because1080 /* Do not use unbuffered i/o to log files because
1016 value 2 denotes that we do not flush the log at every1081 value 2 denotes that we do not flush the log at every
1017 commit, but only once per second */1082 commit, but only once per second */
1018@@ -1444,7 +1444,7 @@1083@@ -1490,7 +1490,7 @@
1019 attributes = 0;1084 attributes = 0;
1020 #ifdef UNIV_NON_BUFFERED_IO1085 #ifdef UNIV_NON_BUFFERED_IO
1021 # ifndef UNIV_HOTBACKUP1086 # ifndef UNIV_HOTBACKUP
@@ -1024,7 +1089,7 @@
1024 /* Do not use unbuffered i/o to log files because1089 /* Do not use unbuffered i/o to log files because
1025 value 2 denotes that we do not flush the log at every1090 value 2 denotes that we do not flush the log at every
1026 commit, but only once per second */1091 commit, but only once per second */
1027@@ -1460,8 +1460,9 @@1092@@ -1506,8 +1506,9 @@
1028 attributes = 0;1093 attributes = 0;
1029 ut_error;1094 ut_error;
1030 }1095 }
@@ -1035,7 +1100,7 @@
1035 GENERIC_READ | GENERIC_WRITE, /* read and write1100 GENERIC_READ | GENERIC_WRITE, /* read and write
1036 access */1101 access */
1037 share_mode, /* File can be read also by other1102 share_mode, /* File can be read also by other
1038@@ -1520,7 +1521,11 @@1103@@ -1572,7 +1573,11 @@
1039 if (create_mode == OS_FILE_OPEN || create_mode == OS_FILE_OPEN_RAW1104 if (create_mode == OS_FILE_OPEN || create_mode == OS_FILE_OPEN_RAW
1040 || create_mode == OS_FILE_OPEN_RETRY) {1105 || create_mode == OS_FILE_OPEN_RETRY) {
1041 mode_str = "OPEN";1106 mode_str = "OPEN";
@@ -1048,7 +1113,7 @@
1048 } else if (create_mode == OS_FILE_CREATE) {1113 } else if (create_mode == OS_FILE_CREATE) {
1049 mode_str = "CREATE";1114 mode_str = "CREATE";
1050 create_flag = O_RDWR | O_CREAT | O_EXCL;1115 create_flag = O_RDWR | O_CREAT | O_EXCL;
1051@@ -2791,6 +2796,9 @@1116@@ -2888,6 +2893,9 @@
1052 ut_a((offset & 0xFFFFFFFFUL) == offset);1117 ut_a((offset & 0xFFFFFFFFUL) == offset);
1053 ut_a((n & 0xFFFFFFFFUL) == n);1118 ut_a((n & 0xFFFFFFFFUL) == n);
1054 1119
@@ -1058,7 +1123,7 @@
1058 os_n_file_writes++;1123 os_n_file_writes++;
1059 1124
1060 ut_ad(file);1125 ut_ad(file);
1061@@ -2915,6 +2923,9 @@1126@@ -3012,6 +3020,9 @@
1062 #else1127 #else
1063 ssize_t ret;1128 ssize_t ret;
1064 1129
@@ -1089,19 +1154,20 @@
1089 }1154 }
1090--- a/storage/innobase/srv/srv0srv.c1155--- a/storage/innobase/srv/srv0srv.c
1091+++ b/storage/innobase/srv/srv0srv.c1156+++ b/storage/innobase/srv/srv0srv.c
1092@@ -87,11 +87,6 @@1157@@ -90,12 +90,6 @@
1093 #include "mysql/plugin.h"1158 #include "mysql/plugin.h"
1094 #include "mysql/service_thd_wait.h"1159 #include "mysql/service_thd_wait.h"
1095 1160
1096-/* prototypes of new functions added to ha_innodb.cc for kill_idle_transaction */1161-/* prototypes of new functions added to ha_innodb.cc for kill_idle_transaction */
1097-ibool innobase_thd_is_idle(const void* thd);1162-ibool innobase_thd_is_idle(const void* thd);
1098-ib_int64_t innobase_thd_get_start_time(const void* thd);1163-ib_int64_t innobase_thd_get_start_time(const void* thd);
1099-void innobase_thd_kill(void* thd);1164-void innobase_thd_kill(ulong thd_id);
1165-ulong innobase_thd_get_thread_id(const void* thd);
1100-1166-
1101 /* prototypes for new functions added to ha_innodb.cc */1167 /* prototypes for new functions added to ha_innodb.cc */
1102 ibool innobase_get_slow_log();1168 ibool innobase_get_slow_log();
1103 1169
1104@@ -198,8 +193,7 @@1170@@ -212,8 +206,7 @@
1105 UNIV_INTERN ulint srv_log_file_size = ULINT_MAX;1171 UNIV_INTERN ulint srv_log_file_size = ULINT_MAX;
1106 /* size in database pages */1172 /* size in database pages */
1107 UNIV_INTERN ulint srv_log_buffer_size = ULINT_MAX;1173 UNIV_INTERN ulint srv_log_buffer_size = ULINT_MAX;
@@ -1111,10 +1177,10 @@
1111 1177
1112 /* Try to flush dirty pages so as to avoid IO bursts at1178 /* Try to flush dirty pages so as to avoid IO bursts at
1113 the checkpoints. */1179 the checkpoints. */
1114@@ -457,6 +451,11 @@1180@@ -435,6 +428,11 @@
1181 UNIV_INTERN ulint srv_pass_corrupt_table = 0; /* 0:disable 1:enable */
1182
1115 UNIV_INTERN ulint srv_dict_size_limit = 0;1183 UNIV_INTERN ulint srv_dict_size_limit = 0;
1116
1117 UNIV_INTERN ulint srv_lazy_drop_table = 0;
1118+1184+
1119+UNIV_INTERN ibool srv_read_only = FALSE;1185+UNIV_INTERN ibool srv_read_only = FALSE;
1120+UNIV_INTERN ibool srv_fake_write = FALSE;1186+UNIV_INTERN ibool srv_fake_write = FALSE;
@@ -1123,7 +1189,7 @@
1123 /*-------------------------------------------*/1189 /*-------------------------------------------*/
1124 UNIV_INTERN ulong srv_n_spin_wait_rounds = 30;1190 UNIV_INTERN ulong srv_n_spin_wait_rounds = 30;
1125 UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500;1191 UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500;
1126@@ -1137,7 +1136,7 @@1192@@ -1185,7 +1183,7 @@
1127 }1193 }
1128 1194
1129 /* Initialize some INFORMATION SCHEMA internal structures */1195 /* Initialize some INFORMATION SCHEMA internal structures */
@@ -1132,7 +1198,7 @@
1132 }1198 }
1133 1199
1134 /*********************************************************************//**1200 /*********************************************************************//**
1135@@ -1148,6 +1147,7 @@1201@@ -1196,6 +1194,7 @@
1136 /*==========*/1202 /*==========*/
1137 {1203 {
1138 os_fast_mutex_free(&srv_conc_mutex);1204 os_fast_mutex_free(&srv_conc_mutex);
@@ -1140,7 +1206,7 @@
1140 mem_free(srv_conc_slots);1206 mem_free(srv_conc_slots);
1141 srv_conc_slots = NULL;1207 srv_conc_slots = NULL;
1142 1208
1143@@ -1161,6 +1161,7 @@1209@@ -1209,6 +1208,7 @@
1144 srv_mysql_table = NULL;1210 srv_mysql_table = NULL;
1145 1211
1146 trx_i_s_cache_free(trx_i_s_cache);1212 trx_i_s_cache_free(trx_i_s_cache);
@@ -1148,7 +1214,7 @@
1148 }1214 }
1149 1215
1150 /*********************************************************************//**1216 /*********************************************************************//**
1151@@ -1886,7 +1887,7 @@1217@@ -1938,7 +1938,7 @@
1152 }1218 }
1153 1219
1154 /* Record the lock wait time for this thread */1220 /* Record the lock wait time for this thread */
@@ -1157,7 +1223,7 @@
1157 }1223 }
1158 1224
1159 if (trx->was_chosen_as_deadlock_victim) {1225 if (trx->was_chosen_as_deadlock_victim) {
1160@@ -2842,36 +2843,6 @@1226@@ -2946,36 +2946,6 @@
1161 old_sema = sema;1227 old_sema = sema;
1162 }1228 }
1163 1229
@@ -1169,12 +1235,12 @@
1169- mutex_enter(&kernel_mutex);1235- mutex_enter(&kernel_mutex);
1170- trx = UT_LIST_GET_FIRST(trx_sys->mysql_trx_list);1236- trx = UT_LIST_GET_FIRST(trx_sys->mysql_trx_list);
1171- while (trx) {1237- while (trx) {
1172- if (trx->conc_state == TRX_ACTIVE1238- if (trx->state == TRX_ACTIVE
1173- && trx->mysql_thd1239- && trx->mysql_thd
1174- && innobase_thd_is_idle(trx->mysql_thd)) {1240- && innobase_thd_is_idle(trx->mysql_thd)) {
1175- ib_int64_t start_time; /* as stmt ID */1241- ib_int64_t start_time = innobase_thd_get_start_time(trx->mysql_thd);
1242- ulong thd_id = innobase_thd_get_thread_id(trx->mysql_thd);
1176-1243-
1177- start_time = innobase_thd_get_start_time(trx->mysql_thd);
1178- if (trx->last_stmt_start != start_time) {1244- if (trx->last_stmt_start != start_time) {
1179- trx->idle_start = now;1245- trx->idle_start = now;
1180- trx->last_stmt_start = start_time;1246- trx->last_stmt_start = start_time;
@@ -1182,7 +1248,7 @@
1182- > srv_kill_idle_transaction) {1248- > srv_kill_idle_transaction) {
1183- /* kill the session */1249- /* kill the session */
1184- mutex_exit(&kernel_mutex);1250- mutex_exit(&kernel_mutex);
1185- innobase_thd_kill(trx->mysql_thd);1251- innobase_thd_kill(thd_id);
1186- goto rescan_idle;1252- goto rescan_idle;
1187- }1253- }
1188- }1254- }
@@ -1196,7 +1262,7 @@
1196 1262
1197--- a/storage/innobase/srv/srv0start.c1263--- a/storage/innobase/srv/srv0start.c
1198+++ b/storage/innobase/srv/srv0start.c1264+++ b/storage/innobase/srv/srv0start.c
1199@@ -62,6 +62,7 @@1265@@ -63,6 +63,7 @@
1200 #include "ibuf0ibuf.h"1266 #include "ibuf0ibuf.h"
1201 #include "srv0start.h"1267 #include "srv0start.h"
1202 #include "srv0srv.h"1268 #include "srv0srv.h"
@@ -1204,7 +1270,7 @@
1204 #ifndef UNIV_HOTBACKUP1270 #ifndef UNIV_HOTBACKUP
1205 # include "os0proc.h"1271 # include "os0proc.h"
1206 # include "sync0sync.h"1272 # include "sync0sync.h"
1207@@ -94,6 +95,8 @@1273@@ -95,6 +96,8 @@
1208 /** Log sequence number at shutdown */1274 /** Log sequence number at shutdown */
1209 UNIV_INTERN ib_uint64_t srv_shutdown_lsn;1275 UNIV_INTERN ib_uint64_t srv_shutdown_lsn;
1210 1276
@@ -1213,7 +1279,7 @@
1213 #ifdef HAVE_DARWIN_THREADS1279 #ifdef HAVE_DARWIN_THREADS
1214 # include <sys/utsname.h>1280 # include <sys/utsname.h>
1215 /** TRUE if the F_FULLFSYNC option is available */1281 /** TRUE if the F_FULLFSYNC option is available */
1216@@ -549,7 +552,7 @@1282@@ -551,7 +554,7 @@
1217 /*********************************************************************//**1283 /*********************************************************************//**
1218 Creates or opens the log files and closes them.1284 Creates or opens the log files and closes them.
1219 @return DB_SUCCESS or error code */1285 @return DB_SUCCESS or error code */
@@ -1222,7 +1288,7 @@
1222 ulint1288 ulint
1223 open_or_create_log_file(1289 open_or_create_log_file(
1224 /*====================*/1290 /*====================*/
1225@@ -709,7 +712,7 @@1291@@ -711,7 +714,7 @@
1226 /*********************************************************************//**1292 /*********************************************************************//**
1227 Creates or opens database data files and closes them.1293 Creates or opens database data files and closes them.
1228 @return DB_SUCCESS or error code */1294 @return DB_SUCCESS or error code */
@@ -1231,7 +1297,7 @@
1231 ulint1297 ulint
1232 open_or_create_data_files(1298 open_or_create_data_files(
1233 /*======================*/1299 /*======================*/
1234@@ -1875,6 +1878,10 @@1300@@ -1934,6 +1937,10 @@
1235 are initialized in trx_sys_init_at_db_start(). */1301 are initialized in trx_sys_init_at_db_start(). */
1236 1302
1237 recv_recovery_from_checkpoint_finish();1303 recv_recovery_from_checkpoint_finish();
@@ -1242,7 +1308,7 @@
1242 if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) {1308 if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) {
1243 /* The following call is necessary for the insert1309 /* The following call is necessary for the insert
1244 buffer to work with multiple tablespaces. We must1310 buffer to work with multiple tablespaces. We must
1245@@ -2054,6 +2061,17 @@1311@@ -2119,6 +2126,17 @@
1246 if (!srv_auto_extend_last_data_file1312 if (!srv_auto_extend_last_data_file
1247 && sum_of_data_file_sizes != tablespace_size_in_header) {1313 && sum_of_data_file_sizes != tablespace_size_in_header) {
1248 1314
@@ -1260,7 +1326,7 @@
1260 ut_print_timestamp(stderr);1326 ut_print_timestamp(stderr);
1261 fprintf(stderr,1327 fprintf(stderr,
1262 " InnoDB: Error: tablespace size"1328 " InnoDB: Error: tablespace size"
1263@@ -2133,6 +2151,7 @@1329@@ -2198,6 +2216,7 @@
1264 1330
1265 return(DB_ERROR);1331 return(DB_ERROR);
1266 }1332 }
@@ -1268,7 +1334,7 @@
1268 }1334 }
1269 1335
1270 /* Check that os_fast_mutexes work as expected */1336 /* Check that os_fast_mutexes work as expected */
1271@@ -2157,6 +2176,10 @@1337@@ -2222,6 +2241,10 @@
1272 1338
1273 os_fast_mutex_free(&srv_os_test_mutex);1339 os_fast_mutex_free(&srv_os_test_mutex);
1274 1340
@@ -1279,7 +1345,7 @@
1279 if (!srv_file_per_table_original_value1345 if (!srv_file_per_table_original_value
1280 && srv_pass_corrupt_table) {1346 && srv_pass_corrupt_table) {
1281 fprintf(stderr, "InnoDB: Warning:"1347 fprintf(stderr, "InnoDB: Warning:"
1282@@ -2252,6 +2275,7 @@1348@@ -2317,6 +2340,7 @@
1283 ibuf_update_max_tablespace_id();1349 ibuf_update_max_tablespace_id();
1284 }1350 }
1285 1351
@@ -1287,9 +1353,33 @@
1287 srv_file_per_table = srv_file_per_table_original_value;1353 srv_file_per_table = srv_file_per_table_original_value;
1288 1354
1289 srv_was_started = TRUE;1355 srv_was_started = TRUE;
1356--- a/storage/innobase/sync/sync0arr.c
1357+++ b/storage/innobase/sync/sync0arr.c
1358@@ -41,6 +41,7 @@
1359 #include "os0file.h"
1360 #include "srv0srv.h"
1361 #include "ha_prototypes.h"
1362+#include "xb0xb.h"
1363
1364 /*
1365 WAIT ARRAY
1366@@ -927,6 +928,13 @@
1367 return(FALSE);
1368 }
1369
1370+ if (srv_rebuild_indexes) {
1371+
1372+ /* Avoid long semaphore warnings when rebuilding indexes */
1373+
1374+ return(FALSE);
1375+ }
1376+
1377 #ifdef UNIV_DEBUG_VALGRIND
1378 /* Increase the timeouts if running under valgrind because it executes
1379 extremely slowly. UNIV_DEBUG_VALGRIND does not necessary mean that
1290--- a/storage/innobase/trx/trx0purge.c1380--- a/storage/innobase/trx/trx0purge.c
1291+++ b/storage/innobase/trx/trx0purge.c1381+++ b/storage/innobase/trx/trx0purge.c
1292@@ -1129,6 +1129,9 @@1382@@ -1149,6 +1149,9 @@
1293 que_thr_t* thr;1383 que_thr_t* thr;
1294 ulint old_pages_handled;1384 ulint old_pages_handled;
1295 1385
@@ -1315,7 +1405,7 @@
1315 1405
1316--- a/storage/innobase/trx/trx0sys.c1406--- a/storage/innobase/trx/trx0sys.c
1317+++ b/storage/innobase/trx/trx0sys.c1407+++ b/storage/innobase/trx/trx0sys.c
1318@@ -1952,12 +1952,14 @@1408@@ -2000,12 +2000,14 @@
1319 mem_free(trx_doublewrite);1409 mem_free(trx_doublewrite);
1320 trx_doublewrite = NULL;1410 trx_doublewrite = NULL;
1321 1411
@@ -1330,7 +1420,7 @@
1330 1420
1331 /* There can't be any active transactions. */1421 /* There can't be any active transactions. */
1332 rseg = UT_LIST_GET_FIRST(trx_sys->rseg_list);1422 rseg = UT_LIST_GET_FIRST(trx_sys->rseg_list);
1333@@ -1983,10 +1985,12 @@1423@@ -2031,10 +2033,12 @@
1334 UT_LIST_REMOVE(view_list, trx_sys->view_list, prev_view);1424 UT_LIST_REMOVE(view_list, trx_sys->view_list, prev_view);
1335 }1425 }
1336 1426
@@ -1341,36 +1431,36 @@
1341 ut_a(UT_LIST_GET_LEN(trx_sys->mysql_trx_list) == 0);1431 ut_a(UT_LIST_GET_LEN(trx_sys->mysql_trx_list) == 0);
1342+ }1432+ }
1343 1433
1344 mem_free(trx_sys);1434 ut_ad(trx_sys->descr_n_used == 0);
1345 1435 ut_free(trx_sys->descriptors);
1346--- a/storage/innobase/trx/trx0trx.c1436--- a/storage/innobase/trx/trx0trx.c
1347+++ b/storage/innobase/trx/trx0trx.c1437+++ b/storage/innobase/trx/trx0trx.c
1348@@ -563,9 +563,8 @@1438@@ -692,8 +692,8 @@
1349 (ullint) trx->id);
1350 1439
1351 if (srv_force_recovery == 0) {1440 if (srv_force_recovery == 0) {
1352-1441
1353- trx->conc_state = TRX_PREPARED;1442- trx->state = TRX_PREPARED;
1354- trx_n_prepared++;1443- trx_n_prepared++;
1355+ /* xtrabackup should rollback it */1444+ /* xtrabackup should rollback it */
1356+ trx->conc_state = TRX_ACTIVE;1445+ trx->state = TRX_ACTIVE;
1357 } else {1446 } else {
1358 fprintf(stderr,1447 fprintf(stderr,
1359 "InnoDB: Since"1448 "InnoDB: Since"
1360@@ -639,10 +638,9 @@1449@@ -772,9 +772,11 @@
1361 (ullint) trx->id);
1362 1450
1363 if (srv_force_recovery == 0) {1451 if (srv_force_recovery == 0) {
1364-1452
1365+ /* xtrabackup should rollback it */1453+ /* xtrabackup should
1366 trx->conc_state1454+ rollback it */
1455 trx->state
1367- = TRX_PREPARED;1456- = TRX_PREPARED;
1368- trx_n_prepared++;1457- trx_n_prepared++;
1369+ = TRX_ACTIVE;1458+ = TRX_ACTIVE;
1459+ trx_reserve_descriptor(trx);
1370 } else {1460 } else {
1371 fprintf(stderr,1461 fprintf(stderr,
1372 "InnoDB: Since"1462 "InnoDB: Since"
1373@@ -1051,7 +1049,6 @@1463@@ -1211,7 +1213,6 @@
1374 trx->read_view = NULL;1464 trx->read_view = NULL;
1375 1465
1376 if (lsn) {1466 if (lsn) {
@@ -1378,7 +1468,7 @@
1378 1468
1379 mutex_exit(&kernel_mutex);1469 mutex_exit(&kernel_mutex);
1380 1470
1381@@ -1060,12 +1057,6 @@1471@@ -1220,12 +1221,6 @@
1382 trx_undo_insert_cleanup(trx);1472 trx_undo_insert_cleanup(trx);
1383 }1473 }
1384 1474
@@ -1391,7 +1481,7 @@
1391 /* NOTE that we could possibly make a group commit more1481 /* NOTE that we could possibly make a group commit more
1392 efficient here: call os_thread_yield here to allow also other1482 efficient here: call os_thread_yield here to allow also other
1393 trxs to come to commit! */1483 trxs to come to commit! */
1394@@ -1097,9 +1088,9 @@1484@@ -1257,9 +1252,9 @@
1395 if (trx->flush_log_later) {1485 if (trx->flush_log_later) {
1396 /* Do nothing yet */1486 /* Do nothing yet */
1397 trx->must_flush_log_later = TRUE;1487 trx->must_flush_log_later = TRUE;
@@ -1403,7 +1493,7 @@
1403 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {1493 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {
1404 /* Write the log but do not flush it to disk */1494 /* Write the log but do not flush it to disk */
1405 1495
1406@@ -1111,7 +1102,7 @@1496@@ -1271,7 +1266,7 @@
1407 1497
1408 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);1498 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);
1409 }1499 }
@@ -1412,7 +1502,7 @@
1412 1502
1413 /* Write the log but do not flush it to disk */1503 /* Write the log but do not flush it to disk */
1414 1504
1415@@ -1791,23 +1782,16 @@1505@@ -1956,23 +1951,16 @@
1416 trx_t* trx) /*!< in: trx handle */1506 trx_t* trx) /*!< in: trx handle */
1417 {1507 {
1418 ib_uint64_t lsn = trx->commit_lsn;1508 ib_uint64_t lsn = trx->commit_lsn;
@@ -1438,7 +1528,7 @@
1438 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {1528 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {
1439 /* Write the log but do not flush it to disk */1529 /* Write the log but do not flush it to disk */
1440 1530
1441@@ -1818,7 +1802,7 @@1531@@ -1983,7 +1971,7 @@
1442 1532
1443 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);1533 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);
1444 }1534 }
@@ -1447,7 +1537,7 @@
1447 1537
1448 /* Write the log but do not flush it to disk */1538 /* Write the log but do not flush it to disk */
1449 1539
1450@@ -2066,7 +2050,6 @@1540@@ -2252,7 +2240,6 @@
1451 /*--------------------------------------*/1541 /*--------------------------------------*/
1452 1542
1453 if (lsn) {1543 if (lsn) {
@@ -1455,7 +1545,7 @@
1455 1545
1456 /* Depending on the my.cnf options, we may now write the log1546 /* Depending on the my.cnf options, we may now write the log
1457 buffer to the log files, making the prepared state of the1547 buffer to the log files, making the prepared state of the
1458@@ -2087,15 +2070,9 @@1548@@ -2273,15 +2260,9 @@
1459 1549
1460 mutex_exit(&kernel_mutex);1550 mutex_exit(&kernel_mutex);
1461 1551
@@ -1473,7 +1563,7 @@
1473 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {1563 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {
1474 /* Write the log but do not flush it to disk */1564 /* Write the log but do not flush it to disk */
1475 1565
1476@@ -2107,7 +2084,7 @@1566@@ -2293,7 +2274,7 @@
1477 1567
1478 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);1568 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);
1479 }1569 }
@@ -1482,94 +1572,14 @@
1482 1572
1483 /* Write the log but do not flush it to disk */1573 /* Write the log but do not flush it to disk */
1484 1574
1485--- a/configure.cmake1575--- a/storage/innobase/row/row0merge.c
1486+++ b/configure.cmake1576+++ b/storage/innobase/row/row0merge.c
1487@@ -149,7 +149,9 @@1577@@ -2774,7 +2774,7 @@
1488 SET(CMAKE_REQUIRED_LIBRARIES 1578 ut_ad(indexes);
1489 ${LIBM} ${LIBNSL} ${LIBBIND} ${LIBCRYPT} ${LIBSOCKET} ${LIBDL} ${CMAKE_THREAD_LIBS_INIT} ${LIBRT})1579 ut_ad(n_indexes);
1490 1580
1491- LIST(REMOVE_DUPLICATES CMAKE_REQUIRED_LIBRARIES)1581- merge_sort_block_size = thd_merge_sort_block_size(trx->mysql_thd);
1492+ IF(CMAKE_REQUIRED_LIBRARIES)1582+ merge_sort_block_size = 1UL << 20;
1493+ LIST(REMOVE_DUPLICATES CMAKE_REQUIRED_LIBRARIES)1583
1494+ ENDIF()1584 trx_start_if_not_started(trx);
1495 LINK_LIBRARIES(${CMAKE_THREAD_LIBS_INIT})1585
1496
1497 OPTION(WITH_LIBWRAP "Compile with tcp wrappers support" OFF)
1498--- a/storage/innobase/sync/sync0arr.c
1499+++ b/storage/innobase/sync/sync0arr.c
1500@@ -41,6 +41,7 @@
1501 #include "os0file.h"
1502 #include "srv0srv.h"
1503 #include "ha_prototypes.h"
1504+#include "xb0xb.h"
1505
1506 /*
1507 WAIT ARRAY
1508@@ -926,6 +927,13 @@
1509 ibool fatal = FALSE;
1510 double longest_diff = 0;
1511
1512+ if (srv_rebuild_indexes) {
1513+
1514+ /* Avoid long semaphore warnings when rebuilding indexes */
1515+
1516+ return(FALSE);
1517+ }
1518+
1519 #ifdef UNIV_DEBUG_VALGRIND
1520 /* Increase the timeouts if running under valgrind because it executes
1521 extremely slowly. UNIV_DEBUG_VALGRIND does not necessary mean that
1522--- a/storage/innobase/include/buf0buf.h
1523+++ b/storage/innobase/include/buf0buf.h
1524@@ -1509,6 +1509,8 @@
1525 frees a page in buffer pool */
1526 # endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
1527 #endif /* !UNIV_HOTBACKUP */
1528+ ibool is_compacted; /*!< TRUE if the page was skipped in
1529+ compact backups */
1530 };
1531
1532 /** The buffer control block structure */
1533--- a/storage/innobase/mem/mem0dbg.c
1534+++ b/storage/innobase/mem/mem0dbg.c
1535@@ -280,18 +280,10 @@
1536 byte* buf, /*!< in: pointer to buffer */
1537 ulint n) /*!< in: length of buffer */
1538 {
1539- byte* ptr;
1540-
1541 UNIV_MEM_ASSERT_W(buf, n);
1542
1543- for (ptr = buf; ptr < buf + n; ptr++) {
1544-
1545- if (ut_rnd_gen_ibool()) {
1546- *ptr = 0xBA;
1547- } else {
1548- *ptr = 0xBE;
1549- }
1550- }
1551+ /* Fix https://bugs.launchpad.net/percona-xtrabackup/+bug/1158154 */
1552+ memset(buf, 0xBA, n);
1553
1554 UNIV_MEM_INVALID(buf, n);
1555 }
1556@@ -306,17 +298,10 @@
1557 byte* buf, /*!< in: pointer to buffer */
1558 ulint n) /*!< in: length of buffer */
1559 {
1560- byte* ptr;
1561-
1562 UNIV_MEM_ASSERT_W(buf, n);
1563
1564- for (ptr = buf; ptr < buf + n; ptr++) {
1565- if (ut_rnd_gen_ibool()) {
1566- *ptr = 0xDE;
1567- } else {
1568- *ptr = 0xAD;
1569- }
1570- }
1571+ /* Fix https://bugs.launchpad.net/percona-xtrabackup/+bug/1158154 */
1572+ memset(buf, 0xDE, n);
1573
1574 UNIV_MEM_FREE(buf, n);
1575 }
15761586
=== modified file 'src/Makefile'
--- src/Makefile 2013-05-18 03:04:06 +0000
+++ src/Makefile 2013-07-22 14:01:36 +0000
@@ -183,7 +183,7 @@
183 usr0sess.o ut0byte.o ut0dbg.o \183 usr0sess.o ut0byte.o ut0dbg.o \
184 ut0list.o ut0mem.o ut0rnd.o \184 ut0list.o ut0mem.o ut0rnd.o \
185 ut0ut.o ut0vec.o ut0wqueue.o \185 ut0ut.o ut0vec.o ut0wqueue.o \
186 ut0rbt.o)186 ut0rbt.o log0online.o)
187xtradb: MYSQLOBJS = $(addprefix $(MYSQL_ROOT_DIR)/, mysys/libmysys.a \187xtradb: MYSQLOBJS = $(addprefix $(MYSQL_ROOT_DIR)/, mysys/libmysys.a \
188 strings/libmystrings.a zlib/.libs/libzlt.a dbug/libdbug.a)188 strings/libmystrings.a zlib/.libs/libzlt.a dbug/libdbug.a)
189xtradb: DEFS += -DXTRADB_BASED 189xtradb: DEFS += -DXTRADB_BASED
190190
=== modified file 'src/compact.cc'
--- src/compact.cc 2013-05-03 05:17:03 +0000
+++ src/compact.cc 2013-07-22 14:01:36 +0000
@@ -815,7 +815,7 @@
815 index->to_be_dropped = 1;815 index->to_be_dropped = 1;
816816
817 /* Patch up any FK referencing this index with NULL */817 /* Patch up any FK referencing this index with NULL */
818 dict_foreign_replace_index(table, index, trx);818 dict_foreign_replace_index(table, NULL, index);
819819
820 dict_index_remove_from_cache(table, index);820 dict_index_remove_from_cache(table, index);
821821
822822
=== modified file 'src/innodb_int.cc'
--- src/innodb_int.cc 2013-04-27 12:08:11 +0000
+++ src/innodb_int.cc 2013-07-22 14:01:36 +0000
@@ -47,6 +47,25 @@
4747
48long innobase_mirrored_log_groups = 1;48long innobase_mirrored_log_groups = 1;
4949
50/******************************************************//**
51Reads a specified log segment to a buffer. */
52UNIV_INTERN
53void
54xb_log_group_read_log_seg(
55/*===================*/
56 ulint type, /*!< in: LOG_ARCHIVE or LOG_RECOVER */
57 byte* buf, /*!< in: buffer where to read */
58 log_group_t* group, /*!< in: log group */
59 ib_uint64_t start_lsn, /*!< in: read area start */
60 ib_uint64_t end_lsn) /*!< in: read area end */
61{
62#if defined(XTRADB_BASED) && !defined(XTRADB55)
63 log_group_read_log_seg(type, buf, group, start_lsn, end_lsn, FALSE);
64#else
65 log_group_read_log_seg(type, buf, group, start_lsn, end_lsn);
66#endif
67}
68
50/****************************************************************//**69/****************************************************************//**
51A simple function to open or create a file.70A simple function to open or create a file.
52@return own: handle to the file, not defined if error, error number71@return own: handle to the file, not defined if error, error number
@@ -244,7 +263,7 @@
244 if (!ret) {263 if (!ret) {
245 msg("xtrabackup: cannot set size for file %s\n", path);264 msg("xtrabackup: cannot set size for file %s\n", path);
246 os_file_close(*file);265 os_file_close(*file);
247 os_file_delete(path);266 xb_file_delete(path);
248 return ret;267 return ret;
249 }268 }
250269
@@ -289,7 +308,7 @@
289 msg("xtrabackup: could not write the first page to %s\n",308 msg("xtrabackup: could not write the first page to %s\n",
290 path);309 path);
291 os_file_close(*file);310 os_file_close(*file);
292 os_file_delete(path);311 xb_file_delete(path);
293 return ret;312 return ret;
294 }313 }
295314
@@ -334,6 +353,43 @@
334 /* do nothing */353 /* do nothing */
335}354}
336355
356my_bool
357innobase_check_identifier_length(
358/*=============================*/
359 const char* id __attribute__((unused)))
360{
361 msg("xtrabackup: innobase_check_identifier_length() called.\n");
362 ut_a(0);
363 return(false);
364}
365
366uint
367innobase_convert_to_filename_charset(
368/*=================================*/
369 char* to __attribute__((unused)),
370 const char* from __attribute__((unused)),
371 ulint len __attribute__((unused)))
372{
373 msg("xtrabackup: innobase_convert_to_filename_charset() called.\n");
374 ut_a(0);
375
376 return(0);
377}
378
379uint
380innobase_convert_to_system_charset(
381/*=================================*/
382 char* to __attribute__((unused)),
383 const char* from __attribute__((unused)),
384 ulint len __attribute__((unused)),
385 uint* errors __attribute__((unused)))
386{
387 msg("xtrabackup: innobase_convert_to__charset() called.\n");
388 ut_a(0);
389
390 return(0);
391}
392
337#if MYSQL_VERSION_ID >= 50500393#if MYSQL_VERSION_ID >= 50500
338394
339/**********************************************************************//**395/**********************************************************************//**
340396
=== modified file 'src/innodb_int.h'
--- src/innodb_int.h 2013-05-04 05:26:19 +0000
+++ src/innodb_int.h 2013-07-22 14:01:36 +0000
@@ -144,6 +144,8 @@
144 fil_rename_tablespace(old_name_in, id, new_name, new_path)144 fil_rename_tablespace(old_name_in, id, new_name, new_path)
145# define xb_btr_root_block_get(index, mode, mtr) \145# define xb_btr_root_block_get(index, mode, mtr) \
146 btr_root_block_get(index, mode, mtr)146 btr_root_block_get(index, mode, mtr)
147# define xb_file_delete(path) \
148 os_file_delete_func(path)
147 typedef ib_mutex_t mutex_t;149 typedef ib_mutex_t mutex_t;
148# define INNODB_LOG_DIR srv_log_group_home_dir150# define INNODB_LOG_DIR srv_log_group_home_dir
149# define DEFAULT_LOG_FILE_SIZE 48*1024*1024151# define DEFAULT_LOG_FILE_SIZE 48*1024*1024
@@ -154,6 +156,7 @@
154# define xb_os_event_create(name) os_event_create()156# define xb_os_event_create(name) os_event_create()
155#else /* MYSQL_VERSION_ID >= 50600 */157#else /* MYSQL_VERSION_ID >= 50600 */
156 /* MySQL and Percona Server 5.1 and 5.5 */158 /* MySQL and Percona Server 5.1 and 5.5 */
159# define xb_file_delete(path) os_file_delete(path)
157# define xb_buf_page_is_corrupted(page, zip_size) \160# define xb_buf_page_is_corrupted(page, zip_size) \
158 buf_page_is_corrupted(page, zip_size)161 buf_page_is_corrupted(page, zip_size)
159# define xb_os_event_create(name) os_event_create(name)162# define xb_os_event_create(name) os_event_create(name)
@@ -360,6 +363,7 @@
360 .ibd file of tablespace and want to363 .ibd file of tablespace and want to
361 stop temporarily posting of new i/o364 stop temporarily posting of new i/o
362 requests on the file */365 requests on the file */
366#if MYSQL_VERSION_ID < 50500
363 ibool stop_ibuf_merges;367 ibool stop_ibuf_merges;
364 /*!< we set this TRUE when we start368 /*!< we set this TRUE when we start
365 deleting a single-table tablespace */369 deleting a single-table tablespace */
@@ -370,6 +374,20 @@
370 or flush requests can be placed on this space,374 or flush requests can be placed on this space,
371 though there may be such requests still being375 though there may be such requests still being
372 processed on this space */376 processed on this space */
377#else
378 ibool stop_new_ops;
379 /*!< we set this TRUE when we start
380 deleting a single-table tablespace.
381 When this is set following new ops
382 are not allowed:
383 * read IO request
384 * ibuf merge
385 * file flush
386 Note that we can still possibly have
387 new write operations because we don't
388 check this flag when doing flush
389 batches. */
390#endif
373 ulint purpose;/*!< FIL_TABLESPACE, FIL_LOG, or391 ulint purpose;/*!< FIL_TABLESPACE, FIL_LOG, or
374 FIL_ARCH_LOG */392 FIL_ARCH_LOG */
375 UT_LIST_BASE_NODE_T(fil_node_t) chain;393 UT_LIST_BASE_NODE_T(fil_node_t) chain;
@@ -746,14 +764,14 @@
746 lsn_t* max_flushed_lsn,/* out: */764 lsn_t* max_flushed_lsn,/* out: */
747 ulint* sum_of_new_sizes);/* out: sum of sizes of the new files added765 ulint* sum_of_new_sizes);/* out: sum of sizes of the new files added
748 */766 */
749767#ifndef XTRADB_BASED
750ibool768ibool
751log_block_checksum_is_ok_or_old_format(769log_block_checksum_is_ok_or_old_format(
752/*===================================*/770/*===================================*/
753 /* out: TRUE if ok, or if the log block may be in the771 /* out: TRUE if ok, or if the log block may be in the
754 format of InnoDB version < 3.23.52 */772 format of InnoDB version < 3.23.52 */
755 byte* block); /* in: pointer to a log block */773 byte* block); /* in: pointer to a log block */
756774#endif /* XTRADB_BASED */
757#endif /* MYSQL_VERSION_ID >= 50600 */775#endif /* MYSQL_VERSION_ID >= 50600 */
758776
759buf_block_t*777buf_block_t*
@@ -801,6 +819,18 @@
801} /* extern "C" */819} /* extern "C" */
802#endif820#endif
803821
822/******************************************************//**
823Reads a specified log segment to a buffer. */
824UNIV_INTERN
825void
826xb_log_group_read_log_seg(
827/*===================*/
828 ulint type, /*!< in: LOG_ARCHIVE or LOG_RECOVER */
829 byte* buf, /*!< in: buffer where to read */
830 log_group_t* group, /*!< in: log group */
831 ib_uint64_t start_lsn, /*!< in: read area start */
832 ib_uint64_t end_lsn); /*!< in: read area end */
833
804/****************************************************************//**834/****************************************************************//**
805A simple function to open or create a file.835A simple function to open or create a file.
806@return own: handle to the file, not defined if error, error number836@return own: handle to the file, not defined if error, error number
@@ -967,6 +997,26 @@
967997
968#if MYSQL_VERSION_ID < 50600998#if MYSQL_VERSION_ID < 50600
969999
1000my_bool
1001innobase_check_identifier_length(
1002/*=============================*/
1003 const char* id);
1004
1005uint
1006innobase_convert_to_filename_charset(
1007/*=================================*/
1008 char* to,
1009 const char* from,
1010 ulint len);
1011
1012uint
1013innobase_convert_to_system_charset(
1014/*=================================*/
1015 char* to,
1016 const char* from,
1017 ulint len,
1018 uint* errors);
1019
970void1020void
971innobase_invalidate_query_cache(1021innobase_invalidate_query_cache(
972 trx_t* trx,1022 trx_t* trx,
9731023
=== modified file 'src/xtrabackup.cc'
--- src/xtrabackup.cc 2013-07-10 12:29:40 +0000
+++ src/xtrabackup.cc 2013-07-22 14:01:36 +0000
@@ -1367,6 +1367,11 @@
1367 }1367 }
1368#endif1368#endif
13691369
1370#ifdef XTRADB_BASED
1371 /* Workaround for LP #1203308. */
1372 srv_track_changed_pages = FALSE;
1373#endif
1374
1370 return(FALSE);1375 return(FALSE);
13711376
1372error:1377error:
@@ -2056,8 +2061,8 @@
20562061
2057 mutex_enter(&log_sys->mutex);2062 mutex_enter(&log_sys->mutex);
20582063
2059 log_group_read_log_seg(LOG_RECOVER, log_sys->buf,2064 xb_log_group_read_log_seg(LOG_RECOVER, log_sys->buf,
2060 group, start_lsn, end_lsn);2065 group, start_lsn, end_lsn);
20612066
20622067
2063 /* reference recv_scan_log_recs() */2068 /* reference recv_scan_log_recs() */
@@ -3487,11 +3492,7 @@
3487 for (;;) {3492 for (;;) {
3488 mtr_start(&local_mtr);3493 mtr_start(&local_mtr);
34893494
3490#if (MYSQL_VERSION_ID < 50517)
3491 local_block = btr_block_get(space_id, zip_size, page_no, RW_S_LATCH, &local_mtr);
3492#else
3493 local_block = btr_block_get(space_id, zip_size, page_no, RW_S_LATCH, index, &local_mtr);3495 local_block = btr_block_get(space_id, zip_size, page_no, RW_S_LATCH, index, &local_mtr);
3494#endif
3495 local_page = buf_block_get_frame(local_block);3496 local_page = buf_block_get_frame(local_block);
3496 blob_header = local_page + offset;3497 blob_header = local_page + offset;
3497#define BTR_BLOB_HDR_PART_LEN 03498#define BTR_BLOB_HDR_PART_LEN 0
@@ -3532,13 +3533,8 @@
3532 mtr_commit(&mtr);3533 mtr_commit(&mtr);
3533 if (right_page_no != FIL_NULL) {3534 if (right_page_no != FIL_NULL) {
3534 mtr_start(&mtr);3535 mtr_start(&mtr);
3535#if (MYSQL_VERSION_ID < 50517)
3536 block = btr_block_get(space, zip_size, right_page_no,
3537 RW_X_LATCH, &mtr);
3538#else
3539 block = btr_block_get(space, zip_size, right_page_no,3536 block = btr_block_get(space, zip_size, right_page_no,
3540 RW_X_LATCH, index, &mtr);3537 RW_X_LATCH, index, &mtr);
3541#endif
3542 page = buf_block_get_frame(block);3538 page = buf_block_get_frame(block);
3543 goto loop;3539 goto loop;
3544 }3540 }
@@ -4565,7 +4561,7 @@
4565 if (!table) {4561 if (!table) {
4566 snprintf(name, FN_REFLEN, "%s/%s/%s", data_home_dir,4562 snprintf(name, FN_REFLEN, "%s/%s/%s", data_home_dir,
4567 db_name, file_name);4563 db_name, file_name);
4568 return os_file_delete(name);4564 return xb_file_delete(name);
4569 }4565 }
45704566
4571 return(TRUE);4567 return(TRUE);
45724568
=== modified file 'utils/build.sh'
--- utils/build.sh 2013-06-05 08:39:54 +0000
+++ utils/build.sh 2013-07-22 14:01:36 +0000
@@ -2,9 +2,9 @@
22
3set -e3set -e
44
5MYSQL_51_VERSION=5.1.595MYSQL_51_VERSION=5.1.70
6MYSQL_55_VERSION=5.5.176MYSQL_55_VERSION=5.5.31
7MYSQL_56_VERSION=5.6.107MYSQL_56_VERSION=5.6.11
8PS_51_VERSION=5.1.59-13.08PS_51_VERSION=5.1.59-13.0
9PS_55_VERSION=5.5.16-22.09PS_55_VERSION=5.5.16-22.0
1010
@@ -125,10 +125,11 @@
125################################################################################125################################################################################
126function unpack_and_patch()126function unpack_and_patch()
127{127{
128 local dirname=`basename "$1" ".tar.gz"`
128 tar xzf $top_dir/$1129 tar xzf $top_dir/$1
129 cd `basename "$1" ".tar.gz"`130 cd $dirname
130 patch -p1 < $top_dir/patches/$2131 patch -p1 < $top_dir/patches/$2
131 cd ..132 cd -
132}133}
133134
134################################################################################135################################################################################
@@ -215,8 +216,8 @@
215{216{
216 local type=$1217 local type=$1
217 local mysql_version_short=${mysql_version:0:3}218 local mysql_version_short=${mysql_version:0:3}
218 server_dir=$top_dir/mysql-$mysql_version_short219 local dirname=`basename "$server_tarball" ".tar.gz"`
219 server_tarball=mysql-$mysql_version.tar.gz220
220 innodb_dir=$server_dir/storage/$innodb_name221 innodb_dir=$server_dir/storage/$innodb_name
221222
222 echo "Downloading sources"223 echo "Downloading sources"
@@ -226,7 +227,7 @@
226227
227 echo "Preparing sources"228 echo "Preparing sources"
228 unpack_and_patch $server_tarball $server_patch229 unpack_and_patch $server_tarball $server_patch
229 mv $top_dir/mysql-$mysql_version $server_dir230 mv $top_dir/$dirname $server_dir
230231
231 build_server $type232 build_server $type
232233
@@ -241,10 +242,12 @@
241242
242case "$type" in243case "$type" in
243"innodb51")244"innodb51")
245 server_dir=$top_dir/mysql-5.1
244 mysql_version=$MYSQL_51_VERSION246 mysql_version=$MYSQL_51_VERSION
245 server_patch=innodb51.patch247 server_patch=innodb51.patch
246 innodb_name=innodb_plugin248 innodb_name=innodb_plugin
247 xtrabackup_target=plugin249 xtrabackup_target=plugin
250 server_tarball=mysql-5.1.70.tar.gz
248 configure_cmd="./configure --enable-local-infile \251 configure_cmd="./configure --enable-local-infile \
249 --enable-thread-safe-client \252 --enable-thread-safe-client \
250 --with-plugins=innodb_plugin \253 --with-plugins=innodb_plugin \
@@ -255,10 +258,12 @@
255 build_all $type258 build_all $type
256 ;;259 ;;
257"innodb55")260"innodb55")
261 server_dir=$top_dir/mysql-5.5
258 mysql_version=$MYSQL_55_VERSION262 mysql_version=$MYSQL_55_VERSION
259 server_patch=innodb55.patch263 server_patch=innodb55.patch
260 innodb_name=innobase264 innodb_name=innobase
261 xtrabackup_target=5.5265 xtrabackup_target=5.5
266 server_tarball=mysql-5.5.31.tar.gz
262 # We need to build with partitioning due to MySQL bug #58632267 # We need to build with partitioning due to MySQL bug #58632
263 configure_cmd="cmake . \268 configure_cmd="cmake . \
264 -DENABLED_LOCAL_INFILE=ON \269 -DENABLED_LOCAL_INFILE=ON \
@@ -272,10 +277,12 @@
272 ;;277 ;;
273278
274"innodb56" )279"innodb56" )
280 server_dir=$top_dir/mysql-5.6
275 mysql_version=$MYSQL_56_VERSION281 mysql_version=$MYSQL_56_VERSION
276 server_patch=innodb56.patch282 server_patch=innodb56.patch
277 innodb_name=innobase283 innodb_name=innobase
278 xtrabackup_target=5.6284 xtrabackup_target=5.6
285 server_tarball=mysql-5.6.11.tar.gz
279 configure_cmd="cmake . \286 configure_cmd="cmake . \
280 -DWITH_INNOBASE_STORAGE_ENGINE=ON \287 -DWITH_INNOBASE_STORAGE_ENGINE=ON \
281 -DWITH_ZLIB=bundled \288 -DWITH_ZLIB=bundled \
@@ -288,8 +295,10 @@
288"xtradb51" )295"xtradb51" )
289 server_dir=$top_dir/Percona-Server296 server_dir=$top_dir/Percona-Server
290 branch_dir=percona-server-5.1-xtrabackup297 branch_dir=percona-server-5.1-xtrabackup
291 innodb_dir=$server_dir/storage/innodb_plugin298 innodb_name=innodb_plugin
292 xtrabackup_target=xtradb299 xtrabackup_target=xtradb
300 server_patch=xtradb51.patch
301 server_tarball=Percona-Server-5.1.70-rel14.8.tar.gz
293 configure_cmd="./configure --enable-local-infile \302 configure_cmd="./configure --enable-local-infile \
294 --enable-thread-safe-client \303 --enable-thread-safe-client \
295 --with-plugins=innodb_plugin \304 --with-plugins=innodb_plugin \
@@ -301,42 +310,15 @@
301 configure_cmd="LIBS=-lrt $configure_cmd"310 configure_cmd="LIBS=-lrt $configure_cmd"
302 fi311 fi
303312
304313 build_all $type
305 echo "Downloading sources"
306
307 # Get Percona Server
308 if [ -d $branch_dir ]
309 then
310 rm -rf $branch_dir
311 fi
312
313 if [ ! -f Percona-Server-XtraBackup-$PS_51_VERSION.tar.gz ]
314 then
315 make ps51source
316 fi
317
318 rm -rf $branch_dir
319 tar xfz Percona-Server-XtraBackup-$PS_51_VERSION.tar.gz
320 cd $branch_dir
321 $MAKE_CMD main
322 cd $top_dir
323 rm -rf $server_dir
324 ln -s $branch_dir/Percona-Server $server_dir
325
326 # Patch Percona Server
327 cd $server_dir
328 patch -p1 < $top_dir/patches/xtradb51.patch
329
330 build_server $type
331
332 build_xtrabackup
333
334 ;;314 ;;
335"xtradb55" )315"xtradb55" )
336 server_dir=$top_dir/Percona-Server-5.5316 server_dir=$top_dir/Percona-Server-5.5
337 branch_dir=percona-server-5.5-xtrabackup317 branch_dir=percona-server-5.5-xtrabackup
338 innodb_dir=$server_dir/storage/innobase318 innodb_name=innobase
339 xtrabackup_target=xtradb55319 xtrabackup_target=xtradb55
320 server_patch=xtradb55.patch
321 server_tarball=Percona-Server-5.5.31-rel30.3.tar.gz
340 # We need to build with partitioning due to MySQL bug #58632322 # We need to build with partitioning due to MySQL bug #58632
341 configure_cmd="cmake . \323 configure_cmd="cmake . \
342 -DENABLED_LOCAL_INFILE=ON \324 -DENABLED_LOCAL_INFILE=ON \
@@ -350,37 +332,7 @@
350 configure_cmd="LIBS=-lrt $configure_cmd"332 configure_cmd="LIBS=-lrt $configure_cmd"
351 fi333 fi
352334
353335 build_all $type
354 echo "Downloading sources"
355
356 # Get Percona Server
357 if [ -d $branch_dir ]
358 then
359 rm -rf $branch_dir
360 fi
361
362 if [ ! -f Percona-Server-XtraBackup-$PS_55_VERSION.tar.gz ]
363 then
364 make ps55source
365 fi
366
367 rm -rf $branch_dir
368 tar xfz Percona-Server-XtraBackup-$PS_55_VERSION.tar.gz
369 cd $branch_dir
370
371 $MAKE_CMD PERCONA_SERVER=Percona-Server-5.5 main
372 cd $top_dir
373 rm -rf $server_dir
374 ln -s $branch_dir/Percona-Server $server_dir
375
376 # Patch Percona Server
377 cd $server_dir
378 patch -p1 < $top_dir/patches/xtradb55.patch
379
380 build_server $type
381
382 build_xtrabackup
383
384 ;;336 ;;
385*)337*)
386 usage338 usage

Subscribers

People subscribed via source and target branches

to all changes: