Merge lp:~akopytov/percona-xtrabackup/update-versions-1.6 into lp:percona-xtrabackup/1.6

Proposed by Alexey Kopytov
Status: Merged
Approved by: Stewart Smith
Approved revision: no longer in the source branch.
Merged at revision: 307
Proposed branch: lp:~akopytov/percona-xtrabackup/update-versions-1.6
Merge into: lp:percona-xtrabackup/1.6
Diff against target: 2220 lines (+448/-270)
6 files modified
patches/innodb51_builtin.patch (+9/-7)
patches/innodb55.patch (+67/-63)
patches/xtradb51.patch (+141/-90)
patches/xtradb55.patch (+149/-98)
utils/build.sh (+12/-6)
xtrabackup.c (+70/-6)
To merge this branch: bzr merge lp:~akopytov/percona-xtrabackup/update-versions-1.6
Reviewer Review Type Date Requested Status
Stewart Smith (community) Approve
Review via email: mp+83102@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Alexey Kopytov (akopytov) wrote :
Revision history for this message
Stewart Smith (stewart) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'patches/innodb51_builtin.patch'
2--- patches/innodb51_builtin.patch 2011-09-14 12:48:27 +0000
3+++ patches/innodb51_builtin.patch 2011-11-27 06:47:26 +0000
4@@ -727,15 +727,15 @@
5 /* Recovery is running and no operations on the log files are
6 allowed yet (the variable name .._no_ibuf_.. is misleading) */
7
8-@@ -3056,6 +3058,7 @@
9- for the 'very fast' shutdown, because the InnoDB layer may have
10- committed or prepared transactions and we don't want to lose them. */
11+@@ -3057,6 +3059,7 @@
12+ shutdown, because the InnoDB layer may have committed or
13+ prepared transactions and we don't want to lose them. */
14
15 + if (!srv_apply_log_only) {
16 if (trx_n_mysql_transactions > 0
17- || UT_LIST_GET_LEN(trx_sys->trx_list) > 0) {
18+ || UT_LIST_GET_LEN(trx_sys->trx_list) > trx_n_prepared) {
19
20-@@ -3063,6 +3066,7 @@
21+@@ -3064,6 +3067,7 @@
22
23 goto loop;
24 }
25@@ -1262,18 +1262,19 @@
26 if (purge_sys->trx->n_active_thrs > 0) {
27 --- a/storage/innobase/trx/trx0trx.c
28 +++ b/storage/innobase/trx/trx0trx.c
29-@@ -478,8 +478,8 @@
30+@@ -481,9 +481,8 @@
31 ut_dulint_get_low(trx->id));
32
33 if (srv_force_recovery == 0) {
34 -
35 - trx->conc_state = TRX_PREPARED;
36+- trx_n_prepared++;
37 + /* xtrabackup should rollback it */
38 + trx->conc_state = TRX_ACTIVE;
39 } else {
40 fprintf(stderr,
41 "InnoDB: Since"
42-@@ -555,9 +555,9 @@
43+@@ -559,10 +558,9 @@
44 trx->id));
45
46 if (srv_force_recovery == 0) {
47@@ -1281,6 +1282,7 @@
48 + /* xtrabackup should rollback it */
49 trx->conc_state
50 - = TRX_PREPARED;
51+- trx_n_prepared++;
52 + = TRX_ACTIVE;
53 } else {
54 fprintf(stderr,
55
56=== modified file 'patches/innodb55.patch'
57--- patches/innodb55.patch 2011-09-14 12:48:27 +0000
58+++ patches/innodb55.patch 2011-11-27 06:47:26 +0000
59@@ -1,6 +1,6 @@
60 --- a/storage/innobase/btr/btr0btr.c
61 +++ b/storage/innobase/btr/btr0btr.c
62-@@ -120,7 +120,7 @@
63+@@ -674,7 +674,7 @@
64 /**************************************************************//**
65 Gets the root node of a tree and x-latches it.
66 @return root page, x-latched */
67@@ -9,7 +9,7 @@
68 buf_block_t*
69 btr_root_block_get(
70 /*===============*/
71-@@ -566,7 +566,7 @@
72+@@ -1123,7 +1123,7 @@
73 /************************************************************//**
74 Returns the child page of a node pointer and x-latches it.
75 @return child page, x-latched */
76@@ -20,7 +20,7 @@
77 /*===================*/
78 --- a/storage/innobase/buf/buf0buf.c
79 +++ b/storage/innobase/buf/buf0buf.c
80-@@ -517,7 +517,7 @@
81+@@ -518,7 +518,7 @@
82 return(TRUE);
83 }
84
85@@ -29,7 +29,7 @@
86 if (recv_lsn_checks_on) {
87 ib_uint64_t current_lsn;
88
89-@@ -4056,7 +4056,7 @@
90+@@ -3668,7 +3668,7 @@
91 recv_recover_page(TRUE, (buf_block_t*) bpage);
92 }
93
94@@ -40,7 +40,7 @@
95 bpage->offset, buf_page_get_zip_size(bpage),
96 --- a/storage/innobase/buf/buf0rea.c
97 +++ b/storage/innobase/buf/buf0rea.c
98-@@ -122,6 +122,45 @@
99+@@ -124,6 +124,45 @@
100 bpage = buf_page_init_for_read(err, mode, space, zip_size, unzip,
101 tablespace_version, offset);
102 if (bpage == NULL) {
103@@ -86,7 +86,7 @@
104
105 return(0);
106 }
107-@@ -604,6 +643,50 @@
108+@@ -768,6 +807,50 @@
109 /* It is a single table tablespace and the .ibd file is
110 missing: do nothing */
111
112@@ -233,7 +233,7 @@
113 }
114
115 /**********************************************************************//**
116-@@ -1463,7 +1480,12 @@
117+@@ -1464,7 +1481,12 @@
118 the file yet; the following calls will open it and update the
119 size fields */
120
121@@ -247,7 +247,7 @@
122 fil_node_complete_io(node, fil_system, OS_FILE_READ);
123 }
124
125-@@ -1515,7 +1537,12 @@
126+@@ -1516,7 +1538,12 @@
127 the file yet; the following calls will open it and update the
128 size fields */
129
130@@ -261,7 +261,7 @@
131 fil_node_complete_io(node, fil_system, OS_FILE_READ);
132 }
133
134-@@ -2180,7 +2207,7 @@
135+@@ -2181,7 +2208,7 @@
136 if (fil_create_new_single_table_tablespace(
137 space_id, name, FALSE, flags,
138 FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {
139@@ -270,7 +270,7 @@
140 }
141 }
142
143-@@ -2343,7 +2370,7 @@
144+@@ -2344,7 +2371,7 @@
145 }
146
147 if (success) {
148@@ -279,7 +279,7 @@
149 /* Write a log record about the deletion of the .ibd
150 file, so that ibbackup can replay it in the
151 --apply-log phase. We use a dummy mtr and the familiar
152-@@ -2644,7 +2671,7 @@
153+@@ -2645,7 +2672,7 @@
154
155 mutex_exit(&fil_system->mutex);
156
157@@ -288,7 +288,7 @@
158 if (success) {
159 mtr_t mtr;
160
161-@@ -2835,7 +2862,7 @@
162+@@ -2836,7 +2863,7 @@
163
164 fil_node_create(path, size, space_id, FALSE);
165
166@@ -297,7 +297,7 @@
167 {
168 mtr_t mtr;
169
170-@@ -3090,19 +3117,97 @@
171+@@ -3091,19 +3118,97 @@
172 "InnoDB: open the tablespace file ", stderr);
173 ut_print_filename(stderr, filepath);
174 fputs("!\n"
175@@ -405,7 +405,7 @@
176 return(FALSE);
177 }
178
179-@@ -3334,7 +3439,7 @@
180+@@ -3335,7 +3440,7 @@
181 cannot be ok. */
182
183 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;
184@@ -414,7 +414,7 @@
185 if (size < FIL_IBD_FILE_INITIAL_SIZE * UNIV_PAGE_SIZE) {
186 fprintf(stderr,
187 "InnoDB: Error: the size of single-table tablespace"
188-@@ -3475,7 +3580,7 @@
189+@@ -3476,7 +3581,7 @@
190 idea is to read as much good data as we can and jump over bad data.
191 @return 0 if ok, -1 if error even after the retries, 1 if at the end
192 of the directory */
193@@ -423,7 +423,7 @@
194 int
195 fil_file_readdir_next_file(
196 /*=======================*/
197-@@ -3774,15 +3879,97 @@
198+@@ -3775,15 +3880,97 @@
199 "InnoDB: in InnoDB data dictionary"
200 " has tablespace id %lu,\n"
201 "InnoDB: but tablespace with that id"
202@@ -529,7 +529,7 @@
203 } else {
204 ut_print_timestamp(stderr);
205 fputs(" InnoDB: Error: table ", stderr);
206-@@ -4171,7 +4358,7 @@
207+@@ -4172,7 +4359,7 @@
208 off the LRU list if it is in the LRU list. The caller must hold the fil_sys
209 mutex. */
210 static
211@@ -538,7 +538,7 @@
212 fil_node_prepare_for_io(
213 /*====================*/
214 fil_node_t* node, /*!< in: file node */
215-@@ -4191,10 +4378,13 @@
216+@@ -4192,10 +4379,13 @@
217 }
218
219 if (node->open == FALSE) {
220@@ -553,7 +553,7 @@
221 }
222
223 if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE
224-@@ -4207,6 +4397,8 @@
225+@@ -4208,6 +4398,8 @@
226 }
227
228 node->n_pending++;
229@@ -562,7 +562,7 @@
230 }
231
232 /********************************************************************//**
233-@@ -4391,6 +4583,16 @@
234+@@ -4390,6 +4582,16 @@
235
236 ut_ad((mode != OS_AIO_IBUF) || (space->purpose == FIL_TABLESPACE));
237
238@@ -581,7 +581,7 @@
239 for (;;) {
240 --- a/storage/innobase/ibuf/ibuf0ibuf.c
241 +++ b/storage/innobase/ibuf/ibuf0ibuf.c
242-@@ -1160,6 +1160,9 @@
243+@@ -1148,6 +1148,9 @@
244 ut_ad(!recv_no_ibuf_operations);
245 ut_ad(x_latch || mtr == NULL);
246
247@@ -591,7 +591,7 @@
248 if (ibuf_fixed_addr_page(space, zip_size, page_no)) {
249
250 return(TRUE);
251-@@ -2674,6 +2677,9 @@
252+@@ -2715,6 +2718,9 @@
253 ulint n_bytes;
254 ulint n_pag2;
255
256@@ -603,7 +603,7 @@
257
258 --- a/storage/innobase/include/srv0srv.h
259 +++ b/storage/innobase/include/srv0srv.h
260-@@ -216,6 +216,10 @@
261+@@ -218,6 +218,10 @@
262 extern ulong srv_max_purge_lag;
263
264 extern ulong srv_replication_delay;
265@@ -647,21 +647,24 @@
266 allowed yet (the variable name .._no_ibuf_.. is misleading) */
267
268 @@ -3114,6 +3116,7 @@
269- for the 'very fast' shutdown, because the InnoDB layer may have
270- committed or prepared transactions and we don't want to lose them. */
271+ shutdown, because the InnoDB layer may have committed or
272+ prepared transactions and we don't want to lose them. */
273
274 + if (!srv_apply_log_only) {
275- if (trx_n_mysql_transactions > 0
276- || UT_LIST_GET_LEN(trx_sys->trx_list) > 0) {
277-
278-@@ -3121,6 +3124,7 @@
279-
280+ server_busy = trx_n_mysql_transactions > 0
281+ || UT_LIST_GET_LEN(trx_sys->trx_list) > trx_n_prepared;
282+ mutex_exit(&kernel_mutex);
283+@@ -3121,6 +3124,10 @@
284+ if (server_busy || srv_is_any_background_thread_active()) {
285 goto loop;
286 }
287 + }
288++ else {
289++ mutex_exit(&kernel_mutex);
290++ }
291
292- if (srv_fast_shutdown == 2) {
293- /* In this fastest shutdown we do not flush the buffer pool:
294+ mutex_enter(&log_sys->mutex);
295+ server_busy = log_sys->n_pending_checkpoint_writes
296 --- a/storage/innobase/log/log0recv.c
297 +++ b/storage/innobase/log/log0recv.c
298 @@ -42,27 +42,27 @@
299@@ -870,7 +873,7 @@
300 if ((ulint)ret == n) {
301 --- a/storage/innobase/os/os0thread.c
302 +++ b/storage/innobase/os/os0thread.c
303-@@ -266,12 +266,17 @@
304+@@ -251,11 +251,16 @@
305 #ifdef __WIN__
306 Sleep((DWORD) tm / 1000);
307 #else
308@@ -887,7 +890,6 @@
309 +*/
310 #endif
311 }
312-
313 --- a/storage/innobase/row/row0merge.c
314 +++ b/storage/innobase/row/row0merge.c
315 @@ -459,7 +459,9 @@
316@@ -914,7 +916,7 @@
317 mem_heap_free(heap);
318 return(DB_DUPLICATE_KEY);
319 }
320-@@ -2628,7 +2632,9 @@
321+@@ -2627,7 +2631,9 @@
322
323 /* Reset the MySQL row buffer that is used when reporting
324 duplicate keys. */
325@@ -927,7 +929,7 @@
326 secondary index entries for merge sort */
327 --- a/storage/innobase/srv/srv0srv.c
328 +++ b/storage/innobase/srv/srv0srv.c
329-@@ -401,6 +401,9 @@
330+@@ -399,6 +399,9 @@
331
332 UNIV_INTERN ulong srv_replication_delay = 0;
333
334@@ -937,7 +939,7 @@
335 /*-------------------------------------------*/
336 UNIV_INTERN ulong srv_n_spin_wait_rounds = 30;
337 UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500;
338-@@ -1099,7 +1102,7 @@
339+@@ -1078,7 +1081,7 @@
340 }
341
342 /* Initialize some INFORMATION SCHEMA internal structures */
343@@ -946,7 +948,7 @@
344 }
345
346 /*********************************************************************//**
347-@@ -1110,6 +1113,7 @@
348+@@ -1089,6 +1092,7 @@
349 /*==========*/
350 {
351 os_fast_mutex_free(&srv_conc_mutex);
352@@ -954,7 +956,7 @@
353 mem_free(srv_conc_slots);
354 srv_conc_slots = NULL;
355
356-@@ -1123,6 +1127,7 @@
357+@@ -1102,6 +1106,7 @@
358 srv_mysql_table = NULL;
359
360 trx_i_s_cache_free(trx_i_s_cache);
361@@ -962,7 +964,7 @@
362 }
363
364 /*********************************************************************//**
365-@@ -1718,7 +1723,7 @@
366+@@ -1717,7 +1722,7 @@
367 }
368
369 /* Record the lock wait time for this thread */
370@@ -973,7 +975,7 @@
371 if (trx->was_chosen_as_deadlock_victim) {
372 --- a/storage/innobase/srv/srv0start.c
373 +++ b/storage/innobase/srv/srv0start.c
374-@@ -94,6 +94,8 @@
375+@@ -93,6 +93,8 @@
376 /** Log sequence number at shutdown */
377 UNIV_INTERN ib_uint64_t srv_shutdown_lsn;
378
379@@ -982,7 +984,7 @@
380 #ifdef HAVE_DARWIN_THREADS
381 # include <sys/utsname.h>
382 /** TRUE if the F_FULLFSYNC option is available */
383-@@ -549,7 +551,7 @@
384+@@ -548,7 +550,7 @@
385 /*********************************************************************//**
386 Creates or opens the log files and closes them.
387 @return DB_SUCCESS or error code */
388@@ -991,7 +993,7 @@
389 ulint
390 open_or_create_log_file(
391 /*====================*/
392-@@ -709,7 +711,7 @@
393+@@ -708,7 +710,7 @@
394 /*********************************************************************//**
395 Creates or opens database data files and closes them.
396 @return DB_SUCCESS or error code */
397@@ -1000,7 +1002,7 @@
398 ulint
399 open_or_create_data_files(
400 /*======================*/
401-@@ -1414,7 +1416,7 @@
402+@@ -1419,7 +1421,7 @@
403 }
404 #endif /* UNIV_LOG_ARCHIVE */
405
406@@ -1009,7 +1011,7 @@
407 ut_print_timestamp(stderr);
408 fprintf(stderr,
409 " InnoDB: Error: combined size of log files"
410-@@ -1709,6 +1711,10 @@
411+@@ -1714,6 +1716,10 @@
412 are initialized in trx_sys_init_at_db_start(). */
413
414 recv_recovery_from_checkpoint_finish();
415@@ -1020,7 +1022,7 @@
416 if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) {
417 /* The following call is necessary for the insert
418 buffer to work with multiple tablespaces. We must
419-@@ -1868,6 +1874,17 @@
420+@@ -1873,6 +1879,17 @@
421 if (!srv_auto_extend_last_data_file
422 && sum_of_data_file_sizes != tablespace_size_in_header) {
423
424@@ -1038,7 +1040,7 @@
425 ut_print_timestamp(stderr);
426 fprintf(stderr,
427 " InnoDB: Error: tablespace size"
428-@@ -1947,6 +1964,7 @@
429+@@ -1952,6 +1969,7 @@
430
431 return(DB_ERROR);
432 }
433@@ -1046,7 +1048,7 @@
434 }
435
436 /* Check that os_fast_mutexes work as expected */
437-@@ -2059,6 +2077,7 @@
438+@@ -2064,6 +2082,7 @@
439 ibuf_update_max_tablespace_id();
440 }
441
442@@ -1054,18 +1056,6 @@
443 srv_file_per_table = srv_file_per_table_original_value;
444
445 srv_was_started = TRUE;
446---- a/storage/innobase/trx/trx0purge.c
447-+++ b/storage/innobase/trx/trx0purge.c
448-@@ -1100,6 +1100,9 @@
449- /* que_thr_t* thr2; */
450- ulint old_pages_handled;
451-
452-+ if (srv_fake_write)
453-+ return(0);
454-+
455- mutex_enter(&(purge_sys->mutex));
456-
457- if (purge_sys->trx->n_active_thrs > 0) {
458 --- a/storage/innobase/trx/trx0rseg.c
459 +++ b/storage/innobase/trx/trx0rseg.c
460 @@ -140,9 +140,11 @@
461@@ -1082,7 +1072,7 @@
462
463 --- a/storage/innobase/trx/trx0sys.c
464 +++ b/storage/innobase/trx/trx0sys.c
465-@@ -1641,10 +1641,12 @@
466+@@ -1686,10 +1686,12 @@
467 UT_LIST_REMOVE(view_list, trx_sys->view_list, prev_view);
468 }
469
470@@ -1097,18 +1087,19 @@
471
472 --- a/storage/innobase/trx/trx0trx.c
473 +++ b/storage/innobase/trx/trx0trx.c
474-@@ -469,8 +469,8 @@
475+@@ -522,9 +522,8 @@
476 (ullint) trx->id);
477
478 if (srv_force_recovery == 0) {
479 -
480 - trx->conc_state = TRX_PREPARED;
481+- trx_n_prepared++;
482 + /* xtrabackup should rollback it */
483 + trx->conc_state = TRX_ACTIVE;
484 } else {
485 fprintf(stderr,
486 "InnoDB: Since"
487-@@ -544,9 +544,9 @@
488+@@ -598,10 +597,9 @@
489 (ullint) trx->id);
490
491 if (srv_force_recovery == 0) {
492@@ -1116,7 +1107,20 @@
493 + /* xtrabackup should rollback it */
494 trx->conc_state
495 - = TRX_PREPARED;
496+- trx_n_prepared++;
497 + = TRX_ACTIVE;
498 } else {
499 fprintf(stderr,
500 "InnoDB: Since"
501+--- a/storage/innobase/trx/trx0purge.c
502++++ b/storage/innobase/trx/trx0purge.c
503+@@ -1129,6 +1129,9 @@
504+ que_thr_t* thr;
505+ ulint old_pages_handled;
506+
507++ if (srv_fake_write)
508++ return(0);
509++
510+ ut_a(purge_sys->trx->n_active_thrs == 0);
511+
512+ rw_lock_x_lock(&purge_sys->latch);
513
514=== modified file 'patches/xtradb51.patch'
515--- patches/xtradb51.patch 2011-09-14 12:48:27 +0000
516+++ patches/xtradb51.patch 2011-11-27 06:47:26 +0000
517@@ -1,6 +1,6 @@
518 --- a/storage/innodb_plugin/btr/btr0btr.c
519 +++ b/storage/innodb_plugin/btr/btr0btr.c
520-@@ -120,7 +120,7 @@
521+@@ -674,7 +674,7 @@
522 /**************************************************************//**
523 Gets the root node of a tree and x-latches it.
524 @return root page, x-latched */
525@@ -9,7 +9,7 @@
526 buf_block_t*
527 btr_root_block_get(
528 /*===============*/
529-@@ -578,7 +578,7 @@
530+@@ -1134,7 +1134,7 @@
531 /************************************************************//**
532 Returns the child page of a node pointer and x-latches it.
533 @return child page, x-latched */
534@@ -20,7 +20,7 @@
535 /*===================*/
536 --- a/storage/innodb_plugin/buf/buf0buf.c
537 +++ b/storage/innodb_plugin/buf/buf0buf.c
538-@@ -440,7 +440,7 @@
539+@@ -412,7 +412,7 @@
540 return(TRUE);
541 }
542
543@@ -29,7 +29,7 @@
544 if (recv_lsn_checks_on) {
545 ib_uint64_t current_lsn;
546
547-@@ -4030,7 +4030,7 @@
548+@@ -3302,7 +3302,7 @@
549 recv_recover_page(TRUE, (buf_block_t*) bpage);
550 }
551
552@@ -40,7 +40,7 @@
553 (srv_pass_corrupt_table && bpage->is_corrupt) ? NULL :
554 --- a/storage/innodb_plugin/fil/fil0fil.c
555 +++ b/storage/innodb_plugin/fil/fil0fil.c
556-@@ -294,7 +294,7 @@
557+@@ -297,7 +297,7 @@
558
559 /** The tablespace memory cache. This variable is NULL before the module is
560 initialized. */
561@@ -49,7 +49,7 @@
562
563
564 /********************************************************************//**
565-@@ -305,7 +305,7 @@
566+@@ -308,7 +308,7 @@
567 off the LRU list if it is in the LRU list. The caller must hold the fil_sys
568 mutex. */
569 static
570@@ -58,7 +58,7 @@
571 fil_node_prepare_for_io(
572 /*====================*/
573 fil_node_t* node, /*!< in: file node */
574-@@ -630,7 +630,7 @@
575+@@ -633,7 +633,7 @@
576 Opens a the file of a node of a tablespace. The caller must own the fil_system
577 mutex. */
578 static
579@@ -67,7 +67,7 @@
580 fil_node_open_file(
581 /*===============*/
582 fil_node_t* node, /*!< in: file node */
583-@@ -664,7 +664,17 @@
584+@@ -667,7 +667,17 @@
585 node->name, OS_FILE_OPEN, OS_FILE_READ_ONLY, &success);
586 if (!success) {
587 /* The following call prints an error message */
588@@ -86,7 +86,7 @@
589
590 ut_print_timestamp(stderr);
591
592-@@ -725,12 +735,14 @@
593+@@ -728,12 +738,14 @@
594
595 if (UNIV_UNLIKELY(space_id != space->id)) {
596 fprintf(stderr,
597@@ -105,7 +105,7 @@
598 }
599
600 if (UNIV_UNLIKELY(space_id == ULINT_UNDEFINED
601-@@ -754,8 +766,8 @@
602+@@ -757,8 +769,8 @@
603 }
604
605 if (size_bytes >= 1024 * 1024) {
606@@ -116,7 +116,7 @@
607 }
608
609 if (!(flags & DICT_TF_ZSSIZE_MASK)) {
610-@@ -800,6 +812,8 @@
611+@@ -803,6 +815,8 @@
612 /* Put the node to the LRU list */
613 UT_LIST_ADD_FIRST(LRU, system->LRU, node);
614 }
615@@ -125,7 +125,7 @@
616 }
617
618 /**********************************************************************//**
619-@@ -1428,7 +1442,12 @@
620+@@ -1431,7 +1445,12 @@
621 the file yet; the following calls will open it and update the
622 size fields */
623
624@@ -139,7 +139,7 @@
625 fil_node_complete_io(node, fil_system, OS_FILE_READ);
626 }
627
628-@@ -1480,7 +1499,12 @@
629+@@ -1483,7 +1502,12 @@
630 the file yet; the following calls will open it and update the
631 size fields */
632
633@@ -153,7 +153,7 @@
634 fil_node_complete_io(node, fil_system, OS_FILE_READ);
635 }
636
637-@@ -2153,7 +2177,7 @@
638+@@ -2157,7 +2181,7 @@
639 if (fil_create_new_single_table_tablespace(
640 space_id, name, FALSE, flags,
641 FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {
642@@ -162,7 +162,7 @@
643 }
644 }
645
646-@@ -2316,7 +2340,7 @@
647+@@ -2324,7 +2348,7 @@
648 }
649
650 if (success) {
651@@ -171,7 +171,7 @@
652 /* Write a log record about the deletion of the .ibd
653 file, so that ibbackup can replay it in the
654 --apply-log phase. We use a dummy mtr and the familiar
655-@@ -2617,7 +2641,7 @@
656+@@ -2625,7 +2649,7 @@
657
658 mutex_exit(&fil_system->mutex);
659
660@@ -180,7 +180,7 @@
661 if (success) {
662 mtr_t mtr;
663
664-@@ -2807,7 +2831,7 @@
665+@@ -2815,7 +2839,7 @@
666
667 fil_node_create(path, size, space_id, FALSE);
668
669@@ -189,7 +189,7 @@
670 {
671 mtr_t mtr;
672
673-@@ -3060,19 +3084,97 @@
674+@@ -3159,19 +3183,97 @@
675 "InnoDB: open the tablespace file ", stderr);
676 ut_print_filename(stderr, filepath);
677 fputs("!\n"
678@@ -297,7 +297,7 @@
679 return(FALSE);
680 }
681
682-@@ -3777,7 +3879,7 @@
683+@@ -4106,7 +4208,7 @@
684 cannot be ok. */
685
686 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;
687@@ -306,7 +306,7 @@
688 if (size < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {
689 fprintf(stderr,
690 "InnoDB: Error: the size of single-table tablespace"
691-@@ -3918,7 +4020,7 @@
692+@@ -4247,7 +4349,7 @@
693 idea is to read as much good data as we can and jump over bad data.
694 @return 0 if ok, -1 if error even after the retries, 1 if at the end
695 of the directory */
696@@ -315,7 +315,7 @@
697 int
698 fil_file_readdir_next_file(
699 /*=======================*/
700-@@ -4217,15 +4319,97 @@
701+@@ -4546,15 +4648,97 @@
702 "InnoDB: in InnoDB data dictionary"
703 " has tablespace id %lu,\n"
704 "InnoDB: but tablespace with that id"
705@@ -421,7 +421,7 @@
706 } else {
707 ut_print_timestamp(stderr);
708 fputs(" InnoDB: Error: table ", stderr);
709-@@ -4614,7 +4798,7 @@
710+@@ -4953,7 +5137,7 @@
711 off the LRU list if it is in the LRU list. The caller must hold the fil_sys
712 mutex. */
713 static
714@@ -430,7 +430,7 @@
715 fil_node_prepare_for_io(
716 /*====================*/
717 fil_node_t* node, /*!< in: file node */
718-@@ -4634,10 +4818,13 @@
719+@@ -4973,10 +5157,13 @@
720 }
721
722 if (node->open == FALSE) {
723@@ -445,7 +445,7 @@
724 }
725
726 if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE
727-@@ -4650,6 +4837,8 @@
728+@@ -4989,6 +5176,8 @@
729 }
730
731 node->n_pending++;
732@@ -454,7 +454,7 @@
733 }
734
735 /********************************************************************//**
736-@@ -4835,6 +5024,16 @@
737+@@ -5190,6 +5379,16 @@
738
739 ut_ad((mode != OS_AIO_IBUF) || (space->purpose == FIL_TABLESPACE));
740
741@@ -473,7 +473,7 @@
742 for (;;) {
743 --- a/storage/innodb_plugin/handler/ha_innodb.cc
744 +++ b/storage/innodb_plugin/handler/ha_innodb.cc
745-@@ -343,12 +343,6 @@
746+@@ -365,12 +365,6 @@
747 "Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout.",
748 NULL, NULL, 50, 1, 1024 * 1024 * 1024, 0);
749
750@@ -483,14 +483,13 @@
751 - "The value 3 regards innodb_flush_log_at_trx_commit (default).",
752 - NULL, NULL, 3, 0, 3, 0);
753 -
754-
755- static handler *innobase_create_handler(handlerton *hton,
756- TABLE_SHARE *table,
757-@@ -729,17 +723,6 @@
758- return(THDVAR((THD*) thd, lock_wait_timeout));
759+ static MYSQL_THDVAR_BOOL(fake_changes, PLUGIN_VAR_OPCMDARG,
760+ "In the transaction after enabled, UPDATE, INSERT and DELETE only move the cursor to the records "
761+ "and do nothing other operations (no changes, no ibuf, no undo, no transaction log) in the transaction. "
762+@@ -760,17 +754,6 @@
763 }
764
765--/******************************************************************//**
766+ /******************************************************************//**
767 -*/
768 -extern "C" UNIV_INTERN
769 -ulong
770@@ -501,10 +500,11 @@
771 - return(THDVAR((THD*) thd, flush_log_at_trx_commit_session));
772 -}
773 -
774- /********************************************************************//**
775- Obtain the InnoDB transaction of a MySQL thread.
776- @return reference to transaction pointer */
777-@@ -11775,7 +11758,6 @@
778+-/******************************************************************//**
779+ Returns true if expand_fast_index_creation is enabled for the current
780+ session.
781+ @return the value of the server's expand_fast_index_creation variable */
782+@@ -11966,7 +11949,6 @@
783 MYSQL_SYSVAR(flush_neighbor_pages),
784 MYSQL_SYSVAR(read_ahead),
785 MYSQL_SYSVAR(adaptive_checkpoint),
786@@ -536,11 +536,10 @@
787
788 --- a/storage/innodb_plugin/include/ha_prototypes.h
789 +++ b/storage/innodb_plugin/include/ha_prototypes.h
790-@@ -268,12 +268,4 @@
791- void* thd); /*!< in: thread handle (THD*), or NULL to query
792+@@ -269,14 +269,6 @@
793 the global innodb_lock_wait_timeout */
794
795--/******************************************************************//**
796+ /******************************************************************//**
797 -*/
798 -
799 -ulong
800@@ -548,10 +547,13 @@
801 -/*================================*/
802 - void* thd);
803 -
804- #endif
805+-/******************************************************************//**
806+ Returns true if innodb_expand_fast_index_creation is enabled for the current
807+ session.
808+ @return the value of the server's innodb_expand_fast_index_creation variable */
809 --- a/storage/innodb_plugin/include/srv0srv.h
810 +++ b/storage/innodb_plugin/include/srv0srv.h
811-@@ -228,6 +228,10 @@
812+@@ -226,6 +226,10 @@
813
814 extern ulong srv_replication_delay;
815
816@@ -575,14 +577,14 @@
817 #endif
818 --- a/storage/innodb_plugin/include/trx0trx.h
819 +++ b/storage/innodb_plugin/include/trx0trx.h
820-@@ -497,7 +497,6 @@
821+@@ -508,7 +508,6 @@
822 FALSE, one can save CPU time and about
823 150 bytes in the undo log size as then
824 we skip XA steps */
825 - ulint flush_log_at_trx_commit_session;
826+ ulint fake_changes;
827 ulint flush_log_later;/* In 2PC, we hold the
828 prepare_commit mutex across
829- both phases. In that case, we
830 --- a/storage/innodb_plugin/include/ut0byte.ic
831 +++ b/storage/innodb_plugin/include/ut0byte.ic
832 @@ -168,6 +168,14 @@
833@@ -637,15 +639,15 @@
834 /* Recovery is running and no operations on the log files are
835 allowed yet (the variable name .._no_ibuf_.. is misleading) */
836
837-@@ -3126,6 +3126,7 @@
838- for the 'very fast' shutdown, because the InnoDB layer may have
839- committed or prepared transactions and we don't want to lose them. */
840+@@ -3127,6 +3127,7 @@
841+ shutdown, because the InnoDB layer may have committed or
842+ prepared transactions and we don't want to lose them. */
843
844 + if (!srv_apply_log_only) {
845 if (trx_n_mysql_transactions > 0
846- || UT_LIST_GET_LEN(trx_sys->trx_list) > 0) {
847+ || UT_LIST_GET_LEN(trx_sys->trx_list) > trx_n_prepared) {
848
849-@@ -3133,6 +3134,7 @@
850+@@ -3134,6 +3135,7 @@
851
852 goto loop;
853 }
854@@ -746,7 +748,7 @@
855 }
856 }
857
858-@@ -2923,12 +2926,14 @@
859+@@ -2922,12 +2925,14 @@
860
861 if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) {
862
863@@ -762,7 +764,7 @@
864 }
865 }
866
867-@@ -3096,6 +3101,7 @@
868+@@ -3095,6 +3100,7 @@
869 recv_sys->recovered_lsn = checkpoint_lsn;
870
871 srv_start_lsn = checkpoint_lsn;
872@@ -770,7 +772,7 @@
873 }
874
875 contiguous_lsn = ut_uint64_align_down(recv_sys->scanned_lsn,
876-@@ -3454,6 +3460,7 @@
877+@@ -3453,6 +3459,7 @@
878 that the data dictionary tables will be free of any locks.
879 The data dictionary latch should guarantee that there is at
880 most one data dictionary transaction active at a time. */
881@@ -780,7 +782,7 @@
882
883 --- a/storage/innodb_plugin/os/os0file.c
884 +++ b/storage/innodb_plugin/os/os0file.c
885-@@ -554,7 +554,7 @@
886+@@ -555,7 +555,7 @@
887 }
888
889 #undef USE_FILE_LOCK
890@@ -789,7 +791,7 @@
891 #if defined(UNIV_HOTBACKUP) || defined(__WIN__) || defined(__NETWARE__)
892 /* InnoDB Hot Backup does not lock the data files.
893 * On Windows, mandatory locking is used.
894-@@ -1356,8 +1356,9 @@
895+@@ -1357,8 +1357,9 @@
896 attributes = 0;
897 ut_error;
898 }
899@@ -800,7 +802,7 @@
900 GENERIC_READ | GENERIC_WRITE, /* read and write
901 access */
902 share_mode, /* File can be read also by other
903-@@ -1416,7 +1417,11 @@
904+@@ -1417,7 +1418,11 @@
905 if (create_mode == OS_FILE_OPEN || create_mode == OS_FILE_OPEN_RAW
906 || create_mode == OS_FILE_OPEN_RETRY) {
907 mode_str = "OPEN";
908@@ -813,7 +815,7 @@
909 } else if (create_mode == OS_FILE_CREATE) {
910 mode_str = "CREATE";
911 create_flag = O_RDWR | O_CREAT | O_EXCL;
912-@@ -2622,6 +2627,9 @@
913+@@ -2682,6 +2687,9 @@
914 ut_a((offset & 0xFFFFFFFFUL) == offset);
915 ut_a((n & 0xFFFFFFFFUL) == n);
916
917@@ -823,7 +825,7 @@
918 os_n_file_writes++;
919
920 ut_ad(file);
921-@@ -2746,6 +2754,9 @@
922+@@ -2806,6 +2814,9 @@
923 #else
924 ssize_t ret;
925
926@@ -855,7 +857,7 @@
927
928 --- a/storage/innodb_plugin/row/row0merge.c
929 +++ b/storage/innodb_plugin/row/row0merge.c
930-@@ -453,7 +453,9 @@
931+@@ -454,7 +454,9 @@
932 rec = rec_convert_dtuple_to_rec(*buf, index, tuple, n_ext);
933 offsets = rec_get_offsets(rec, index, NULL, ULINT_UNDEFINED, &heap);
934
935@@ -866,7 +868,7 @@
936
937 mem_heap_free(heap);
938 }
939-@@ -1464,8 +1466,10 @@
940+@@ -1465,8 +1467,10 @@
941 case 0:
942 if (UNIV_UNLIKELY
943 (dict_index_is_unique(index) && !null_eq)) {
944@@ -879,7 +881,7 @@
945 mem_heap_free(heap);
946 return(DB_DUPLICATE_KEY);
947 }
948-@@ -2593,7 +2597,9 @@
949+@@ -2594,7 +2598,9 @@
950
951 /* Reset the MySQL row buffer that is used when reporting
952 duplicate keys. */
953@@ -892,7 +894,19 @@
954 secondary index entries for merge sort */
955 --- a/storage/innodb_plugin/srv/srv0srv.c
956 +++ b/storage/innodb_plugin/srv/srv0srv.c
957-@@ -402,6 +402,10 @@
958+@@ -86,11 +86,6 @@
959+ #include "trx0i_s.h"
960+ #include "os0sync.h" /* for HAVE_ATOMIC_BUILTINS */
961+
962+-/* prototypes of new functions added to ha_innodb.cc for kill_idle_transaction */
963+-ibool innobase_thd_is_idle(const void* thd);
964+-ib_int64_t innobase_thd_get_start_time(const void* thd);
965+-void innobase_thd_kill(void* thd);
966+-
967+ /* prototypes for new functions added to ha_innodb.cc */
968+ ibool innobase_get_slow_log();
969+
970+@@ -415,6 +410,10 @@
971
972 UNIV_INTERN ulong srv_replication_delay = 0;
973
974@@ -903,7 +917,7 @@
975 UNIV_INTERN long long srv_ibuf_max_size = 0;
976 UNIV_INTERN ulint srv_ibuf_active_contract = 0; /* 0:disable 1:enable */
977 UNIV_INTERN ulint srv_ibuf_accel_rate = 100;
978-@@ -1050,7 +1054,7 @@
979+@@ -1065,7 +1064,7 @@
980 }
981
982 /* Initialize some INFORMATION SCHEMA internal structures */
983@@ -912,7 +926,7 @@
984 }
985
986 /*********************************************************************//**
987-@@ -1061,6 +1065,7 @@
988+@@ -1076,6 +1075,7 @@
989 /*==========*/
990 {
991 os_fast_mutex_free(&srv_conc_mutex);
992@@ -920,7 +934,7 @@
993 mem_free(srv_conc_slots);
994 srv_conc_slots = NULL;
995
996-@@ -1074,6 +1079,7 @@
997+@@ -1089,6 +1089,7 @@
998 srv_mysql_table = NULL;
999
1000 trx_i_s_cache_free(trx_i_s_cache);
1001@@ -928,9 +942,46 @@
1002 }
1003
1004 /*********************************************************************//**
1005+@@ -2570,36 +2571,6 @@
1006+ old_sema = sema;
1007+ }
1008+
1009+- if (srv_kill_idle_transaction && trx_sys) {
1010+- trx_t* trx;
1011+- time_t now;
1012+-rescan_idle:
1013+- now = time(NULL);
1014+- mutex_enter(&kernel_mutex);
1015+- trx = UT_LIST_GET_FIRST(trx_sys->mysql_trx_list);
1016+- while (trx) {
1017+- if (trx->conc_state == TRX_ACTIVE
1018+- && trx->mysql_thd
1019+- && innobase_thd_is_idle(trx->mysql_thd)) {
1020+- ib_int64_t start_time; /* as stmt ID */
1021+-
1022+- start_time = innobase_thd_get_start_time(trx->mysql_thd);
1023+- if (trx->last_stmt_start != start_time) {
1024+- trx->idle_start = now;
1025+- trx->last_stmt_start = start_time;
1026+- } else if (difftime(now, trx->idle_start)
1027+- > srv_kill_idle_transaction) {
1028+- /* kill the session */
1029+- mutex_exit(&kernel_mutex);
1030+- innobase_thd_kill(trx->mysql_thd);
1031+- goto rescan_idle;
1032+- }
1033+- }
1034+- trx = UT_LIST_GET_NEXT(mysql_trx_list, trx);
1035+- }
1036+- mutex_exit(&kernel_mutex);
1037+- }
1038+-
1039+ /* Flush stderr so that a database user gets the output
1040+ to possible MySQL error file */
1041+
1042 --- a/storage/innodb_plugin/srv/srv0start.c
1043 +++ b/storage/innodb_plugin/srv/srv0start.c
1044-@@ -94,6 +94,8 @@
1045+@@ -95,6 +95,8 @@
1046 /** Log sequence number at shutdown */
1047 UNIV_INTERN ib_uint64_t srv_shutdown_lsn;
1048
1049@@ -939,7 +990,7 @@
1050 #ifdef HAVE_DARWIN_THREADS
1051 # include <sys/utsname.h>
1052 /** TRUE if the F_FULLFSYNC option is available */
1053-@@ -544,7 +546,7 @@
1054+@@ -545,7 +547,7 @@
1055 /*********************************************************************//**
1056 Creates or opens the log files and closes them.
1057 @return DB_SUCCESS or error code */
1058@@ -948,7 +999,7 @@
1059 ulint
1060 open_or_create_log_file(
1061 /*====================*/
1062-@@ -702,7 +704,7 @@
1063+@@ -703,7 +705,7 @@
1064 /*********************************************************************//**
1065 Creates or opens database data files and closes them.
1066 @return DB_SUCCESS or error code */
1067@@ -957,7 +1008,7 @@
1068 ulint
1069 open_or_create_data_files(
1070 /*======================*/
1071-@@ -1777,6 +1779,10 @@
1072+@@ -1782,6 +1784,10 @@
1073 are initialized in trx_sys_init_at_db_start(). */
1074
1075 recv_recovery_from_checkpoint_finish();
1076@@ -968,7 +1019,7 @@
1077 if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) {
1078 /* The following call is necessary for the insert
1079 buffer to work with multiple tablespaces. We must
1080-@@ -1952,7 +1958,18 @@
1081+@@ -1962,7 +1968,18 @@
1082
1083 if (srv_auto_extend_last_data_file
1084 && sum_of_data_file_sizes < tablespace_size_in_header) {
1085@@ -987,7 +1038,7 @@
1086 fprintf(stderr,
1087 "InnoDB: Error: tablespace size stored in header"
1088 " is %lu pages, but\n"
1089-@@ -1977,6 +1994,7 @@
1090+@@ -1987,6 +2004,7 @@
1091
1092 return(DB_ERROR);
1093 }
1094@@ -995,7 +1046,7 @@
1095 }
1096
1097 /* Check that os_fast_mutexes work as expected */
1098-@@ -2079,6 +2097,7 @@
1099+@@ -2089,6 +2107,7 @@
1100 ibuf_update_max_tablespace_id();
1101 }
1102
1103@@ -1031,7 +1082,7 @@
1104
1105 --- a/storage/innodb_plugin/trx/trx0sys.c
1106 +++ b/storage/innodb_plugin/trx/trx0sys.c
1107-@@ -1931,10 +1931,12 @@
1108+@@ -1941,10 +1941,12 @@
1109 UT_LIST_REMOVE(view_list, trx_sys->view_list, prev_view);
1110 }
1111
1112@@ -1046,27 +1097,27 @@
1113
1114 --- a/storage/innodb_plugin/trx/trx0trx.c
1115 +++ b/storage/innodb_plugin/trx/trx0trx.c
1116-@@ -109,8 +109,6 @@
1117+@@ -112,8 +112,6 @@
1118
1119 trx->support_xa = TRUE;
1120
1121 - trx->flush_log_at_trx_commit_session = 3; /* means to use innodb_flush_log_at_trx_commit value */
1122 -
1123+ trx->fake_changes = FALSE;
1124+
1125 trx->check_foreigns = TRUE;
1126- trx->check_unique_secondary = TRUE;
1127-
1128-@@ -493,8 +491,8 @@
1129- TRX_ID_PREP_PRINTF(trx->id));
1130+@@ -556,8 +554,8 @@
1131
1132 if (srv_force_recovery == 0) {
1133--
1134+
1135 - trx->conc_state = TRX_PREPARED;
1136+- trx_n_prepared++;
1137 + /* xtrabackup should rollback it */
1138 + trx->conc_state = TRX_ACTIVE;
1139 } else {
1140 fprintf(stderr,
1141 "InnoDB: Since"
1142-@@ -570,9 +568,9 @@
1143+@@ -633,10 +631,9 @@
1144 trx->id));
1145
1146 if (srv_force_recovery == 0) {
1147@@ -1074,11 +1125,12 @@
1148 + /* xtrabackup should rollback it */
1149 trx->conc_state
1150 - = TRX_PREPARED;
1151+- trx_n_prepared++;
1152 + = TRX_ACTIVE;
1153 } else {
1154 fprintf(stderr,
1155 "InnoDB: Since"
1156-@@ -737,9 +735,6 @@
1157+@@ -801,9 +798,6 @@
1158 generated by the same transaction, doesn't. */
1159 trx->support_xa = thd_supports_xa(trx->mysql_thd);
1160
1161@@ -1088,7 +1140,7 @@
1162 mutex_enter(&kernel_mutex);
1163
1164 ret = trx_start_low(trx, rseg_id);
1165-@@ -921,7 +916,6 @@
1166+@@ -990,7 +984,6 @@
1167 trx->read_view = NULL;
1168
1169 if (lsn) {
1170@@ -1096,7 +1148,7 @@
1171
1172 mutex_exit(&kernel_mutex);
1173
1174-@@ -930,12 +924,6 @@
1175+@@ -999,11 +992,6 @@
1176 trx_undo_insert_cleanup(trx);
1177 }
1178
1179@@ -1105,11 +1157,10 @@
1180 - } else {
1181 - flush_log_at_trx_commit = trx->flush_log_at_trx_commit_session;
1182 - }
1183--
1184+
1185 /* NOTE that we could possibly make a group commit more
1186 efficient here: call os_thread_yield here to allow also other
1187- trxs to come to commit! */
1188-@@ -967,9 +955,9 @@
1189+@@ -1036,9 +1024,9 @@
1190 if (trx->flush_log_later) {
1191 /* Do nothing yet */
1192 trx->must_flush_log_later = TRUE;
1193@@ -1121,7 +1172,7 @@
1194 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {
1195 /* Write the log but do not flush it to disk */
1196
1197-@@ -981,7 +969,7 @@
1198+@@ -1050,7 +1038,7 @@
1199
1200 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);
1201 }
1202@@ -1130,7 +1181,7 @@
1203
1204 /* Write the log but do not flush it to disk */
1205
1206-@@ -1661,23 +1649,16 @@
1207+@@ -1730,23 +1718,16 @@
1208 trx_t* trx) /*!< in: trx handle */
1209 {
1210 ib_uint64_t lsn = trx->commit_lsn;
1211@@ -1156,7 +1207,7 @@
1212 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {
1213 /* Write the log but do not flush it to disk */
1214
1215-@@ -1688,7 +1669,7 @@
1216+@@ -1757,7 +1738,7 @@
1217
1218 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);
1219 }
1220@@ -1165,7 +1216,7 @@
1221
1222 /* Write the log but do not flush it to disk */
1223
1224-@@ -1948,8 +1929,6 @@
1225+@@ -2018,8 +1999,6 @@
1226 /*--------------------------------------*/
1227
1228 if (lsn) {
1229@@ -1174,7 +1225,7 @@
1230 /* Depending on the my.cnf options, we may now write the log
1231 buffer to the log files, making the prepared state of the
1232 transaction durable if the OS does not crash. We may also
1233-@@ -1969,15 +1948,9 @@
1234+@@ -2039,15 +2018,9 @@
1235
1236 mutex_exit(&kernel_mutex);
1237
1238@@ -1192,7 +1243,7 @@
1239 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {
1240 /* Write the log but do not flush it to disk */
1241
1242-@@ -1989,7 +1962,7 @@
1243+@@ -2059,7 +2032,7 @@
1244
1245 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);
1246 }
1247
1248=== modified file 'patches/xtradb55.patch'
1249--- patches/xtradb55.patch 2011-09-14 12:48:27 +0000
1250+++ patches/xtradb55.patch 2011-11-27 06:47:26 +0000
1251@@ -1,6 +1,6 @@
1252 --- a/storage/innobase/btr/btr0btr.c
1253 +++ b/storage/innobase/btr/btr0btr.c
1254-@@ -120,7 +120,7 @@
1255+@@ -674,7 +674,7 @@
1256 /**************************************************************//**
1257 Gets the root node of a tree and x-latches it.
1258 @return root page, x-latched */
1259@@ -9,7 +9,7 @@
1260 buf_block_t*
1261 btr_root_block_get(
1262 /*===============*/
1263-@@ -578,7 +578,7 @@
1264+@@ -1134,7 +1134,7 @@
1265 /************************************************************//**
1266 Returns the child page of a node pointer and x-latches it.
1267 @return child page, x-latched */
1268@@ -20,7 +20,7 @@
1269 /*===================*/
1270 --- a/storage/innobase/buf/buf0buf.c
1271 +++ b/storage/innobase/buf/buf0buf.c
1272-@@ -609,7 +609,7 @@
1273+@@ -581,7 +581,7 @@
1274 return(TRUE);
1275 }
1276
1277@@ -29,7 +29,7 @@
1278 if (recv_lsn_checks_on) {
1279 ib_uint64_t current_lsn;
1280
1281-@@ -4901,7 +4901,7 @@
1282+@@ -4064,7 +4064,7 @@
1283 recv_recover_page(TRUE, (buf_block_t*) bpage);
1284 }
1285
1286@@ -40,7 +40,7 @@
1287 (srv_pass_corrupt_table && bpage->is_corrupt) ? NULL :
1288 --- a/storage/innobase/fil/fil0fil.c
1289 +++ b/storage/innobase/fil/fil0fil.c
1290-@@ -305,7 +305,7 @@
1291+@@ -307,7 +307,7 @@
1292
1293 /** The tablespace memory cache. This variable is NULL before the module is
1294 initialized. */
1295@@ -49,7 +49,7 @@
1296
1297 #ifdef UNIV_DEBUG
1298 /** Try fil_validate() every this many times */
1299-@@ -344,7 +344,7 @@
1300+@@ -346,7 +346,7 @@
1301 off the LRU list if it is in the LRU list. The caller must hold the fil_sys
1302 mutex. */
1303 static
1304@@ -58,7 +58,7 @@
1305 fil_node_prepare_for_io(
1306 /*====================*/
1307 fil_node_t* node, /*!< in: file node */
1308-@@ -669,7 +669,7 @@
1309+@@ -671,7 +671,7 @@
1310 Opens a the file of a node of a tablespace. The caller must own the fil_system
1311 mutex. */
1312 static
1313@@ -67,7 +67,7 @@
1314 fil_node_open_file(
1315 /*===============*/
1316 fil_node_t* node, /*!< in: file node */
1317-@@ -704,7 +704,17 @@
1318+@@ -706,7 +706,17 @@
1319 OS_FILE_READ_ONLY, &success);
1320 if (!success) {
1321 /* The following call prints an error message */
1322@@ -86,7 +86,7 @@
1323
1324 ut_print_timestamp(stderr);
1325
1326-@@ -765,12 +775,15 @@
1327+@@ -767,12 +777,15 @@
1328
1329 if (UNIV_UNLIKELY(space_id != space->id)) {
1330 fprintf(stderr,
1331@@ -105,7 +105,7 @@
1332 }
1333
1334 if (UNIV_UNLIKELY(space_id == ULINT_UNDEFINED
1335-@@ -794,8 +807,8 @@
1336+@@ -796,8 +809,8 @@
1337 }
1338
1339 if (size_bytes >= 1024 * 1024) {
1340@@ -116,7 +116,7 @@
1341 }
1342
1343 if (!(flags & DICT_TF_ZSSIZE_MASK)) {
1344-@@ -846,6 +859,8 @@
1345+@@ -848,6 +861,8 @@
1346 /* Put the node to the LRU list */
1347 UT_LIST_ADD_FIRST(LRU, system->LRU, node);
1348 }
1349@@ -125,7 +125,7 @@
1350 }
1351
1352 /**********************************************************************//**
1353-@@ -1474,7 +1489,12 @@
1354+@@ -1477,7 +1492,12 @@
1355 the file yet; the following calls will open it and update the
1356 size fields */
1357
1358@@ -139,7 +139,7 @@
1359 fil_node_complete_io(node, fil_system, OS_FILE_READ);
1360 }
1361
1362-@@ -1526,7 +1546,12 @@
1363+@@ -1529,7 +1549,12 @@
1364 the file yet; the following calls will open it and update the
1365 size fields */
1366
1367@@ -153,7 +153,7 @@
1368 fil_node_complete_io(node, fil_system, OS_FILE_READ);
1369 }
1370
1371-@@ -2202,7 +2227,7 @@
1372+@@ -2205,7 +2230,7 @@
1373 if (fil_create_new_single_table_tablespace(
1374 space_id, name, FALSE, flags,
1375 FIL_IBD_FILE_INITIAL_SIZE) != DB_SUCCESS) {
1376@@ -162,7 +162,7 @@
1377 }
1378 }
1379
1380-@@ -2369,7 +2394,7 @@
1381+@@ -2372,7 +2397,7 @@
1382 }
1383
1384 if (success) {
1385@@ -171,7 +171,7 @@
1386 /* Write a log record about the deletion of the .ibd
1387 file, so that ibbackup can replay it in the
1388 --apply-log phase. We use a dummy mtr and the familiar
1389-@@ -2670,7 +2695,7 @@
1390+@@ -2673,7 +2698,7 @@
1391
1392 mutex_exit(&fil_system->mutex);
1393
1394@@ -180,7 +180,7 @@
1395 if (success) {
1396 mtr_t mtr;
1397
1398-@@ -2861,7 +2886,7 @@
1399+@@ -2864,7 +2889,7 @@
1400
1401 fil_node_create(path, size, space_id, FALSE);
1402
1403@@ -189,7 +189,7 @@
1404 {
1405 mtr_t mtr;
1406
1407-@@ -3116,19 +3141,97 @@
1408+@@ -3210,19 +3235,97 @@
1409 "InnoDB: open the tablespace file ", stderr);
1410 ut_print_filename(stderr, filepath);
1411 fputs("!\n"
1412@@ -297,7 +297,7 @@
1413 return(FALSE);
1414 }
1415
1416-@@ -3836,7 +3939,7 @@
1417+@@ -4158,7 +4261,7 @@
1418 cannot be ok. */
1419
1420 size = (((ib_int64_t)size_high) << 32) + (ib_int64_t)size_low;
1421@@ -306,7 +306,7 @@
1422 if (size < FIL_IBD_FILE_INITIAL_SIZE * (lint)UNIV_PAGE_SIZE) {
1423 fprintf(stderr,
1424 "InnoDB: Error: the size of single-table tablespace"
1425-@@ -3977,7 +4080,7 @@
1426+@@ -4299,7 +4402,7 @@
1427 idea is to read as much good data as we can and jump over bad data.
1428 @return 0 if ok, -1 if error even after the retries, 1 if at the end
1429 of the directory */
1430@@ -315,7 +315,7 @@
1431 int
1432 fil_file_readdir_next_file(
1433 /*=======================*/
1434-@@ -4276,15 +4379,97 @@
1435+@@ -4598,15 +4701,97 @@
1436 "InnoDB: in InnoDB data dictionary"
1437 " has tablespace id %lu,\n"
1438 "InnoDB: but tablespace with that id"
1439@@ -421,7 +421,7 @@
1440 } else {
1441 ut_print_timestamp(stderr);
1442 fputs(" InnoDB: Error: table ", stderr);
1443-@@ -4683,7 +4868,7 @@
1444+@@ -5005,7 +5190,7 @@
1445 off the LRU list if it is in the LRU list. The caller must hold the fil_sys
1446 mutex. */
1447 static
1448@@ -430,7 +430,7 @@
1449 fil_node_prepare_for_io(
1450 /*====================*/
1451 fil_node_t* node, /*!< in: file node */
1452-@@ -4703,10 +4888,13 @@
1453+@@ -5025,10 +5210,13 @@
1454 }
1455
1456 if (node->open == FALSE) {
1457@@ -445,7 +445,7 @@
1458 }
1459
1460 if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE
1461-@@ -4719,6 +4907,8 @@
1462+@@ -5041,6 +5229,8 @@
1463 }
1464
1465 node->n_pending++;
1466@@ -454,7 +454,7 @@
1467 }
1468
1469 /********************************************************************//**
1470-@@ -4920,6 +5110,16 @@
1471+@@ -5240,6 +5430,16 @@
1472
1473 ut_ad((mode != OS_AIO_IBUF) || (space->purpose == FIL_TABLESPACE));
1474
1475@@ -473,7 +473,7 @@
1476 for (;;) {
1477 --- a/storage/innobase/handler/ha_innodb.cc
1478 +++ b/storage/innobase/handler/ha_innodb.cc
1479-@@ -460,13 +460,6 @@
1480+@@ -482,12 +482,6 @@
1481 "Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout.",
1482 NULL, NULL, 50, 1, 1024 * 1024 * 1024, 0);
1483
1484@@ -483,15 +483,13 @@
1485 - " or 2 (write at commit, flush once per second).",
1486 - NULL, NULL, 1, 0, 2, 0);
1487 -
1488--
1489- static handler *innobase_create_handler(handlerton *hton,
1490- TABLE_SHARE *table,
1491- MEM_ROOT *mem_root)
1492-@@ -958,17 +951,6 @@
1493- }
1494+ static MYSQL_THDVAR_BOOL(fake_changes, PLUGIN_VAR_OPCMDARG,
1495+ "In the transaction after enabled, UPDATE, INSERT and DELETE only move the cursor to the records "
1496+ "and do nothing other operations (no changes, no ibuf, no undo, no transaction log) in the transaction. "
1497+@@ -989,17 +983,6 @@
1498 }
1499
1500--/******************************************************************//**
1501+ /******************************************************************//**
1502 -*/
1503 -extern "C" UNIV_INTERN
1504 -ulong
1505@@ -502,14 +500,14 @@
1506 - return(THDVAR((THD*) thd, flush_log_at_trx_commit));
1507 -}
1508 -
1509- /********************************************************************//**
1510- Obtain the InnoDB transaction of a MySQL thread.
1511- @return reference to transaction pointer */
1512-@@ -11595,18 +11577,12 @@
1513- innodb_file_format_max_validate,
1514+-/******************************************************************//**
1515+ Returns true if expand_fast_index_creation is enabled for the current
1516+ session.
1517+ @return the value of the server's expand_fast_index_creation variable */
1518+@@ -11806,17 +11789,12 @@
1519 innodb_file_format_max_update, "Antelope");
1520
1521--/* Changed to the THDVAR */
1522+ /* Changed to the THDVAR */
1523 -//static MYSQL_SYSVAR_ULONG(flush_log_at_trx_commit, srv_flush_log_at_trx_commit,
1524 -// PLUGIN_VAR_OPCMDARG,
1525 -// "Set to 0 (write and flush once per second),"
1526@@ -522,25 +520,25 @@
1527 - "Use global innodb_flush_log_at_trx_commit value. (default: ON).",
1528 - NULL, NULL, TRUE);
1529 +static MYSQL_SYSVAR_ULONG(flush_log_at_trx_commit, srv_flush_log_at_trx_commit,
1530-+ PLUGIN_VAR_OPCMDARG,
1531-+ "Set to 0 (write and flush once per second),"
1532-+ " 1 (write and flush at each commit)"
1533-+ " or 2 (write at commit, flush once per second).",
1534-+ NULL, NULL, 1, 0, 2, 0);
1535++ PLUGIN_VAR_OPCMDARG,
1536++ "Set to 0 (write and flush once per second),"
1537++ " 1 (write and flush at each commit)"
1538++ " or 2 (write at commit, flush once per second).",
1539++ NULL, NULL, 1, 0, 2, 0);
1540
1541 static MYSQL_SYSVAR_STR(flush_method, innobase_file_flush_method,
1542 PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
1543-@@ -12073,7 +12049,6 @@
1544+@@ -12294,7 +12272,6 @@
1545 MYSQL_SYSVAR(file_format_check),
1546 MYSQL_SYSVAR(file_format_max),
1547 MYSQL_SYSVAR(flush_log_at_trx_commit),
1548 - MYSQL_SYSVAR(use_global_flush_log_at_trx_commit),
1549 MYSQL_SYSVAR(flush_method),
1550 MYSQL_SYSVAR(force_recovery),
1551- MYSQL_SYSVAR(locks_unsafe_for_binlog),
1552+ MYSQL_SYSVAR(large_prefix),
1553 --- a/storage/innobase/ibuf/ibuf0ibuf.c
1554 +++ b/storage/innobase/ibuf/ibuf0ibuf.c
1555-@@ -1202,6 +1202,9 @@
1556+@@ -1190,6 +1190,9 @@
1557 ut_ad(!recv_no_ibuf_operations);
1558 ut_ad(x_latch || mtr == NULL);
1559
1560@@ -550,7 +548,7 @@
1561 if (ibuf_fixed_addr_page(space, zip_size, page_no)) {
1562
1563 return(TRUE);
1564-@@ -2733,6 +2736,9 @@
1565+@@ -2757,6 +2760,9 @@
1566 ulint n_bytes;
1567 ulint n_pag2;
1568
1569@@ -562,7 +560,7 @@
1570
1571 --- a/storage/innobase/include/ha_prototypes.h
1572 +++ b/storage/innobase/include/ha_prototypes.h
1573-@@ -275,12 +275,5 @@
1574+@@ -284,13 +284,6 @@
1575 /*===================*/
1576 void* thd, /*!< in: thread handle (THD*) */
1577 ulint value); /*!< in: time waited for the lock */
1578@@ -574,10 +572,11 @@
1579 -/*================================*/
1580 - void* thd);
1581
1582- #endif
1583+ /**********************************************************************//**
1584+ Get the current setting of the lower_case_table_names global parameter from
1585 --- a/storage/innobase/include/srv0srv.h
1586 +++ b/storage/innobase/include/srv0srv.h
1587-@@ -148,8 +148,7 @@
1588+@@ -145,8 +145,7 @@
1589 extern ulint srv_n_log_files;
1590 extern ulint srv_log_file_size;
1591 extern ulint srv_log_buffer_size;
1592@@ -587,7 +586,7 @@
1593 extern char srv_adaptive_flushing;
1594
1595
1596-@@ -253,6 +252,10 @@
1597+@@ -247,6 +246,10 @@
1598 extern ulint srv_dict_size_limit;
1599
1600 extern ulint srv_lazy_drop_table;
1601@@ -618,7 +617,7 @@
1602 - && thd_flush_log_at_trx_commit(NULL) != 2) {
1603 + && srv_flush_log_at_trx_commit != 2) {
1604
1605- fil_flush(group->space_id);
1606+ fil_flush(group->space_id, FALSE);
1607 }
1608 @@ -1389,7 +1389,7 @@
1609 #endif /* UNIV_DEBUG */
1610@@ -630,21 +629,23 @@
1611 allowed yet (the variable name .._no_ibuf_.. is misleading) */
1612
1613 @@ -3151,6 +3151,7 @@
1614- for the 'very fast' shutdown, because the InnoDB layer may have
1615- committed or prepared transactions and we don't want to lose them. */
1616+ shutdown, because the InnoDB layer may have committed or
1617+ prepared transactions and we don't want to lose them. */
1618
1619 + if (!srv_apply_log_only) {
1620- if (trx_n_mysql_transactions > 0
1621- || UT_LIST_GET_LEN(trx_sys->trx_list) > 0) {
1622-
1623-@@ -3158,6 +3159,7 @@
1624-
1625+ server_busy = trx_n_mysql_transactions > 0
1626+ || UT_LIST_GET_LEN(trx_sys->trx_list) > trx_n_prepared;
1627+ mutex_exit(&kernel_mutex);
1628+@@ -3158,6 +3159,9 @@
1629+ if (server_busy || srv_is_any_background_thread_active()) {
1630 goto loop;
1631 }
1632++ } else {
1633++ mutex_exit(&kernel_mutex);
1634 + }
1635
1636- if (srv_fast_shutdown == 2) {
1637- /* In this fastest shutdown we do not flush the buffer pool:
1638+ mutex_enter(&log_sys->mutex);
1639+ server_busy = log_sys->n_pending_checkpoint_writes
1640 --- a/storage/innobase/log/log0recv.c
1641 +++ b/storage/innobase/log/log0recv.c
1642 @@ -42,27 +42,27 @@
1643@@ -738,7 +739,7 @@
1644 }
1645 }
1646
1647-@@ -2936,12 +2939,14 @@
1648+@@ -2935,12 +2938,14 @@
1649
1650 if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) {
1651
1652@@ -754,7 +755,7 @@
1653 }
1654 }
1655
1656-@@ -3110,6 +3115,7 @@
1657+@@ -3109,6 +3114,7 @@
1658 recv_sys->recovered_lsn = checkpoint_lsn;
1659
1660 srv_start_lsn = checkpoint_lsn;
1661@@ -762,7 +763,7 @@
1662 }
1663
1664 contiguous_lsn = ut_uint64_align_down(recv_sys->scanned_lsn,
1665-@@ -3475,6 +3481,7 @@
1666+@@ -3474,6 +3480,7 @@
1667 that the data dictionary tables will be free of any locks.
1668 The data dictionary latch should guarantee that there is at
1669 most one data dictionary transaction active at a time. */
1670@@ -823,7 +824,7 @@
1671 } else if (create_mode == OS_FILE_CREATE) {
1672 mode_str = "CREATE";
1673 create_flag = O_RDWR | O_CREAT | O_EXCL;
1674-@@ -2732,6 +2737,9 @@
1675+@@ -2791,6 +2796,9 @@
1676 ut_a((offset & 0xFFFFFFFFUL) == offset);
1677 ut_a((n & 0xFFFFFFFFUL) == n);
1678
1679@@ -833,7 +834,7 @@
1680 os_n_file_writes++;
1681
1682 ut_ad(file);
1683-@@ -2856,6 +2864,9 @@
1684+@@ -2915,6 +2923,9 @@
1685 #else
1686 ssize_t ret;
1687
1688@@ -845,7 +846,7 @@
1689 if ((ulint)ret == n) {
1690 --- a/storage/innobase/os/os0thread.c
1691 +++ b/storage/innobase/os/os0thread.c
1692-@@ -266,12 +266,17 @@
1693+@@ -251,11 +251,16 @@
1694 #ifdef __WIN__
1695 Sleep((DWORD) tm / 1000);
1696 #else
1697@@ -862,10 +863,9 @@
1698 +*/
1699 #endif
1700 }
1701-
1702 --- a/storage/innobase/row/row0merge.c
1703 +++ b/storage/innobase/row/row0merge.c
1704-@@ -459,7 +459,9 @@
1705+@@ -460,7 +460,9 @@
1706 rec = rec_convert_dtuple_to_rec(*buf, index, tuple, n_ext);
1707 offsets = rec_get_offsets(rec, index, NULL, ULINT_UNDEFINED, &heap);
1708
1709@@ -876,7 +876,7 @@
1710
1711 mem_heap_free(heap);
1712 }
1713-@@ -1485,8 +1487,10 @@
1714+@@ -1486,8 +1488,10 @@
1715 case 0:
1716 if (UNIV_UNLIKELY
1717 (dict_index_is_unique(index) && !null_eq)) {
1718@@ -889,7 +889,7 @@
1719 mem_heap_free(heap);
1720 return(DB_DUPLICATE_KEY);
1721 }
1722-@@ -2613,7 +2617,9 @@
1723+@@ -2636,7 +2640,9 @@
1724
1725 /* Reset the MySQL row buffer that is used when reporting
1726 duplicate keys. */
1727@@ -902,7 +902,19 @@
1728 secondary index entries for merge sort */
1729 --- a/storage/innobase/srv/srv0srv.c
1730 +++ b/storage/innobase/srv/srv0srv.c
1731-@@ -197,8 +197,7 @@
1732+@@ -87,11 +87,6 @@
1733+ #include "mysql/plugin.h"
1734+ #include "mysql/service_thd_wait.h"
1735+
1736+-/* prototypes of new functions added to ha_innodb.cc for kill_idle_transaction */
1737+-ibool innobase_thd_is_idle(const void* thd);
1738+-ib_int64_t innobase_thd_get_start_time(const void* thd);
1739+-void innobase_thd_kill(void* thd);
1740+-
1741+ /* prototypes for new functions added to ha_innodb.cc */
1742+ ibool innobase_get_slow_log();
1743+
1744+@@ -198,8 +193,7 @@
1745 UNIV_INTERN ulint srv_log_file_size = ULINT_MAX;
1746 /* size in database pages */
1747 UNIV_INTERN ulint srv_log_buffer_size = ULINT_MAX;
1748@@ -912,7 +924,7 @@
1749
1750 /* Try to flush dirty pages so as to avoid IO bursts at
1751 the checkpoints. */
1752-@@ -449,6 +448,10 @@
1753+@@ -457,6 +451,10 @@
1754 UNIV_INTERN ulint srv_dict_size_limit = 0;
1755
1756 UNIV_INTERN ulint srv_lazy_drop_table = 0;
1757@@ -923,7 +935,7 @@
1758 /*-------------------------------------------*/
1759 UNIV_INTERN ulong srv_n_spin_wait_rounds = 30;
1760 UNIV_INTERN ulong srv_n_free_tickets_to_enter = 500;
1761-@@ -1148,7 +1151,7 @@
1762+@@ -1137,7 +1135,7 @@
1763 }
1764
1765 /* Initialize some INFORMATION SCHEMA internal structures */
1766@@ -932,7 +944,7 @@
1767 }
1768
1769 /*********************************************************************//**
1770-@@ -1159,6 +1162,7 @@
1771+@@ -1148,6 +1146,7 @@
1772 /*==========*/
1773 {
1774 os_fast_mutex_free(&srv_conc_mutex);
1775@@ -940,7 +952,7 @@
1776 mem_free(srv_conc_slots);
1777 srv_conc_slots = NULL;
1778
1779-@@ -1172,6 +1176,7 @@
1780+@@ -1161,6 +1160,7 @@
1781 srv_mysql_table = NULL;
1782
1783 trx_i_s_cache_free(trx_i_s_cache);
1784@@ -948,7 +960,7 @@
1785 }
1786
1787 /*********************************************************************//**
1788-@@ -1876,7 +1881,7 @@
1789+@@ -1886,7 +1886,7 @@
1790 }
1791
1792 /* Record the lock wait time for this thread */
1793@@ -957,6 +969,43 @@
1794 }
1795
1796 if (trx->was_chosen_as_deadlock_victim) {
1797+@@ -2842,36 +2842,6 @@
1798+ old_sema = sema;
1799+ }
1800+
1801+- if (srv_kill_idle_transaction && trx_sys) {
1802+- trx_t* trx;
1803+- time_t now;
1804+-rescan_idle:
1805+- now = time(NULL);
1806+- mutex_enter(&kernel_mutex);
1807+- trx = UT_LIST_GET_FIRST(trx_sys->mysql_trx_list);
1808+- while (trx) {
1809+- if (trx->conc_state == TRX_ACTIVE
1810+- && trx->mysql_thd
1811+- && innobase_thd_is_idle(trx->mysql_thd)) {
1812+- ib_int64_t start_time; /* as stmt ID */
1813+-
1814+- start_time = innobase_thd_get_start_time(trx->mysql_thd);
1815+- if (trx->last_stmt_start != start_time) {
1816+- trx->idle_start = now;
1817+- trx->last_stmt_start = start_time;
1818+- } else if (difftime(now, trx->idle_start)
1819+- > srv_kill_idle_transaction) {
1820+- /* kill the session */
1821+- mutex_exit(&kernel_mutex);
1822+- innobase_thd_kill(trx->mysql_thd);
1823+- goto rescan_idle;
1824+- }
1825+- }
1826+- trx = UT_LIST_GET_NEXT(mysql_trx_list, trx);
1827+- }
1828+- mutex_exit(&kernel_mutex);
1829+- }
1830+-
1831+ /* Flush stderr so that a database user gets the output
1832+ to possible MySQL error file */
1833+
1834 --- a/storage/innobase/srv/srv0start.c
1835 +++ b/storage/innobase/srv/srv0start.c
1836 @@ -94,6 +94,8 @@
1837@@ -986,7 +1035,7 @@
1838 ulint
1839 open_or_create_data_files(
1840 /*======================*/
1841-@@ -1868,6 +1870,10 @@
1842+@@ -1875,6 +1877,10 @@
1843 are initialized in trx_sys_init_at_db_start(). */
1844
1845 recv_recovery_from_checkpoint_finish();
1846@@ -997,7 +1046,7 @@
1847 if (srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE) {
1848 /* The following call is necessary for the insert
1849 buffer to work with multiple tablespaces. We must
1850-@@ -2042,6 +2048,17 @@
1851+@@ -2054,6 +2060,17 @@
1852 if (!srv_auto_extend_last_data_file
1853 && sum_of_data_file_sizes != tablespace_size_in_header) {
1854
1855@@ -1015,7 +1064,7 @@
1856 ut_print_timestamp(stderr);
1857 fprintf(stderr,
1858 " InnoDB: Error: tablespace size"
1859-@@ -2121,6 +2138,7 @@
1860+@@ -2133,6 +2150,7 @@
1861
1862 return(DB_ERROR);
1863 }
1864@@ -1023,7 +1072,7 @@
1865 }
1866
1867 /* Check that os_fast_mutexes work as expected */
1868-@@ -2240,6 +2258,7 @@
1869+@@ -2252,6 +2270,7 @@
1870 ibuf_update_max_tablespace_id();
1871 }
1872
1873@@ -1033,16 +1082,16 @@
1874 srv_was_started = TRUE;
1875 --- a/storage/innobase/trx/trx0purge.c
1876 +++ b/storage/innobase/trx/trx0purge.c
1877-@@ -1100,6 +1100,9 @@
1878- /* que_thr_t* thr2; */
1879+@@ -1129,6 +1129,9 @@
1880+ que_thr_t* thr;
1881 ulint old_pages_handled;
1882
1883 + if (srv_fake_write)
1884 + return(0);
1885 +
1886- mutex_enter(&(purge_sys->mutex));
1887+ ut_a(purge_sys->trx->n_active_thrs == 0);
1888
1889- if (purge_sys->trx->n_active_thrs > 0) {
1890+ rw_lock_x_lock(&purge_sys->latch);
1891 --- a/storage/innobase/trx/trx0rseg.c
1892 +++ b/storage/innobase/trx/trx0rseg.c
1893 @@ -140,9 +140,11 @@
1894@@ -1059,7 +1108,7 @@
1895
1896 --- a/storage/innobase/trx/trx0sys.c
1897 +++ b/storage/innobase/trx/trx0sys.c
1898-@@ -1938,10 +1938,12 @@
1899+@@ -1983,10 +1983,12 @@
1900 UT_LIST_REMOVE(view_list, trx_sys->view_list, prev_view);
1901 }
1902
1903@@ -1074,18 +1123,19 @@
1904
1905 --- a/storage/innobase/trx/trx0trx.c
1906 +++ b/storage/innobase/trx/trx0trx.c
1907-@@ -505,8 +505,8 @@
1908+@@ -563,9 +563,8 @@
1909 (ullint) trx->id);
1910
1911 if (srv_force_recovery == 0) {
1912 -
1913 - trx->conc_state = TRX_PREPARED;
1914+- trx_n_prepared++;
1915 + /* xtrabackup should rollback it */
1916 + trx->conc_state = TRX_ACTIVE;
1917 } else {
1918 fprintf(stderr,
1919 "InnoDB: Since"
1920-@@ -580,9 +580,9 @@
1921+@@ -639,10 +638,9 @@
1922 (ullint) trx->id);
1923
1924 if (srv_force_recovery == 0) {
1925@@ -1093,11 +1143,12 @@
1926 + /* xtrabackup should rollback it */
1927 trx->conc_state
1928 - = TRX_PREPARED;
1929+- trx_n_prepared++;
1930 + = TRX_ACTIVE;
1931 } else {
1932 fprintf(stderr,
1933 "InnoDB: Since"
1934-@@ -925,7 +925,6 @@
1935+@@ -1051,7 +1049,6 @@
1936 trx->read_view = NULL;
1937
1938 if (lsn) {
1939@@ -1105,7 +1156,7 @@
1940
1941 mutex_exit(&kernel_mutex);
1942
1943-@@ -934,12 +933,6 @@
1944+@@ -1060,12 +1057,6 @@
1945 trx_undo_insert_cleanup(trx);
1946 }
1947
1948@@ -1118,7 +1169,7 @@
1949 /* NOTE that we could possibly make a group commit more
1950 efficient here: call os_thread_yield here to allow also other
1951 trxs to come to commit! */
1952-@@ -971,9 +964,9 @@
1953+@@ -1097,9 +1088,9 @@
1954 if (trx->flush_log_later) {
1955 /* Do nothing yet */
1956 trx->must_flush_log_later = TRUE;
1957@@ -1130,7 +1181,7 @@
1958 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {
1959 /* Write the log but do not flush it to disk */
1960
1961-@@ -985,7 +978,7 @@
1962+@@ -1111,7 +1102,7 @@
1963
1964 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);
1965 }
1966@@ -1139,7 +1190,7 @@
1967
1968 /* Write the log but do not flush it to disk */
1969
1970-@@ -1665,23 +1658,16 @@
1971+@@ -1791,23 +1782,16 @@
1972 trx_t* trx) /*!< in: trx handle */
1973 {
1974 ib_uint64_t lsn = trx->commit_lsn;
1975@@ -1165,7 +1216,7 @@
1976 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {
1977 /* Write the log but do not flush it to disk */
1978
1979-@@ -1692,7 +1678,7 @@
1980+@@ -1818,7 +1802,7 @@
1981
1982 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);
1983 }
1984@@ -1174,7 +1225,7 @@
1985
1986 /* Write the log but do not flush it to disk */
1987
1988-@@ -1945,7 +1931,6 @@
1989+@@ -2066,7 +2050,6 @@
1990 /*--------------------------------------*/
1991
1992 if (lsn) {
1993@@ -1182,7 +1233,7 @@
1994
1995 /* Depending on the my.cnf options, we may now write the log
1996 buffer to the log files, making the prepared state of the
1997-@@ -1966,15 +1951,9 @@
1998+@@ -2087,15 +2070,9 @@
1999
2000 mutex_exit(&kernel_mutex);
2001
2002@@ -1200,7 +1251,7 @@
2003 if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {
2004 /* Write the log but do not flush it to disk */
2005
2006-@@ -1986,7 +1965,7 @@
2007+@@ -2107,7 +2084,7 @@
2008
2009 log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);
2010 }
2011
2012=== modified file 'utils/build.sh'
2013--- utils/build.sh 2011-10-05 02:29:27 +0000
2014+++ utils/build.sh 2011-11-27 06:47:26 +0000
2015@@ -1,7 +1,9 @@
2016 #!/usr/bin/env bash
2017
2018-MYSQL_51_VERSION=5.1.56
2019-MYSQL_55_VERSION=5.5.10
2020+MYSQL_51_VERSION=5.1.59
2021+MYSQL_55_VERSION=5.5.17
2022+PS_51_VERSION=5.1.59-13.0
2023+PS_55_VERSION=5.5.16-22.0
2024
2025 AUTO_DOWNLOAD=${AUTO_DOWNLOAD:-no}
2026 MASTER_SITE="http://s3.amazonaws.com/percona.com/downloads/community"
2027@@ -216,13 +218,15 @@
2028 cd $branch_dir
2029 bzr pull
2030 else
2031- bzr branch lp:~percona-dev/percona-server/$branch_dir $branch_dir
2032+ bzr branch -r tag:Percona-Server-$PS_51_VERSION \
2033+ lp:percona-server/5.1 $branch_dir
2034 cd $branch_dir
2035 fi
2036
2037 $MAKE_CMD main
2038+ cd $top_dir
2039 rm -rf $server_dir
2040- mv Percona-Server $top_dir
2041+ ln -s $branch_dir/Percona-Server $server_dir
2042
2043 # Patch Percona Server
2044 cd $server_dir
2045@@ -264,13 +268,15 @@
2046 cd $branch_dir
2047 bzr pull
2048 else
2049- bzr branch lp:~percona-dev/percona-server/$branch_dir $branch_dir
2050+ bzr branch -r tag:Percona-Server-$PS_55_VERSION \
2051+ lp:percona-server $branch_dir
2052 cd $branch_dir
2053 fi
2054
2055 $MAKE_CMD PERCONA_SERVER=Percona-Server-5.5 main
2056+ cd $top_dir
2057 rm -rf $server_dir
2058- mv Percona-Server-5.5 $top_dir
2059+ ln -s $branch_dir/Percona-Server $server_dir
2060
2061 # Patch Percona Server
2062 cd $server_dir
2063
2064=== modified file 'xtrabackup.c'
2065--- xtrabackup.c 2011-10-05 02:29:27 +0000
2066+++ xtrabackup.c 2011-11-27 06:47:26 +0000
2067@@ -135,7 +135,7 @@
2068 #include <mysql/plugin.h>
2069 #include <mysql/service_thd_wait.h>
2070
2071-void thd_wait_begin(MYSQL_THD thd, thd_wait_type wait_type)
2072+void thd_wait_begin(MYSQL_THD thd, int wait_type)
2073 {
2074 (void)thd;
2075 (void)wait_type;
2076@@ -251,6 +251,15 @@
2077 a file, so this is either "open" or
2078 "create" */
2079
2080+/***********************************************************************//**
2081+Compatibility wrapper around os_file_flush().
2082+@return TRUE if success */
2083+static
2084+ibool
2085+xb_file_flush(
2086+/*==========*/
2087+ os_file_t file); /*!< in, own: handle to a file */
2088+
2089 #include <fcntl.h>
2090 #include <regex.h>
2091
2092@@ -510,7 +519,7 @@
2093 struct fil_system_struct {
2094 #ifndef UNIV_HOTBACKUP
2095 mutex_t mutex; /*!< The mutex protecting the cache */
2096-#ifdef XTRADB55
2097+#ifdef XTRADB_BASED
2098 mutex_t file_extend_mutex;
2099 #endif
2100 #endif /* !UNIV_HOTBACKUP */
2101@@ -557,6 +566,10 @@
2102 request */
2103 UT_LIST_BASE_NODE_T(fil_space_t) space_list;
2104 /*!< list of all file spaces */
2105+ ibool space_id_reuse_warned;
2106+ /* !< TRUE if fil_space_create()
2107+ has issued a warning about
2108+ potential space_id reuse */
2109 };
2110
2111 #endif /* INNODB_VERSION_SHORT */
2112@@ -1520,6 +1533,31 @@
2113 putc(q, f);
2114 }
2115
2116+/**********************************************************************//**
2117+It should be safe to use lower_case_table_names=0 for xtrabackup. If it causes
2118+any problems, we can add the lower_case_table_names option to xtrabackup
2119+later.
2120+@return 0 */
2121+ulint
2122+innobase_get_lower_case_table_names(void)
2123+/*=====================================*/
2124+{
2125+ return(0);
2126+}
2127+
2128+/******************************************************************//**
2129+Strip dir name from a full path name and return only the file name
2130+@return file name or "null" if no file name */
2131+const char*
2132+innobase_basename(
2133+/*==============*/
2134+ const char* path_name) /*!< in: full path name */
2135+{
2136+ const char* name = base_name(path_name);
2137+
2138+ return((name) ? name : "null");
2139+}
2140+
2141 /*****************************************************************//**
2142 Convert an SQL identifier to the MySQL system_charset_info (UTF-8)
2143 and quote it if needed.
2144@@ -1856,6 +1894,22 @@
2145 #endif
2146 #endif
2147
2148+/***********************************************************************//**
2149+Compatibility wrapper around os_file_flush().
2150+@return TRUE if success */
2151+static
2152+ibool
2153+xb_file_flush(
2154+/*==========*/
2155+ os_file_t file) /*!< in, own: handle to a file */
2156+{
2157+#ifdef XTRADB_BASED
2158+ return os_file_flush(file, TRUE);
2159+#else
2160+ return os_file_flush(file);
2161+#endif
2162+}
2163+
2164 /***********************************************************************
2165 Computes bit shift for a given value. If the argument is not a power
2166 of 2, returns 0.*/
2167@@ -2925,7 +2979,7 @@
2168 }
2169 }
2170
2171- success = os_file_flush(dst_file);
2172+ success = xb_file_flush(dst_file);
2173 if (!success) {
2174 goto error;
2175 }
2176@@ -3237,7 +3291,7 @@
2177
2178
2179 if (!xtrabackup_stream) {
2180- success = os_file_flush(dst_log);
2181+ success = xb_file_flush(dst_log);
2182 } else {
2183 fflush(stdout);
2184 success = TRUE;
2185@@ -4270,7 +4324,11 @@
2186 #ifndef INNODB_VERSION_SHORT
2187 local_page = buf_page_get(space_id, page_no, RW_S_LATCH, &local_mtr);
2188 #else
2189+#if (MYSQL_VERSION_ID < 50517)
2190 local_block = btr_block_get(space_id, zip_size, page_no, RW_S_LATCH, &local_mtr);
2191+#else
2192+ local_block = btr_block_get(space_id, zip_size, page_no, RW_S_LATCH, index, &local_mtr);
2193+#endif
2194 local_page = buf_block_get_frame(local_block);
2195 #endif
2196 blob_header = local_page + offset;
2197@@ -4315,7 +4373,13 @@
2198 #ifndef INNODB_VERSION_SHORT
2199 page = btr_page_get(space, right_page_no, RW_X_LATCH, &mtr);
2200 #else
2201- block = btr_block_get(space, zip_size, right_page_no, RW_X_LATCH, &mtr);
2202+#if (MYSQL_VERSION_ID < 50517)
2203+ block = btr_block_get(space, zip_size, right_page_no,
2204+ RW_X_LATCH, &mtr);
2205+#else
2206+ block = btr_block_get(space, zip_size, right_page_no,
2207+ RW_X_LATCH, index, &mtr);
2208+#endif
2209 page = buf_block_get_frame(block);
2210 #endif
2211 goto loop;
2212@@ -5771,7 +5835,7 @@
2213 os_file_get_last_error(TRUE);
2214 goto next_node;
2215 }
2216- success = os_file_flush(info_file);
2217+ success = xb_file_flush(info_file);
2218 if (!success) {
2219 os_file_get_last_error(TRUE);
2220 goto next_node;

Subscribers

People subscribed via source and target branches