Merge lp:~percona-dev/percona-xtradb/fix-bug391189 into lp:~percona-dev/percona-xtradb/extensions-1.0

Proposed by Yasufumi Kinoshita
Status: Merged
Merged at revision: not available
Proposed branch: lp:~percona-dev/percona-xtradb/fix-bug391189
Merge into: lp:~percona-dev/percona-xtradb/extensions-1.0
Diff against target: None lines
To merge this branch: bzr merge lp:~percona-dev/percona-xtradb/fix-bug391189
Reviewer Review Type Date Requested Status
Vadim Tkachenko Approve
Review via email: mp+7827@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Vadim Tkachenko (vadim-tk) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'innodb_stats.patch'
--- innodb_stats.patch 2009-06-19 02:14:08 +0000
+++ innodb_stats.patch 2009-06-24 02:09:53 +0000
@@ -1,6 +1,6 @@
1diff -r 7672d7bc731d btr/btr0cur.c1diff -ru innodb_plugin-1.0.3_orig/btr/btr0cur.c innodb_plugin-1.0.3_tmp/btr/btr0cur.c
2--- a/btr/btr0cur.c Thu Jun 18 19:11:59 2009 -07002--- innodb_plugin-1.0.3_orig/btr/btr0cur.c 2009-06-24 10:47:36.000000000 +0900
3+++ b/btr/btr0cur.c Thu Jun 18 19:12:19 2009 -07003+++ innodb_plugin-1.0.3_tmp/btr/btr0cur.c 2009-06-24 10:53:16.000000000 +0900
4@@ -3202,7 +3202,9 @@4@@ -3202,7 +3202,9 @@
5 ulint n_cols;5 ulint n_cols;
6 ulint matched_fields;6 ulint matched_fields;
@@ -51,6 +51,15 @@
51 rec_t* next_rec = page_rec_get_next(rec);51 rec_t* next_rec = page_rec_get_next(rec);
52 if (next_rec == supremum) {52 if (next_rec == supremum) {
53 break;53 break;
54@@ -3274,7 +3295,7 @@
55 cmp_rec_rec_with_match(rec, next_rec,
56 offsets_rec, offsets_next_rec,
57 index, &matched_fields,
58- &matched_bytes);
59+ &matched_bytes, srv_stats_method);
60
61 for (j = matched_fields + 1; j <= n_cols; j++) {
62 /* We add one if this index record has
54@@ -3359,9 +3380,21 @@63@@ -3359,9 +3380,21 @@
55 }64 }
56 65
@@ -73,9 +82,9 @@
73 if (UNIV_LIKELY_NULL(heap)) {82 if (UNIV_LIKELY_NULL(heap)) {
74 mem_heap_free(heap);83 mem_heap_free(heap);
75 }84 }
76diff -r 7672d7bc731d dict/dict0dict.c85diff -ru innodb_plugin-1.0.3_orig/dict/dict0dict.c innodb_plugin-1.0.3_tmp/dict/dict0dict.c
77--- a/dict/dict0dict.c Thu Jun 18 19:11:59 2009 -070086--- innodb_plugin-1.0.3_orig/dict/dict0dict.c 2009-06-24 10:47:36.000000000 +0900
78+++ b/dict/dict0dict.c Thu Jun 18 19:12:19 2009 -070087+++ innodb_plugin-1.0.3_tmp/dict/dict0dict.c 2009-06-24 10:48:05.000000000 +0900
79@@ -4338,7 +4338,8 @@88@@ -4338,7 +4338,8 @@
80 89
81 ut_ad(mutex_own(&(dict_sys->mutex)));90 ut_ad(mutex_own(&(dict_sys->mutex)));
@@ -86,9 +95,9 @@
86 95
87 fprintf(stderr,96 fprintf(stderr,
88 "--------------------------------------\n"97 "--------------------------------------\n"
89diff -r 7672d7bc731d dict/dict0load.c98diff -ru innodb_plugin-1.0.3_orig/dict/dict0load.c innodb_plugin-1.0.3_tmp/dict/dict0load.c
90--- a/dict/dict0load.c Thu Jun 18 19:11:59 2009 -070099--- innodb_plugin-1.0.3_orig/dict/dict0load.c 2009-02-17 17:15:06.000000000 +0900
91+++ b/dict/dict0load.c Thu Jun 18 19:12:19 2009 -0700100+++ innodb_plugin-1.0.3_tmp/dict/dict0load.c 2009-06-24 10:48:05.000000000 +0900
92@@ -223,7 +223,7 @@101@@ -223,7 +223,7 @@
93 /* The table definition was corrupt if there102 /* The table definition was corrupt if there
94 is no index */103 is no index */
@@ -98,9 +107,9 @@
98 dict_update_statistics_low(table, TRUE);107 dict_update_statistics_low(table, TRUE);
99 }108 }
100 109
101diff -r 7672d7bc731d handler/ha_innodb.cc110diff -ru innodb_plugin-1.0.3_orig/handler/ha_innodb.cc innodb_plugin-1.0.3_tmp/handler/ha_innodb.cc
102--- a/handler/ha_innodb.cc Thu Jun 18 19:11:59 2009 -0700111--- innodb_plugin-1.0.3_orig/handler/ha_innodb.cc 2009-06-24 10:47:36.000000000 +0900
103+++ b/handler/ha_innodb.cc Thu Jun 18 19:12:19 2009 -0700112+++ innodb_plugin-1.0.3_tmp/handler/ha_innodb.cc 2009-06-24 10:48:05.000000000 +0900
104@@ -7086,7 +7086,9 @@113@@ -7086,7 +7086,9 @@
105 ib_table = prebuilt->table;114 ib_table = prebuilt->table;
106 115
@@ -162,9 +171,9 @@
162 i_s_innodb_patches171 i_s_innodb_patches
163 mysql_declare_plugin_end;172 mysql_declare_plugin_end;
164 173
165diff -r 7672d7bc731d handler/i_s.cc174diff -ru innodb_plugin-1.0.3_orig/handler/i_s.cc innodb_plugin-1.0.3_tmp/handler/i_s.cc
166--- a/handler/i_s.cc Thu Jun 18 19:11:59 2009 -0700175--- innodb_plugin-1.0.3_orig/handler/i_s.cc 2009-06-24 10:47:36.000000000 +0900
167+++ b/handler/i_s.cc Thu Jun 18 19:12:19 2009 -0700176+++ innodb_plugin-1.0.3_tmp/handler/i_s.cc 2009-06-24 10:48:05.000000000 +0900
168@@ -45,6 +45,7 @@177@@ -45,6 +45,7 @@
169 #include "dict0dict.h" /* for dict_index_get_if_in_cache */178 #include "dict0dict.h" /* for dict_index_get_if_in_cache */
170 #include "trx0rseg.h" /* for trx_rseg_struct */179 #include "trx0rseg.h" /* for trx_rseg_struct */
@@ -473,9 +482,9 @@
473+ STRUCT_FLD(system_vars, NULL),482+ STRUCT_FLD(system_vars, NULL),
474+ STRUCT_FLD(__reserved1, NULL)483+ STRUCT_FLD(__reserved1, NULL)
475+};484+};
476diff -r 7672d7bc731d handler/i_s.h485diff -ru innodb_plugin-1.0.3_orig/handler/i_s.h innodb_plugin-1.0.3_tmp/handler/i_s.h
477--- a/handler/i_s.h Thu Jun 18 19:11:59 2009 -0700486--- innodb_plugin-1.0.3_orig/handler/i_s.h 2009-06-24 10:47:36.000000000 +0900
478+++ b/handler/i_s.h Thu Jun 18 19:12:19 2009 -0700487+++ innodb_plugin-1.0.3_tmp/handler/i_s.h 2009-06-24 10:48:05.000000000 +0900
479@@ -37,5 +37,7 @@488@@ -37,5 +37,7 @@
480 extern struct st_mysql_plugin i_s_innodb_cmpmem_reset;489 extern struct st_mysql_plugin i_s_innodb_cmpmem_reset;
481 extern struct st_mysql_plugin i_s_innodb_patches;490 extern struct st_mysql_plugin i_s_innodb_patches;
@@ -484,9 +493,9 @@
484+extern struct st_mysql_plugin i_s_innodb_index_stats;493+extern struct st_mysql_plugin i_s_innodb_index_stats;
485 494
486 #endif /* i_s_h */495 #endif /* i_s_h */
487diff -r 7672d7bc731d handler/innodb_patch_info.h496diff -ru innodb_plugin-1.0.3_orig/handler/innodb_patch_info.h innodb_plugin-1.0.3_tmp/handler/innodb_patch_info.h
488--- a/handler/innodb_patch_info.h Thu Jun 18 19:11:59 2009 -0700497--- innodb_plugin-1.0.3_orig/handler/innodb_patch_info.h 2009-06-24 10:47:36.000000000 +0900
489+++ b/handler/innodb_patch_info.h Thu Jun 18 19:12:19 2009 -0700498+++ innodb_plugin-1.0.3_tmp/handler/innodb_patch_info.h 2009-06-24 10:48:05.000000000 +0900
490@@ -36,5 +36,6 @@499@@ -36,5 +36,6 @@
491 {"innodb_expand_import","convert .ibd file automatically when import tablespace","the files are generated by xtrabackup export mode.","http://www.percona.com/docs/wiki/percona-xtradb"},500 {"innodb_expand_import","convert .ibd file automatically when import tablespace","the files are generated by xtrabackup export mode.","http://www.percona.com/docs/wiki/percona-xtradb"},
492 {"innodb_dict_size_limit","Limit dictionary cache size","Variable innodb_dict_size_limit in bytes","http://www.percona.com/docs/wiki/percona-xtradb"},501 {"innodb_dict_size_limit","Limit dictionary cache size","Variable innodb_dict_size_limit in bytes","http://www.percona.com/docs/wiki/percona-xtradb"},
@@ -494,9 +503,35 @@
494+{"innodb_stats","Additional features about InnoDB statistics/optimizer","","http://www.percona.com/docs/wiki/percona-xtradb"},503+{"innodb_stats","Additional features about InnoDB statistics/optimizer","","http://www.percona.com/docs/wiki/percona-xtradb"},
495 {NULL, NULL, NULL, NULL}504 {NULL, NULL, NULL, NULL}
496 };505 };
497diff -r 7672d7bc731d include/srv0srv.h506diff -ru innodb_plugin-1.0.3_orig/include/rem0cmp.h innodb_plugin-1.0.3_tmp/include/rem0cmp.h
498--- a/include/srv0srv.h Thu Jun 18 19:11:59 2009 -0700507--- innodb_plugin-1.0.3_orig/include/rem0cmp.h 2009-02-17 18:29:55.000000000 +0900
499+++ b/include/srv0srv.h Thu Jun 18 19:12:19 2009 -0700508+++ innodb_plugin-1.0.3_tmp/include/rem0cmp.h 2009-06-24 10:51:08.000000000 +0900
509@@ -177,10 +177,11 @@
510 matched fields; when the function returns,
511 contains the value the for current
512 comparison */
513- ulint* matched_bytes);/* in/out: number of already matched
514+ ulint* matched_bytes, /* in/out: number of already matched
515 bytes within the first field not completely
516 matched; when the function returns, contains
517 the value for the current comparison */
518+ ulint stats_method);
519 /*****************************************************************
520 This function is used to compare two physical records. Only the common
521 first fields are compared. */
522diff -ru innodb_plugin-1.0.3_orig/include/rem0cmp.ic innodb_plugin-1.0.3_tmp/include/rem0cmp.ic
523--- innodb_plugin-1.0.3_orig/include/rem0cmp.ic 2009-02-17 18:29:55.000000000 +0900
524+++ innodb_plugin-1.0.3_tmp/include/rem0cmp.ic 2009-06-24 10:57:50.000000000 +0900
525@@ -88,5 +88,5 @@
526 ulint match_b = 0;
527
528 return(cmp_rec_rec_with_match(rec1, rec2, offsets1, offsets2, index,
529- &match_f, &match_b));
530+ &match_f, &match_b, 0));
531 }
532diff -ru innodb_plugin-1.0.3_orig/include/srv0srv.h innodb_plugin-1.0.3_tmp/include/srv0srv.h
533--- innodb_plugin-1.0.3_orig/include/srv0srv.h 2009-06-24 10:47:36.000000000 +0900
534+++ innodb_plugin-1.0.3_tmp/include/srv0srv.h 2009-06-24 10:48:05.000000000 +0900
500@@ -165,6 +165,11 @@535@@ -165,6 +165,11 @@
501 extern ibool srv_innodb_status;536 extern ibool srv_innodb_status;
502 537
@@ -509,27 +544,28 @@
509 544
510 extern ibool srv_use_doublewrite_buf;545 extern ibool srv_use_doublewrite_buf;
511 extern ibool srv_use_checksums;546 extern ibool srv_use_checksums;
512diff -r 7672d7bc731d page/page0page.c547diff -ru innodb_plugin-1.0.3_orig/rem/rem0cmp.c innodb_plugin-1.0.3_tmp/rem/rem0cmp.c
513--- a/page/page0page.c Thu Jun 18 19:11:59 2009 -0700548--- innodb_plugin-1.0.3_orig/rem/rem0cmp.c 2009-02-17 19:05:45.000000000 +0900
514+++ b/page/page0page.c Thu Jun 18 19:12:19 2009 -0700549+++ innodb_plugin-1.0.3_tmp/rem/rem0cmp.c 2009-06-24 10:52:00.000000000 +0900
515@@ -2349,7 +2349,7 @@550@@ -892,10 +892,11 @@
516 if (UNIV_LIKELY(count >= PAGE_HEAP_NO_USER_LOW)551 matched fields; when the function returns,
517 && !page_rec_is_supremum(rec)) {552 contains the value the for current
518 if (UNIV_UNLIKELY553 comparison */
519- (1 != cmp_rec_rec(rec, old_rec,554- ulint* matched_bytes) /* in/out: number of already matched
520+ (-1 != cmp_rec_rec(old_rec, rec,555+ ulint* matched_bytes, /* in/out: number of already matched
521 offsets, old_offsets, index))) {556 bytes within the first field not completely
522 fprintf(stderr,557 matched; when the function returns, contains
523 "InnoDB: Records in wrong order"558 the value for the current comparison */
524diff -r 7672d7bc731d rem/rem0cmp.c559+ ulint stats_method)
525--- a/rem/rem0cmp.c Thu Jun 18 19:11:59 2009 -0700560 {
526+++ b/rem/rem0cmp.c Thu Jun 18 19:12:19 2009 -0700561 #ifndef UNIV_HOTBACKUP
527@@ -989,7 +989,11 @@562 ulint rec1_n_fields; /* the number of fields in rec */
563@@ -989,7 +990,11 @@
528 564
529 if (rec1_f_len == rec2_f_len) {565 if (rec1_f_len == rec2_f_len) {
530 566
531- goto next_field;567- goto next_field;
532+ if (srv_stats_method == SRV_STATS_METHOD_NULLS_EQUAL) {568+ if (stats_method == SRV_STATS_METHOD_NULLS_EQUAL) {
533+ goto next_field;569+ goto next_field;
534+ } else {570+ } else {
535+ ret = -1;571+ ret = -1;
@@ -537,9 +573,9 @@
537 573
538 } else if (rec2_f_len == UNIV_SQL_NULL) {574 } else if (rec2_f_len == UNIV_SQL_NULL) {
539 575
540diff -r 7672d7bc731d row/row0mysql.c576diff -ru innodb_plugin-1.0.3_orig/row/row0mysql.c innodb_plugin-1.0.3_tmp/row/row0mysql.c
541--- a/row/row0mysql.c Thu Jun 18 19:11:59 2009 -0700577--- innodb_plugin-1.0.3_orig/row/row0mysql.c 2009-02-17 19:05:45.000000000 +0900
542+++ b/row/row0mysql.c Thu Jun 18 19:12:19 2009 -0700578+++ innodb_plugin-1.0.3_tmp/row/row0mysql.c 2009-06-24 10:48:05.000000000 +0900
543@@ -854,6 +854,9 @@579@@ -854,6 +854,9 @@
544 580
545 table->stat_modified_counter = counter + 1;581 table->stat_modified_counter = counter + 1;
@@ -550,18 +586,18 @@
550 /* Calculate new statistics if 1 / 16 of table has been modified586 /* Calculate new statistics if 1 / 16 of table has been modified
551 since the last time a statistics batch was run, or if587 since the last time a statistics batch was run, or if
552 stat_modified_counter > 2 000 000 000 (to avoid wrap-around).588 stat_modified_counter > 2 000 000 000 (to avoid wrap-around).
553diff -r 7672d7bc731d scripts/install_innodb_plugins.sql589diff -ru innodb_plugin-1.0.3_orig/scripts/install_innodb_plugins.sql innodb_plugin-1.0.3_tmp/scripts/install_innodb_plugins.sql
554--- a/scripts/install_innodb_plugins.sql Thu Jun 18 19:11:59 2009 -0700590--- innodb_plugin-1.0.3_orig/scripts/install_innodb_plugins.sql 2009-06-24 10:47:36.000000000 +0900
555+++ b/scripts/install_innodb_plugins.sql Thu Jun 18 19:12:19 2009 -0700591+++ innodb_plugin-1.0.3_tmp/scripts/install_innodb_plugins.sql 2009-06-24 10:48:05.000000000 +0900
556@@ -12,3 +12,5 @@592@@ -12,3 +12,5 @@
557 INSTALL PLUGIN INNODB_BUFFER_POOL_PAGES_BLOB SONAME 'ha_innodb.so';593 INSTALL PLUGIN INNODB_BUFFER_POOL_PAGES_BLOB SONAME 'ha_innodb.so';
558 INSTALL PLUGIN INNODB_BUFFER_POOL_PAGES_INDEX SONAME 'ha_innodb.so';594 INSTALL PLUGIN INNODB_BUFFER_POOL_PAGES_INDEX SONAME 'ha_innodb.so';
559 INSTALL PLUGIN innodb_rseg SONAME 'ha_innodb.so';595 INSTALL PLUGIN innodb_rseg SONAME 'ha_innodb.so';
560+INSTALL PLUGIN innodb_table_stats SONAME 'ha_innodb.so';596+INSTALL PLUGIN innodb_table_stats SONAME 'ha_innodb.so';
561+INSTALL PLUGIN innodb_index_stats SONAME 'ha_innodb.so';597+INSTALL PLUGIN innodb_index_stats SONAME 'ha_innodb.so';
562diff -r 7672d7bc731d srv/srv0srv.c598diff -ru innodb_plugin-1.0.3_orig/srv/srv0srv.c innodb_plugin-1.0.3_tmp/srv/srv0srv.c
563--- a/srv/srv0srv.c Thu Jun 18 19:11:59 2009 -0700599--- innodb_plugin-1.0.3_orig/srv/srv0srv.c 2009-06-24 10:47:36.000000000 +0900
564+++ b/srv/srv0srv.c Thu Jun 18 19:12:19 2009 -0700600+++ innodb_plugin-1.0.3_tmp/srv/srv0srv.c 2009-06-24 10:48:05.000000000 +0900
565@@ -337,6 +337,8 @@601@@ -337,6 +337,8 @@
566 /* When estimating number of different key values in an index, sample602 /* When estimating number of different key values in an index, sample
567 this many index pages */603 this many index pages */

Subscribers

People subscribed via source and target branches

to all changes: