~percona-dev/percona-server/5.5.13

« back to all changes in this revision

Viewing changes to innodb_pass_corrupt_table.patch

  • Committer: kinoyasu
  • Date: 2011-06-10 10:07:06 UTC
  • Revision ID: kinoyasu@gauntlet4-20110610100706-prntfzuugj9v29xq
port Yasufumi patches to 5.5.13

Show diffs side-by-side

added added

removed removed

Lines of Context:
452
452
diff -ruN a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c
453
453
--- a/storage/innobase/dict/dict0dict.c 2010-12-03 17:30:16.248987063 +0900
454
454
+++ b/storage/innobase/dict/dict0dict.c 2010-12-04 15:45:23.808513973 +0900
455
 
@@ -55,6 +55,7 @@
456
 
 #include "srv0srv.h" /* srv_lower_case_table_names */
 
455
@@ -54,6 +54,7 @@
 
456
 #include "row0merge.h"
457
457
 #include "m_ctype.h" /* my_isspace() */
458
458
 #include "ha_prototypes.h" /* innobase_strcasecmp(), innobase_casedn_str()*/
459
459
+#include "srv0start.h" /* SRV_LOG_SPACE_FIRST_ID */
460
460
 
461
461
 #include <ctype.h>
462
462
 
463
 
@@ -751,7 +752,7 @@
 
463
@@ -750,7 +751,7 @@
464
464
 
465
465
        mutex_exit(&(dict_sys->mutex));
466
466
 
469
469
                /* If table->ibd_file_missing == TRUE, this will
470
470
                print an error message and return without doing
471
471
                anything. */
472
 
@@ -1294,7 +1295,7 @@
 
472
@@ -1293,7 +1294,7 @@
473
473
                    + dict_sys->size) > srv_dict_size_limit ) {
474
474
                prev_table = UT_LIST_GET_PREV(table_LRU, table);
475
475
 
478
478
                        goto next_loop;
479
479
 
480
480
                cached_foreign_tables = 0;
481
 
@@ -4333,6 +4334,12 @@
 
481
@@ -4332,6 +4333,12 @@
482
482
        heap = mem_heap_create(1000);
483
483
 
484
484
        while (index) {
491
491
                size = btr_get_size(index, BTR_TOTAL_SIZE);
492
492
 
493
493
                index->stat_index_size = size;
494
 
@@ -4480,6 +4487,12 @@
 
494
@@ -4479,6 +4486,12 @@
495
495
        heap = mem_heap_create(1000);
496
496
 
497
497
        while (index) {
504
504
 /*===========================================*/
505
505
 {
506
506
        dict_table_t*   sys_stats;
507
 
@@ -4672,6 +4685,13 @@
 
507
@@ -4671,6 +4684,13 @@
508
508
                     || (srv_force_recovery < SRV_FORCE_NO_LOG_REDO
509
509
                         && dict_index_is_clust(index)))) {
510
510
                        ulint   size;
518
518
                        size = btr_get_size(index, BTR_TOTAL_SIZE);
519
519
 
520
520
                        index->stat_index_size = size;
521
 
@@ -5468,4 +5488,42 @@
 
521
@@ -5467,4 +5487,42 @@
522
522
                rw_lock_free(&dict_table_stats_latches[i]);
523
523
        }
524
524
 }
564
564
diff -ruN a/storage/innobase/dict/dict0mem.c b/storage/innobase/dict/dict0mem.c
565
565
--- a/storage/innobase/dict/dict0mem.c  2010-11-03 07:01:13.000000000 +0900
566
566
+++ b/storage/innobase/dict/dict0mem.c  2010-12-04 15:38:18.126549463 +0900
567
 
@@ -97,6 +97,8 @@
 
567
@@ -96,6 +96,8 @@
568
568
        /* The number of transactions that are either waiting on the
569
569
        AUTOINC lock or have been granted the lock. */
570
570
        table->n_waiting_or_granted_auto_inc_locks = 0;
637
637
        ut_a(ret);
638
638
 
639
639
        if (mode == OS_AIO_SYNC) {
640
 
@@ -5776,3 +5809,46 @@
 
640
@@ -5780,3 +5813,46 @@
641
641
                return 0;
642
642
        }
643
643
 }
798
798
diff -ruN a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
799
799
--- a/storage/innobase/handler/ha_innodb.cc     2010-12-04 15:37:50.578486593 +0900
800
800
+++ b/storage/innobase/handler/ha_innodb.cc     2010-12-04 15:38:18.137549396 +0900
801
 
@@ -3959,6 +3959,12 @@
 
801
@@ -3972,6 +3972,12 @@
802
802
                DBUG_RETURN(1);
803
803
        }
804
804
 
811
811
        /* Create buffers for packing the fields of a record. Why
812
812
        table->reclength did not work here? Obviously, because char
813
813
        fields when packed actually became 1 byte longer, when we also
814
 
@@ -3986,6 +3992,19 @@
 
814
@@ -3999,6 +4005,19 @@
815
815
        /* Get pointer to a table object in InnoDB dictionary cache */
