~tsarev/percona-server/5.5-processlist_rows_stats-sporadic_fails-fix

« back to all changes in this revision

Viewing changes to innodb_stats.patch

  • Committer: kinoyasu
  • Date: 2011-05-10 11:57:42 UTC
  • Revision ID: kinoyasu@gauntlet4-20110510115742-3i3194rn2m8fipm2
port Yasufumi patches to 5.5.12

Show diffs side-by-side

added added

removed removed

Lines of Context:
906
906
 
907
907
 
908
908
 static char*   internal_innobase_data_file_path        = NULL;
909
 
@@ -2407,6 +2408,8 @@
 
909
@@ -2420,6 +2421,8 @@
910
910
                goto error;
911
911
        }
912
912
 
915
915
        /* -------------- Log files ---------------------------*/
916
916
 
917
917
        /* The default dir for log files is the datadir of MySQL */
918
 
@@ -5211,6 +5214,10 @@
 
918
@@ -5223,6 +5226,10 @@
919
919
 
920
920
        error = row_insert_for_mysql((byte*) record, prebuilt);
921
921
 
926
926
        /* Handle duplicate key errors */
927
927
        if (auto_inc_used) {
928
928
                ulint           err;
929
 
@@ -5547,6 +5554,10 @@
 
929
@@ -5559,6 +5566,10 @@
930
930
                }
931
931
        }
932
932
 
937
937
        innodb_srv_conc_exit_innodb(trx);
938
938
 
939
939
        error = convert_error_code_to_mysql(error,
940
 
@@ -5600,6 +5611,10 @@
 
940
@@ -5612,6 +5623,10 @@
941
941
 
942
942
        error = row_update_for_mysql((byte*) record, prebuilt);
943
943
 
948
948
        innodb_srv_conc_exit_innodb(trx);
949
949
 
950
950
        error = convert_error_code_to_mysql(
951
 
@@ -5918,6 +5933,11 @@
 
951
@@ -5930,6 +5945,11 @@
952
952
        case DB_SUCCESS:
953
953
                error = 0;
954
954
                table->status = 0;
960
960
                break;
961
961
        case DB_RECORD_NOT_FOUND:
962
962
                error = HA_ERR_KEY_NOT_FOUND;
963
 
@@ -6127,6 +6147,11 @@
 
963
@@ -6139,6 +6159,11 @@
964
964
        case DB_SUCCESS:
965
965
                error = 0;
966
966
                table->status = 0;
972
972
                break;
973
973
        case DB_RECORD_NOT_FOUND:
974
974
                error = HA_ERR_END_OF_FILE;
975
 
@@ -8077,11 +8102,35 @@
 
975
@@ -8089,11 +8114,35 @@
976
976
                        /* In sql_show we call with this flag: update
977
977
                        then statistics so that they are up-to-date */
978
978
 
1009
1009
 
1010
1010
                        prebuilt->trx->op_info = "returning various info to MySQL";
1011
1011
                }
1012
 
@@ -8159,7 +8208,7 @@
 
1012
@@ -8171,7 +8220,7 @@
1013
1013
                are asked by MySQL to avoid locking. Another reason to
1014
1014
                avoid the call is that it uses quite a lot of CPU.
1015
1015
                See Bug#38185. */
1018
1018
                    || !(flag & HA_STATUS_VARIABLE_EXTRA)) {
1019
1019
                        /* We do not update delete_length if no
1020
1020
                        locking is requested so the "old" value can
1021
 
@@ -11361,6 +11410,26 @@
 
1021
@@ -11378,6 +11427,26 @@
1022
1022
   "The number of index pages to sample when calculating statistics (default 8)",
1023
1023
   NULL, NULL, 8, 1, ~0ULL, 0);
1024
1024
 
1045
1045
 static MYSQL_SYSVAR_BOOL(adaptive_hash_index, btr_search_enabled,
1046
1046
   PLUGIN_VAR_OPCMDARG,
1047
1047
   "Enable InnoDB adaptive hash index (enabled by default).  "
1048
 
@@ -11686,6 +11755,9 @@
 
1048
@@ -11703,6 +11772,9 @@
1049
1049
   MYSQL_SYSVAR(recovery_update_relay_log),
1050
1050
   MYSQL_SYSVAR(rollback_on_timeout),
1051
1051
   MYSQL_SYSVAR(stats_on_metadata),
1055
1055
   MYSQL_SYSVAR(stats_sample_pages),
1056
1056
   MYSQL_SYSVAR(adaptive_hash_index),
1057
1057
   MYSQL_SYSVAR(stats_method),
1058
 
@@ -11755,7 +11827,10 @@
 
1058
@@ -11772,7 +11844,10 @@
1059
1059
 i_s_innodb_sys_columns,
1060
1060
 i_s_innodb_sys_fields,
1061
1061
 i_s_innodb_sys_foreign,
1077
1077
+#include "dict0dict.h" /* for dict_sys */
1078
1078
 }
1079
1079
 
1080
 
 static const char plugin_author[] = "Innobase Oy";
1081
 
@@ -3457,6 +3458,221 @@
 
1080
 #define OK(expr)               \
 
1081
@@ -3455,6 +3456,221 @@
1082
1082
        STRUCT_FLD(__reserved1, NULL)
1083
1083
 };
1084
1084
 
1300
1300
 /***********************************************************************
1301
1301
 */
1302
1302
 static ST_FIELD_INFO   i_s_innodb_rseg_fields_info[] =
1303
 
@@ -3619,3 +3835,347 @@
 
1303
@@ -3617,3 +3833,347 @@
1304
1304
        /* void* */
1305
1305
        STRUCT_FLD(__reserved1, NULL)
1306
1306
 };
1651
1651
diff -ruN a/storage/innobase/handler/i_s.h b/storage/innobase/handler/i_s.h
1652
1652
--- a/storage/innobase/handler/i_s.h    2010-12-03 17:17:03.668953884 +0900
1653
1653
+++ b/storage/innobase/handler/i_s.h    2010-12-03 17:19:24.882947826 +0900
1654
 
@@ -41,5 +41,8 @@
 
1654
@@ -43,5 +43,8 @@
1655
1655
 extern struct st_mysql_plugin   i_s_innodb_sys_foreign;
1656
1656
 extern struct st_mysql_plugin   i_s_innodb_sys_foreign_cols;
1657
1657
 extern struct st_mysql_plugin  i_s_innodb_rseg;
2122
2122
diff -ruN a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
2123
2123
--- a/storage/innobase/srv/srv0srv.c    2010-12-03 15:53:54.625288512 +0900
2124
2124
+++ b/storage/innobase/srv/srv0srv.c    2010-12-03 17:19:24.922953561 +0900
2125
 
@@ -405,6 +405,9 @@
 
2125
@@ -404,6 +404,9 @@
2126
2126
 /* When estimating number of different key values in an index, sample
2127
2127
 this many index pages */
2128
2128
 UNIV_INTERN unsigned long long srv_stats_sample_pages = 8;