~longbow/percona-server/test_730173_5.5

« back to all changes in this revision

Viewing changes to patches/innodb_pass_corrupt_table.patch

  • Committer: Stewart Smith
  • Date: 2011-11-17 00:21:45 UTC
  • mfrom: (190.2.9 merge)
  • Revision ID: stewart@flamingspork.com-20111117002145-6180fuj12147yk9i
merge 5.5.17 port

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
# should be done or reviewed by the maintainer!
8
8
--- a/storage/innobase/btr/btr0btr.c
9
9
+++ b/storage/innobase/btr/btr0btr.c
10
 
@@ -691,6 +691,12 @@
11
 
        root_page_no = dict_index_get_page(index);
 
10
@@ -692,6 +692,12 @@
12
11
 
13
 
        block = btr_block_get(space, zip_size, root_page_no, RW_X_LATCH, mtr);
 
12
        block = btr_block_get(space, zip_size, root_page_no, RW_X_LATCH,
 
13
                              index, mtr);
14
14
+
15
15
+       if (srv_pass_corrupt_table && !block) {
16
16
+               return(0);
20
20
        ut_a((ibool)!!page_is_comp(buf_block_get_frame(block))
21
21
             == dict_table_is_comp(index->table));
22
22
 #ifdef UNIV_BTR_DEBUG
23
 
@@ -977,6 +983,12 @@
 
23
@@ -978,6 +984,12 @@
24
24
 
25
25
        root = btr_root_get(index, &mtr);
26
26
 
33
33
        if (flag == BTR_N_LEAF_PAGES) {
34
34
                seg_header = root + PAGE_HEADER + PAGE_BTR_SEG_LEAF;
35
35
 
36
 
@@ -1433,6 +1445,13 @@
37
 
        mtr_start(&mtr);
 
36
@@ -1437,6 +1449,13 @@
38
37
 
39
 
        root = btr_page_get(space, zip_size, root_page_no, RW_X_LATCH, &mtr);
 
38
        root = btr_page_get(space, zip_size, root_page_no, RW_X_LATCH,
 
39
                            NULL, &mtr);
40
40
+
41
41
+       if (srv_pass_corrupt_table && !root) {
42
42
+               mtr_commit(&mtr);
43
43
+               return;
44
44
+       }
45
45
+       ut_a(root);
46
 
+       
 
46
+
47
47
 #ifdef UNIV_BTR_DEBUG
48
48
        ut_a(btr_root_fseg_validate(FIL_PAGE_DATA + PAGE_BTR_SEG_LEAF
49
49
                                    + root, space));
50
 
@@ -1455,6 +1474,12 @@
51
 
        mtr_start(&mtr);
 
50
@@ -1460,6 +1479,12 @@
52
51
 
53
 
        root = btr_page_get(space, zip_size, root_page_no, RW_X_LATCH, &mtr);
 
52
        root = btr_page_get(space, zip_size, root_page_no, RW_X_LATCH,
 
53
                            NULL, &mtr);
54
54
+
55
55
+       if (srv_pass_corrupt_table && !root) {
56
56
+               mtr_commit(&mtr);
60
60
 #ifdef UNIV_BTR_DEBUG
61
61
        ut_a(btr_root_fseg_validate(FIL_PAGE_DATA + PAGE_BTR_SEG_TOP
62
62
                                    + root, space));
63
 
@@ -1488,6 +1513,11 @@
64
 
 
65
 
        block = btr_block_get(space, zip_size, root_page_no, RW_X_LATCH, mtr);
 
63
@@ -1493,6 +1518,11 @@
 
64
        block = btr_block_get(space, zip_size, root_page_no, RW_X_LATCH,
 
65
                              NULL, mtr);
66
66
 
67
67
+       if (srv_pass_corrupt_table && !block) {
68
68
+               return;
74
74
        header = buf_block_get_frame(block) + PAGE_HEADER + PAGE_BTR_SEG_TOP;
75
75
--- a/storage/innobase/btr/btr0cur.c
76
76
+++ b/storage/innobase/btr/btr0cur.c
77
 
@@ -250,6 +250,11 @@
78
 
        case BTR_MODIFY_LEAF:
 
77
@@ -251,6 +251,11 @@
79
78
                mode = latch_mode == BTR_SEARCH_LEAF ? RW_S_LATCH : RW_X_LATCH;
80
 
                get_block = btr_block_get(space, zip_size, page_no, mode, mtr);
81
 
+
82
 
+               if (srv_pass_corrupt_table && !get_block) {
83
 
+                       return;
84
 
+               }
85
 
+               ut_a(get_block);
86
 
 #ifdef UNIV_BTR_DEBUG
87
 
                ut_a(page_is_comp(get_block->frame) == page_is_comp(page));
88
 
 #endif /* UNIV_BTR_DEBUG */
89
 
@@ -263,6 +268,11 @@
90
 
                        get_block = btr_block_get(space, zip_size,
91
 
                                                  left_page_no,
92
 
                                                  RW_X_LATCH, mtr);
93
 
+
94
 
+                       if (srv_pass_corrupt_table && !get_block) {
95
 
+                               return;
96
 
+                       }
97
 
+                       ut_a(get_block);
98
 
 #ifdef UNIV_BTR_DEBUG
99
 
                        ut_a(page_is_comp(get_block->frame)
100
 
                             == page_is_comp(page));
101
 
@@ -274,6 +284,11 @@
102
 
 
103
 
                get_block = btr_block_get(space, zip_size, page_no,
104
 
                                          RW_X_LATCH, mtr);
105
 
+
106
 
+               if (srv_pass_corrupt_table && !get_block) {
107
 
+                       return;
108
 
+               }
109
 
+               ut_a(get_block);
110
 
 #ifdef UNIV_BTR_DEBUG
111
 
                ut_a(page_is_comp(get_block->frame) == page_is_comp(page));
112
 
 #endif /* UNIV_BTR_DEBUG */
113
 
@@ -285,6 +300,11 @@
114
 
                        get_block = btr_block_get(space, zip_size,
115
 
                                                  right_page_no,
116
 
                                                  RW_X_LATCH, mtr);
117
 
+
118
 
+                       if (srv_pass_corrupt_table && !get_block) {
119
 
+                               return;
120
 
+                       }
121
 
+                       ut_a(get_block);
122
 
 #ifdef UNIV_BTR_DEBUG
123
 
                        ut_a(page_is_comp(get_block->frame)
124
 
                             == page_is_comp(page));
125
 
@@ -306,6 +326,11 @@
126
 
                        get_block = btr_block_get(space, zip_size,
127
 
                                                  left_page_no, mode, mtr);
 
79
                get_block = btr_block_get(
 
80
                        space, zip_size, page_no, mode, cursor->index, mtr);
 
81
+
 
82
+               if (srv_pass_corrupt_table && !get_block) {
 
83
+                       return;
 
84
+               }
 
85
+               ut_a(get_block);
 
86
 #ifdef UNIV_BTR_DEBUG
 
87
                ut_a(page_is_comp(get_block->frame) == page_is_comp(page));
 
88
 #endif /* UNIV_BTR_DEBUG */
 
89
@@ -264,6 +269,11 @@
 
90
                        get_block = btr_block_get(
 
91
                                space, zip_size, left_page_no,
 
92
                                RW_X_LATCH, cursor->index, mtr);
 
93
+
 
94
+                       if (srv_pass_corrupt_table && !get_block) {
 
95
+                               return;
 
96
+                       }
 
97
+                       ut_a(get_block);
 
98
 #ifdef UNIV_BTR_DEBUG
 
99
                        ut_a(page_is_comp(get_block->frame)
 
100
                             == page_is_comp(page));
 
101
@@ -276,6 +286,11 @@
 
102
                get_block = btr_block_get(
 
103
                        space, zip_size, page_no,
 
104
                        RW_X_LATCH, cursor->index, mtr);
 
105
+
 
106
+               if (srv_pass_corrupt_table && !get_block) {
 
107
+                       return;
 
108
+               }
 
109
+               ut_a(get_block);
 
110
 #ifdef UNIV_BTR_DEBUG
 
111
                ut_a(page_is_comp(get_block->frame) == page_is_comp(page));
 
112
 #endif /* UNIV_BTR_DEBUG */
 
113
@@ -287,6 +302,11 @@
 
114
                        get_block = btr_block_get(
 
115
                                space, zip_size, right_page_no,
 
116
                                RW_X_LATCH, cursor->index, mtr);
 
117
+
 
118
+                       if (srv_pass_corrupt_table && !get_block) {
 
119
+                               return;
 
120
+                       }
 
121
+                       ut_a(get_block);
 
122
 #ifdef UNIV_BTR_DEBUG
 
123
                        ut_a(page_is_comp(get_block->frame)
 
124
                             == page_is_comp(page));
 
125
@@ -309,6 +329,11 @@
 
126
                                space, zip_size,
 
127
                                left_page_no, mode, cursor->index, mtr);
128
128
                        cursor->left_block = get_block;
129
129
+
130
130
+                       if (srv_pass_corrupt_table && !get_block) {
134
134
 #ifdef UNIV_BTR_DEBUG
135
135
                        ut_a(page_is_comp(get_block->frame)
136
136
                             == page_is_comp(page));
137
 
@@ -316,6 +341,11 @@
138
 
                }
 
137
@@ -320,6 +345,11 @@
139
138
 
140
 
                get_block = btr_block_get(space, zip_size, page_no, mode, mtr);
 
139
                get_block = btr_block_get(
 
140
                        space, zip_size, page_no, mode, cursor->index, mtr);
141
141
+
142
142
+               if (srv_pass_corrupt_table && !get_block) {
143
143
+                       return;
146
146
 #ifdef UNIV_BTR_DEBUG
147
147
                ut_a(page_is_comp(get_block->frame) == page_is_comp(page));
148
148
 #endif /* UNIV_BTR_DEBUG */
149
 
@@ -588,6 +618,19 @@
 
149
@@ -592,6 +622,19 @@
150
150
                file, line, mtr);
151
151
 
152
152
        if (block == NULL) {
166
166
                /* This must be a search to perform an insert/delete
167
167
                mark/ delete; try using the insert/delete buffer */
168
168
 
169
 
@@ -662,6 +705,16 @@
 
169
@@ -666,6 +709,16 @@
170
170
        block->check_index_page_at_flush = TRUE;
171
171
        page = buf_block_get_frame(block);
172
172
 
183
183
        if (rw_latch != RW_NO_LATCH) {
184
184
 #ifdef UNIV_ZIP_DEBUG
185
185
                const page_zip_des_t*   page_zip
186
 
@@ -866,6 +919,17 @@
 
186
@@ -872,6 +925,17 @@
187
187
                                         RW_NO_LATCH, NULL, BUF_GET,
188
188
                                         file, line, mtr);
189
189
                page = buf_block_get_frame(block);
201
201
                ut_ad(index->id == btr_page_get_index_id(page));
202
202
 
203
203
                block->check_index_page_at_flush = TRUE;
204
 
@@ -986,6 +1050,14 @@
 
204
@@ -992,6 +1056,14 @@
205
205
                                         RW_NO_LATCH, NULL, BUF_GET,
206
206
                                         file, line, mtr);
207
207
                page = buf_block_get_frame(block);
216
216
                ut_ad(index->id == btr_page_get_index_id(page));
217
217
 
218
218
                if (height == ULINT_UNDEFINED) {
219
 
@@ -1199,6 +1271,12 @@
 
219
@@ -1205,6 +1277,12 @@
220
220
        *big_rec = NULL;
221
221
 
222
222
        block = btr_cur_get_block(cursor);
229
229
        page = buf_block_get_frame(block);
230
230
        index = cursor->index;
231
231
        zip_size = buf_block_get_zip_size(block);
232
 
@@ -2988,6 +3066,11 @@
 
232
@@ -2937,6 +3015,11 @@
233
233
 
234
234
        block = btr_cur_get_block(cursor);
235
235
 
241
241
        ut_ad(page_is_leaf(buf_block_get_frame(block)));
242
242
 
243
243
        rec = btr_cur_get_rec(cursor);
244
 
@@ -3701,6 +3784,11 @@
 
244
@@ -3650,6 +3733,11 @@
245
245
 
246
246
                page = btr_cur_get_page(&cursor);
247
247
 
277
277
        index = btr_cur_get_index(btr_pcur_get_btr_cur(cursor));
278
278
 
279
279
        page_cursor = btr_pcur_get_page_cur(cursor);
280
 
@@ -392,6 +398,15 @@
281
 
        next_block = btr_block_get(space, zip_size, next_page_no,
282
 
                                   cursor->latch_mode, mtr);
 
280
@@ -395,6 +401,15 @@
 
281
                                   cursor->latch_mode,
 
282
                                   btr_pcur_get_btr_cur(cursor)->index, mtr);
283
283
        next_page = buf_block_get_frame(next_block);
284
284
+
285
285
+       if (srv_pass_corrupt_table && !next_page) {
374
374
 #if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
375
375
        bpage->file_page_was_freed = FALSE;
376
376
 #endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
377
 
@@ -3845,6 +3866,7 @@
 
377
@@ -3899,6 +3920,7 @@
378
378
                                (ulong) bpage->offset);
379
379
                }
380
380
 
382
382
                /* From version 3.23.38 up we store the page checksum
383
383
                to the 4 first bytes of the page end lsn field */
384
384
 
385
 
@@ -3886,6 +3908,23 @@
 
385
@@ -3940,6 +3962,23 @@
386
386
                              REFMAN "forcing-innodb-recovery.html\n"
387
387
                              "InnoDB: about forcing recovery.\n", stderr);
388
388
 
404
404
+                               bpage->is_corrupt = TRUE;
405
405
+                       } else
406
406
                        if (srv_force_recovery < SRV_FORCE_IGNORE_CORRUPT) {
407
 
                                fputs("InnoDB: Ending processing because of"
408
 
                                      " a corrupt database page.\n",
409
 
@@ -3893,6 +3932,7 @@
410
 
                                exit(1);
 
407
                                /* If page space id is larger than TRX_SYS_SPACE
 
408
                                (0), we will attempt to mark the corresponding
 
409
@@ -3956,6 +3995,7 @@
 
410
                                }
411
411
                        }
412
412
                }
413
413
+               } /**/
414
414
 
415
415
                if (recv_recovery_is_on()) {
416
416
                        /* Pages must be uncompressed for crash recovery. */
417
 
@@ -3902,8 +3942,11 @@
 
417
@@ -3965,8 +4005,11 @@
418
418
 
419
419
                if (uncompressed && !recv_no_ibuf_operations) {
420
420
                        ibuf_merge_or_delete_for_page(
445
445
                /* The i/o is already completed when we arrive from
446
446
--- a/storage/innobase/dict/dict0dict.c
447
447
+++ b/storage/innobase/dict/dict0dict.c
448
 
@@ -54,6 +54,7 @@
449
 
 #include "row0merge.h"
 
448
@@ -55,6 +55,7 @@
450
449
 #include "m_ctype.h" /* my_isspace() */
451
450
 #include "ha_prototypes.h" /* innobase_strcasecmp(), innobase_casedn_str()*/
 
451
 #include "row0upd.h"
452
452
+#include "srv0start.h" /* SRV_LOG_SPACE_FIRST_ID */
453
453
 
454
454
 #include <ctype.h>
471
471
                        goto next_loop;
472
472
 
473
473
                cached_foreign_tables = 0;
474
 
@@ -4366,6 +4367,12 @@
 
474
@@ -4367,6 +4368,12 @@
475
475
        heap = mem_heap_create(1000);
476
476
 
477
477
        while (index) {
484
484
                size = btr_get_size(index, BTR_TOTAL_SIZE);
485
485
 
486
486
                index->stat_index_size = size;
487
 
@@ -4513,6 +4520,12 @@
 
487
@@ -4514,6 +4521,12 @@
488
488
        heap = mem_heap_create(1000);
489
489
 
490
490
        while (index) {
497
497
 /*===========================================*/
498
498
 {
499
499
        dict_table_t*   sys_stats;
500
 
@@ -4705,6 +4718,13 @@
 
500
@@ -4706,6 +4719,13 @@
501
501
                     || (srv_force_recovery < SRV_FORCE_NO_LOG_REDO
502
502
                         && dict_index_is_clust(index)))) {
503
503
                        ulint   size;
511
511
                        size = btr_get_size(index, BTR_TOTAL_SIZE);
512
512
 
513
513
                        index->stat_index_size = size;
514
 
@@ -5501,4 +5521,42 @@
515
 
                rw_lock_free(&dict_table_stats_latches[i]);
516
 
        }
 
514
@@ -5685,4 +5705,42 @@
 
515
 
 
516
        index->type |= DICT_CORRUPT;
517
517
 }
518
518
+
519
519
+/*************************************************************************
787
787
        if (descr != NULL) {
788
788
--- a/storage/innobase/handler/ha_innodb.cc
789
789
+++ b/storage/innobase/handler/ha_innodb.cc
790
 
@@ -3985,6 +3985,12 @@
 
790
@@ -4012,6 +4012,12 @@
791
791
                DBUG_RETURN(1);
792
792
        }
793
793
 
800
800
        /* Create buffers for packing the fields of a record. Why
801
801
        table->reclength did not work here? Obviously, because char
802
802
        fields when packed actually became 1 byte longer, when we also
803
 
@@ -4012,6 +4018,19 @@
 
803
@@ -4039,6 +4045,19 @@
804
804
        /* Get pointer to a table object in InnoDB dictionary cache */
805
805
        ib_table = dict_table_get(norm_name, TRUE);
806
806
        
820
820
        if (NULL == ib_table) {
821
821
                if (is_part && retries < 10) {
822
822
                        ++retries;
823
 
@@ -5161,6 +5180,10 @@
 
823
@@ -5188,6 +5207,10 @@
824
824
 
825
825
        ha_statistic_increment(&SSV::ha_write_count);
826
826
 
831
831
        if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
832
832
                table->timestamp_field->set_time();
833
833
 
834
 
@@ -5378,6 +5401,10 @@
 
834
@@ -5405,6 +5428,10 @@
835
835
 func_exit:
836
836
        innobase_active_small();
837
837
 
842
842
        DBUG_RETURN(error_result);
843
843
 }
844
844
 
845
 
@@ -5554,6 +5581,10 @@
 
845
@@ -5581,6 +5608,10 @@
846
846
 
847
847
        ha_statistic_increment(&SSV::ha_update_count);
848
848
 
853
853
        if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
854
854
                table->timestamp_field->set_time();
855
855
 
856
 
@@ -5643,6 +5674,10 @@
 
856
@@ -5670,6 +5701,10 @@
857
857
 
858
858
        innobase_active_small();
859
859
 
864
864
        DBUG_RETURN(error);
865
865
 }
866
866
 
867
 
@@ -5664,6 +5699,10 @@
 
867
@@ -5691,6 +5726,10 @@
868
868
 
869
869
        ha_statistic_increment(&SSV::ha_delete_count);
870
870
 
875
875
        if (!prebuilt->upd_node) {
876
876
                row_get_prebuilt_update_vector(prebuilt);
877
877
        }
878
 
@@ -5690,6 +5729,10 @@
 
878
@@ -5717,6 +5756,10 @@
879
879
 
880
880
        innobase_active_small();
881
881
 
886
886
        DBUG_RETURN(error);
887
887
 }
888
888
 
889
 
@@ -5929,6 +5972,10 @@
 
889
@@ -5956,6 +5999,10 @@
890
890
 
891
891
        ha_statistic_increment(&SSV::ha_read_key_count);
892
892
 
896
896
+
897
897
        index = prebuilt->index;
898
898
 
899
 
        if (UNIV_UNLIKELY(index == NULL)) {
900
 
@@ -5994,6 +6041,10 @@
 
899
        if (UNIV_UNLIKELY(index == NULL) || dict_index_is_corrupted(index)) {
 
900
@@ -6023,6 +6070,10 @@
901
901
                ret = DB_UNSUPPORTED;
902
902
        }
903
903
 
908
908
        switch (ret) {
909
909
        case DB_SUCCESS:
910
910
                error = 0;
911
 
@@ -6109,6 +6160,10 @@
 
911
@@ -6138,6 +6189,10 @@
912
912
 {
913
913
        DBUG_ENTER("change_active_index");
914
914
 
919
919
        ut_ad(user_thd == ha_thd());
920
920
        ut_a(prebuilt->trx == thd_to_trx(user_thd));
921
921
 
922
 
@@ -6199,6 +6254,10 @@
 
922
@@ -6251,6 +6306,10 @@
923
923
 
924
924
        DBUG_ENTER("general_fetch");
925
925
 
930
930
        ut_a(prebuilt->trx == thd_to_trx(user_thd));
931
931
 
932
932
        innodb_srv_conc_enter_innodb(prebuilt->trx);
933
 
@@ -6208,6 +6267,10 @@
 
933
@@ -6260,6 +6319,10 @@
934
934
 
935
935
        innodb_srv_conc_exit_innodb(prebuilt->trx);
936
936
 
941
941
        switch (ret) {
942
942
        case DB_SUCCESS:
943
943
                error = 0;
944
 
@@ -7474,10 +7537,18 @@
 
944
@@ -7526,10 +7589,18 @@
945
945
 
946
946
        update_thd(ha_thd());
947
947
 
960
960
        error = convert_error_code_to_mysql(error, prebuilt->table->flags,
961
961
                                            NULL);
962
962
 
963
 
@@ -7978,6 +8049,16 @@
 
963
@@ -8034,6 +8105,16 @@
964
964
        return(ranges + (double) rows / (double) total_rows * time_for_scan);
965
965
 }
966
966
 
977
977
 /*********************************************************************//**
978
978
 Calculates the key number used inside MySQL for an Innobase index. We will
979
979
 first check the "index translation table" for a match of the index to get
980
 
@@ -8155,7 +8236,7 @@
 
980
@@ -8211,7 +8292,7 @@
981
981
        ib_table = prebuilt->table;
982
982
 
983
983
        if (flag & HA_STATUS_TIME) {
986
986
                        /* In sql_show we call with this flag: update
987
987
                        then statistics so that they are up-to-date */
988
988
 
989
 
@@ -8455,10 +8536,18 @@
 
989
@@ -8511,10 +8592,18 @@
990
990
        THD*            thd,            /*!< in: connection thread handle */
991
991
        HA_CHECK_OPT*   check_opt)      /*!< in: currently ignored */
992
992
 {
1005
1005
        return(0);
1006
1006
 }
1007
1007
 
1008
 
@@ -8640,6 +8729,10 @@
 
1008
@@ -8747,6 +8836,10 @@
1009
1009
                my_error(ER_QUERY_INTERRUPTED, MYF(0));
1010
1010
        }
1011
1011
 
1016
1016
        DBUG_RETURN(is_ok ? HA_ADMIN_OK : HA_ADMIN_CORRUPT);
1017
1017
 }
1018
1018
 
1019
 
@@ -9410,6 +9503,10 @@
 
1019
@@ -9517,6 +9610,10 @@
1020
1020
 
1021
1021
        update_thd(thd);
1022
1022
 
1027
1027
        if (prebuilt->table->ibd_file_missing && !thd_tablespace_op(thd)) {
1028
1028
                ut_print_timestamp(stderr);
1029
1029
                fprintf(stderr,
1030
 
@@ -11829,6 +11926,26 @@
 
1030
@@ -11941,6 +12038,26 @@
1031
1031
   "dump file (if present). Disabled by default.",
1032
1032
   NULL, NULL, FALSE);
1033
1033
 
1054
1054
 static struct st_mysql_sys_var* innobase_system_variables[]= {
1055
1055
   MYSQL_SYSVAR(additional_mem_pool_size),
1056
1056
   MYSQL_SYSVAR(autoextend_increment),
1057
 
@@ -11918,6 +12035,7 @@
 
1057
@@ -12031,6 +12148,7 @@
1058
1058
   MYSQL_SYSVAR(purge_threads),
1059
1059
   MYSQL_SYSVAR(purge_batch_size),
1060
1060
   MYSQL_SYSVAR(rollback_segments),
1091
1091
 #define BTR_MAX_NODE_LEVEL     50      /*!< Maximum B-tree page level
1092
1092
                                        (not really a hard limit).
1093
1093
                                        Used in debug assertions
1094
 
@@ -55,7 +55,9 @@
 
1094
@@ -59,7 +59,9 @@
1095
1095
        block = buf_page_get_gen(space, zip_size, page_no, mode,
1096
1096
                                 NULL, BUF_GET, file, line, mtr);
1097
1097
 
1100
1100
+
1101
1101
+       if (block && mode != RW_NO_LATCH) {
1102
1102
 
1103
 
                buf_block_dbg_add_level(block, SYNC_TREE_NODE);
1104
 
        }
 
1103
                buf_block_dbg_add_level(
 
1104
                        block, index != NULL && dict_index_is_ibuf(index)
1105
1105
--- a/storage/innobase/include/buf0buf.h
1106
1106
+++ b/storage/innobase/include/buf0buf.h
1107
 
@@ -1041,7 +1041,7 @@
 
1107
@@ -1016,7 +1016,7 @@
1108
1108
        const buf_block_t*      block)  /*!< in: pointer to the control block */
1109
1109
        __attribute__((pure));
1110
1110
 #else /* UNIV_DEBUG */
1113
1113
 #endif /* UNIV_DEBUG */
1114
1114
 /*********************************************************************//**
1115
1115
 Gets the space id of a block.
1116
 
@@ -1488,6 +1488,7 @@
 
1116
@@ -1463,6 +1463,7 @@
1117
1117
                                        0 if the block was never accessed
1118
1118
                                        in the buffer pool */
1119
1119
        /* @} */
1147
1147
        switch (buf_block_get_state(block)) {
1148
1148
--- a/storage/innobase/include/dict0dict.h
1149
1149
+++ b/storage/innobase/include/dict0dict.h
1150
 
@@ -1258,6 +1258,15 @@
1151
 
 dict_close(void);
1152
 
 /*============*/
 
1150
@@ -1326,6 +1326,15 @@
 
1151
 /*========================*/
 
1152
        ulint           space_id);      /*!< in: space ID */
1153
1153
 
1154
1154
+/*************************************************************************
1155
1155
+set is_corrupt flag by space_id*/
1165
1165
 #endif
1166
1166
--- a/storage/innobase/include/dict0mem.h
1167
1167
+++ b/storage/innobase/include/dict0mem.h
1168
 
@@ -666,6 +666,7 @@
 
1168
@@ -670,6 +670,7 @@
1169
1169
                                the AUTOINC lock on this table. */
1170
1170
                                /* @} */
1171
1171
        /*----------------------*/
1220
1220
        buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK);
1221
1221
--- a/storage/innobase/include/page0page.h
1222
1222
+++ b/storage/innobase/include/page0page.h
1223
 
@@ -527,7 +527,7 @@
 
1223
@@ -497,7 +497,7 @@
1224
1224
 page_is_leaf(
1225
1225
 /*=========*/
1226
1226
        const page_t*   page)   /*!< in: page */
1254
1254
 Decompress a page.  This function should tolerate errors on the compressed
1255
1255
--- a/storage/innobase/include/srv0srv.h
1256
1256
+++ b/storage/innobase/include/srv0srv.h
1257
 
@@ -241,6 +241,7 @@
 
1257
@@ -245,6 +245,7 @@
1258
1258
 extern ulint   srv_adaptive_flushing_method;
1259
1259
 
1260
1260
 extern ulint   srv_expand_import;
1277
1277
        ut_ad(page_simple_validate_new((page_t*) page));
1278
1278
--- a/storage/innobase/row/row0ins.c
1279
1279
+++ b/storage/innobase/row/row0ins.c
1280
 
@@ -1335,6 +1335,12 @@
 
1280
@@ -1338,6 +1338,12 @@
1281
1281
                const rec_t*            rec = btr_pcur_get_rec(&pcur);
1282
1282
                const buf_block_t*      block = btr_pcur_get_block(&pcur);
1283
1283
 
1308
1308
 
1309
1309
--- a/storage/innobase/row/row0sel.c
1310
1310
+++ b/storage/innobase/row/row0sel.c
1311
 
@@ -3894,6 +3894,13 @@
 
1311
@@ -3912,6 +3912,13 @@
1312
1312
        /* PHASE 4: Look for matching records in a loop */
1313
1313
 
1314
1314
        rec = btr_pcur_get_rec(pcur);
1322
1322
        ut_ad(!!page_rec_is_comp(rec) == comp);
1323
1323
 #ifdef UNIV_SEARCH_DEBUG
1324
1324
        /*
1325
 
@@ -3971,7 +3978,13 @@
 
1325
@@ -3989,7 +3996,13 @@
1326
1326
        if (UNIV_UNLIKELY(next_offs >= UNIV_PAGE_SIZE - PAGE_DIR)) {
1327
1327
 
1328
1328
 wrong_offs:
1337
1337
                        ut_print_timestamp(stderr);
1338
1338
                        buf_page_print(page_align(rec), 0);
1339
1339
                        fprintf(stderr,
1340
 
@@ -4022,7 +4035,8 @@
 
1340
@@ -4040,7 +4053,8 @@
1341
1341
 
1342
1342
        offsets = rec_get_offsets(rec, index, offsets, ULINT_UNDEFINED, &heap);
1343
1343