816
816
        ib_table = dict_table_get(norm_name, TRUE);
817
817
        
831
831
        if (NULL == ib_table) {
832
832
                if (is_part && retries < 10) {
833
833
                        ++retries;
834
 
@@ -5150,6 +5169,10 @@
 
834
@@ -5163,6 +5182,10 @@
835
835
 
836
836
        ha_statistic_increment(&SSV::ha_write_count);
837
837
 
842
842
        if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
843
843
                table->timestamp_field->set_time();
844
844
 
845
 
@@ -5367,6 +5390,10 @@
 
845
@@ -5380,6 +5403,10 @@
846
846
 func_exit:
847
847
        innobase_active_small();
848
848
 
853
853
        DBUG_RETURN(error_result);
854
854
 }
855
855
 
856
 
@@ -5543,6 +5570,10 @@
 
856
@@ -5556,6 +5583,10 @@
857
857
 
858
858
        ha_statistic_increment(&SSV::ha_update_count);
859
859
 
864
864
        if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
865
865
                table->timestamp_field->set_time();
866
866
 
867
 
@@ -5632,6 +5663,10 @@
 
867
@@ -5645,6 +5676,10 @@
868
868
 
869
869
        innobase_active_small();
870
870
 
875
875
        DBUG_RETURN(error);
876
876
 }
877
877
 
878
 
@@ -5653,6 +5688,10 @@
 
878
@@ -5666,6 +5701,10 @@
879
879
 
880
880
        ha_statistic_increment(&SSV::ha_delete_count);
881
881
 
886
886
        if (!prebuilt->upd_node) {
887
887
                row_get_prebuilt_update_vector(prebuilt);
888
888
        }
889
 
@@ -5679,6 +5718,10 @@
 
889
@@ -5692,6 +5731,10 @@
890
890
 
891
891
        innobase_active_small();
892
892
 
897
897
        DBUG_RETURN(error);
898
898
 }
899
899
 
900
 
@@ -5918,6 +5961,10 @@
 
900
@@ -5931,6 +5974,10 @@
901
901
 
902
902
        ha_statistic_increment(&SSV::ha_read_key_count);
903
903
 
908
908
        index = prebuilt->index;
909
909
 
910
910
        if (UNIV_UNLIKELY(index == NULL)) {
911
 
@@ -5983,6 +6030,10 @@
 
911
@@ -5996,6 +6043,10 @@
912
912
                ret = DB_UNSUPPORTED;
913
913
        }
914
914
 
919
919
        switch (ret) {
920
920
        case DB_SUCCESS:
921
921
                error = 0;
922
 
@@ -6098,6 +6149,10 @@
 
922
@@ -6111,6 +6162,10 @@
923
923
 {
924
924
        DBUG_ENTER("change_active_index");
925
925
 
930
930
        ut_ad(user_thd == ha_thd());
931
931
        ut_a(prebuilt->trx == thd_to_trx(user_thd));
932
932
 
933
 
@@ -6188,6 +6243,10 @@
 
933
@@ -6201,6 +6256,10 @@
934
934
 
935
935
        DBUG_ENTER("general_fetch");
936
936
 
941
941
        ut_a(prebuilt->trx == thd_to_trx(user_thd));
942
942
 
943
943
        innodb_srv_conc_enter_innodb(prebuilt->trx);
944
 
@@ -6197,6 +6256,10 @@
 
944
@@ -6210,6 +6269,10 @@
945
945
 
946
946
        innodb_srv_conc_exit_innodb(prebuilt->trx);
947
947
 
952
952
        switch (ret) {
953
953
        case DB_SUCCESS:
954
954
                error = 0;
955
 
@@ -7467,10 +7530,18 @@
 
955
@@ -7476,10 +7539,18 @@
956
956
 
957
957
        update_thd(ha_thd());
958
958
 
971
971
        error = convert_error_code_to_mysql(error, prebuilt->table->flags,
972
972
                                            NULL);
973
973
 
974
 
@@ -7975,6 +8046,16 @@
 
974
@@ -7980,6 +8051,16 @@
975
975
        return(ranges + (double) rows / (double) total_rows * time_for_scan);
976
976
 }
977
977
 
988
988
 /*********************************************************************//**
989
989
 Calculates the key number used inside MySQL for an Innobase index. We will
990
990
 first check the "index translation table" for a match of the index to get
991
 
@@ -8152,7 +8233,7 @@
 
991
@@ -8157,7 +8238,7 @@
992
992
        ib_table = prebuilt->table;
993
993
 
994
994
        if (flag & HA_STATUS_TIME) {
997
997
                        /* In sql_show we call with this flag: update
998
998
                        then statistics so that they are up-to-date */
999
999
 
1000
 
@@ -8445,10 +8526,18 @@
 
1000
@@ -8450,10 +8531,18 @@
1001
1001
        THD*            thd,            /*!< in: connection thread handle */
1002
1002
        HA_CHECK_OPT*   check_opt)      /*!< in: currently ignored */
1003
1003
 {
1016
1016
        return(0);
1017
1017
 }
1018
1018
 
1019
 
@@ -8630,6 +8719,10 @@
 
1019
@@ -8635,6 +8724,10 @@
1020
1020
                my_error(ER_QUERY_INTERRUPTED, MYF(0));
1021
1021
        }
1022
1022
 
1027
1027
        DBUG_RETURN(is_ok ? HA_ADMIN_OK : HA_ADMIN_CORRUPT);
1028
1028
 }
1029
1029
 
1030
 
@@ -9400,6 +9493,10 @@
 
1030
@@ -9405,6 +9498,10 @@
1031
1031
 
1032
1032
        update_thd(thd);
1033
1033
 
1038
1038
        if (prebuilt->table->ibd_file_missing && !thd_tablespace_op(thd)) {
1039
1039
                ut_print_timestamp(stderr);
1040
1040
                fprintf(stderr,
1041
 
@@ -11800,6 +11897,26 @@
 
1041
@@ -11807,6 +11904,26 @@
1042
1042
   "0 (the default) disables automatic dumps.",
1043
1043
   NULL, NULL, 0, 0, UINT_MAX32, 0);
1044
1044
 
1065
1065
 static struct st_mysql_sys_var* innobase_system_variables[]= {
1066
1066
   MYSQL_SYSVAR(additional_mem_pool_size),
1067
1067
   MYSQL_SYSVAR(autoextend_increment),
1068
 
@@ -11886,6 +12003,7 @@
 
1068
@@ -11893,6 +12010,7 @@
1069
1069
   MYSQL_SYSVAR(purge_threads),
1070
1070
   MYSQL_SYSVAR(purge_batch_size),
1071
1071
   MYSQL_SYSVAR(rollback_segments),
1182
1182
diff -ruN a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
1183
1183
--- a/storage/innobase/include/dict0mem.h       2010-11-03 07:01:13.000000000 +0900
1184
1184
+++ b/storage/innobase/include/dict0mem.h       2010-12-04 15:38:18.171513956 +0900
1185
 
@@ -636,6 +636,7 @@
 
1185
@@ -640,6 +640,7 @@
1186
1186
                                the AUTOINC lock on this table. */
1187
1187
                                /* @} */
1188
1188
        /*----------------------*/
1277
1277
diff -ruN a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h
1278
1278
--- a/storage/innobase/include/srv0srv.h        2010-12-04 15:37:50.591516341 +0900
1279
1279
+++ b/storage/innobase/include/srv0srv.h        2010-12-04 15:38:18.180563749 +0900
1280
 
@@ -243,6 +243,7 @@
 
1280
@@ -240,6 +240,7 @@
1281
1281
 extern ulint   srv_adaptive_flushing_method;
1282
1282
 
1283
1283
 extern ulint   srv_expand_import;
1335
1335
diff -ruN a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c
1336
1336
--- a/storage/innobase/row/row0sel.c    2010-11-03 07:01:13.000000000 +0900
1337
1337
+++ b/storage/innobase/row/row0sel.c    2010-12-04 15:38:18.205551115 +0900
1338
 
@@ -3848,6 +3848,13 @@
 
1338
@@ -3853,6 +3853,13 @@
1339
1339
        /* PHASE 4: Look for matching records in a loop */
1340
1340
 
1341
1341
        rec = btr_pcur_get_rec(pcur);
1349
1349
        ut_ad(!!page_rec_is_comp(rec) == comp);
1350
1350
 #ifdef UNIV_SEARCH_DEBUG
1351
1351
        /*
1352
 
@@ -3925,7 +3932,13 @@
 
1352
@@ -3930,7 +3937,13 @@
1353
1353
        if (UNIV_UNLIKELY(next_offs >= UNIV_PAGE_SIZE - PAGE_DIR)) {
1354
1354
 
1355
1355
 wrong_offs:
1364
1364
                        ut_print_timestamp(stderr);
1365
1365
                        buf_page_print(page_align(rec), 0);
1366
1366
                        fprintf(stderr,
1367
 
@@ -3976,7 +3989,8 @@
 
1367
@@ -3981,7 +3994,8 @@
1368
1368
 
1369
1369
        offsets = rec_get_offsets(rec, index, offsets, ULINT_UNDEFINED, &heap);
1370
1370
 
1377
1377
diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
1378
1378
--- a/storage/innobase/srv/srv0srv.c    2010-12-04 15:37:50.602481253 +0900
1379
1379
+++ b/storage/innobase/srv/srv0srv.c    2010-12-04 15:38:18.209513823 +0900
1380
 
@@ -436,6 +436,7 @@
 
1380
@@ -430,6 +430,7 @@
1381
1381
 UNIV_INTERN ulint      srv_adaptive_flushing_method = 0; /* 0: native  1: estimate  2: keep_average */
1382
1382
 
1383
1383
 UNIV_INTERN ulint      srv_expand_import = 0; /* 0:disable 1:enable */