~akopytov/percona-xtrabackup/bug1175566-2.1

« back to all changes in this revision

Viewing changes to patches/xtradb51.patch

  • Committer: Alexey Kopytov
  • Date: 2013-04-27 12:15:56 UTC
  • mfrom: (534.10.1 2.1-bug1130145)
  • Revision ID: akopytov@gmail.com-20130427121556-v412i9uk08ntn1pg
Manual merge of lp:~sergei.glushchenko/percona-xtrabackup/2.1-bug1130145.

Show diffs side-by-side

added added

removed removed

Lines of Context:
366
366
 int
367
367
 fil_file_readdir_next_file(
368
368
 /*=======================*/
 
369
@@ -4291,7 +4393,7 @@
 
370
 @return        DB_SUCCESS or error number */
 
371
 UNIV_INTERN
 
372
 ulint
 
373
-fil_load_single_table_tablespaces(void)
 
374
+fil_load_single_table_tablespaces(ibool (*pred)(const char*, const char*))
 
375
 /*===================================*/
 
376
 {
 
377
        int             ret;
369
378
@@ -4347,7 +4449,9 @@
370
379
                        dbinfo.name);
371
380
                srv_normalize_path_for_win(dbpath);
377
386
 
378
387
                if (dbdir != NULL) {
379
388
                        /* printf("Opened dir %s\n", dbinfo.name); */
380
 
@@ -4546,15 +4650,97 @@
 
389
@@ -4373,8 +4477,11 @@
 
390
                                                   ".ibd")) {
 
391
                                        /* The name ends in .ibd; try opening
 
392
                                        the file */
 
393
-                                       fil_load_single_table_tablespace(
 
394
+                                       if (!pred ||
 
395
+                                           pred(dbinfo.name, fileinfo.name)) {
 
396
+                                               fil_load_single_table_tablespace(
 
397
                                                dbinfo.name, fileinfo.name);
 
398
+                                       }
 
399
                                }
 
400
 next_file_item:
 
401
                                ret = fil_file_readdir_next_file(&err,
 
402
@@ -4546,15 +4653,97 @@
381
403
                                "InnoDB: in InnoDB data dictionary"
382
404
                                " has tablespace id %lu,\n"
383
405
                                "InnoDB: but tablespace with that id"
483
505
                } else {
484
506
                        ut_print_timestamp(stderr);
485
507
                        fputs("  InnoDB: Error: table ", stderr);
486
 
@@ -4953,7 +5139,7 @@
 
508
@@ -4953,7 +5142,7 @@
487
509
 off the LRU list if it is in the LRU list. The caller must hold the fil_sys
488
510
 mutex. */
489
511
 static
492
514
 fil_node_prepare_for_io(
493
515
 /*====================*/
494
516
        fil_node_t*     node,   /*!< in: file node */
495
 
@@ -4973,10 +5159,13 @@
 
517
@@ -4973,10 +5162,13 @@
496
518
        }
497
519
 
498
520
        if (node->open == FALSE) {
507
529
        }
508
530
 
509
531
        if (node->n_pending == 0 && space->purpose == FIL_TABLESPACE
510
 
@@ -4989,6 +5178,8 @@
 
532
@@ -4989,6 +5181,8 @@
511
533
        }
512
534
 
513
535
        node->n_pending++;
516
538
 }
517
539
 
518
540
 /********************************************************************//**
519
 
@@ -5125,7 +5316,9 @@
 
541
@@ -5125,7 +5319,9 @@
520
542
        ut_ad(recv_no_ibuf_operations || (type == OS_FILE_WRITE)
521
543
              || !ibuf_bitmap_page(zip_size, block_offset)
522
544
              || sync || is_log);
527
549
              || ibuf_page(space_id, zip_size, block_offset, NULL));
528
550
 # endif /* UNIV_LOG_DEBUG */
529
551
        if (sync) {
530
 
@@ -5190,6 +5383,16 @@
 
552
@@ -5190,6 +5386,16 @@
531
553
 
532
554
        ut_ad((mode != OS_AIO_IBUF) || (space->purpose == FIL_TABLESPACE));
533
555
 
607
629
        while (sum_pages < n_pages) {
608
630
                n_bytes = ibuf_contract_ext(&n_pag2, sync);
609
631
 
 
632
--- a/storage/innodb_plugin/include/fil0fil.h
 
633
+++ b/storage/innodb_plugin/include/fil0fil.h
 
634
@@ -505,7 +505,7 @@
 
635
 @return        DB_SUCCESS or error number */
 
636
 UNIV_INTERN
 
637
 ulint
 
638
-fil_load_single_table_tablespaces(void);
 
639
+fil_load_single_table_tablespaces(ibool (*pred)(const char*, const char*));
 
640
 /*===================================*/
 
641
 /*******************************************************************//**
 
642
 Returns TRUE if a single-table tablespace does not exist in the memory cache,
610
643
--- a/storage/innodb_plugin/include/ha_prototypes.h
611
644
+++ b/storage/innodb_plugin/include/ha_prototypes.h
612
645
@@ -269,14 +269,6 @@
875
908
                }
876
909
        }
877
910
 
 
911
@@ -2913,7 +2916,7 @@
 
912
                "InnoDB: Reading tablespace information"
 
913
                " from the .ibd files...\n");
 
914
 
 
915
-       fil_load_single_table_tablespaces();
 
916
+       fil_load_single_table_tablespaces(NULL);
 
917
 
 
918
        /* If we are using the doublewrite method, we will
 
919
        check if there are half-written pages in data files,
878
920
@@ -2922,12 +2933,14 @@
879
921
 
880
922
        if (srv_force_recovery < SRV_FORCE_NO_LOG_REDO) {
1121
1163
 
1122
1164
        if (srv_auto_extend_last_data_file
1123
1165
            && sum_of_data_file_sizes < tablespace_size_in_header) {
 
1166
-
1124
1167
+               /* extend table space size aligning with header */
1125
1168
+               ulint   actual_size;
1126
1169
+               fil_extend_space_to_desired_size(&actual_size, 0, tablespace_size_in_header);
1131
1174
+                               (ulong) actual_size,
1132
1175
+                               (ulong) tablespace_size_in_header);
1133
1176
+               }
1134
 
 
 
1177
+
1135
1178
+#ifdef UNDEFINED
1136
1179
                fprintf(stderr,
1137
1180
                        "InnoDB: Error: tablespace size stored in header"