Merge lp:~percona-dev/percona-xtradb/fix-bug391189 into lp:~percona-dev/percona-xtradb/extensions-1.0
- fix-bug391189
- Merge into 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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Vadim Tkachenko | Approve | ||
Review via email: mp+7827@code.launchpad.net |
Commit message
Description of the change
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
1 | === modified file 'innodb_stats.patch' | |||
2 | --- innodb_stats.patch 2009-06-19 02:14:08 +0000 | |||
3 | +++ innodb_stats.patch 2009-06-24 02:09:53 +0000 | |||
4 | @@ -1,6 +1,6 @@ | |||
8 | 1 | diff -r 7672d7bc731d btr/btr0cur.c | 1 | diff -ru innodb_plugin-1.0.3_orig/btr/btr0cur.c innodb_plugin-1.0.3_tmp/btr/btr0cur.c |
9 | 2 | --- a/btr/btr0cur.c Thu Jun 18 19:11:59 2009 -0700 | 2 | --- innodb_plugin-1.0.3_orig/btr/btr0cur.c 2009-06-24 10:47:36.000000000 +0900 |
10 | 3 | +++ b/btr/btr0cur.c Thu Jun 18 19:12:19 2009 -0700 | 3 | +++ innodb_plugin-1.0.3_tmp/btr/btr0cur.c 2009-06-24 10:53:16.000000000 +0900 |
11 | 4 | @@ -3202,7 +3202,9 @@ | 4 | @@ -3202,7 +3202,9 @@ |
12 | 5 | ulint n_cols; | 5 | ulint n_cols; |
13 | 6 | ulint matched_fields; | 6 | ulint matched_fields; |
14 | @@ -51,6 +51,15 @@ | |||
15 | 51 | rec_t* next_rec = page_rec_get_next(rec); | 51 | rec_t* next_rec = page_rec_get_next(rec); |
16 | 52 | if (next_rec == supremum) { | 52 | if (next_rec == supremum) { |
17 | 53 | break; | 53 | break; |
18 | 54 | @@ -3274,7 +3295,7 @@ | ||
19 | 55 | cmp_rec_rec_with_match(rec, next_rec, | ||
20 | 56 | offsets_rec, offsets_next_rec, | ||
21 | 57 | index, &matched_fields, | ||
22 | 58 | - &matched_bytes); | ||
23 | 59 | + &matched_bytes, srv_stats_method); | ||
24 | 60 | |||
25 | 61 | for (j = matched_fields + 1; j <= n_cols; j++) { | ||
26 | 62 | /* We add one if this index record has | ||
27 | 54 | @@ -3359,9 +3380,21 @@ | 63 | @@ -3359,9 +3380,21 @@ |
28 | 55 | } | 64 | } |
29 | 56 | 65 | ||
30 | @@ -73,9 +82,9 @@ | |||
31 | 73 | if (UNIV_LIKELY_NULL(heap)) { | 82 | if (UNIV_LIKELY_NULL(heap)) { |
32 | 74 | mem_heap_free(heap); | 83 | mem_heap_free(heap); |
33 | 75 | } | 84 | } |
37 | 76 | diff -r 7672d7bc731d dict/dict0dict.c | 85 | diff -ru innodb_plugin-1.0.3_orig/dict/dict0dict.c innodb_plugin-1.0.3_tmp/dict/dict0dict.c |
38 | 77 | --- a/dict/dict0dict.c Thu Jun 18 19:11:59 2009 -0700 | 86 | --- innodb_plugin-1.0.3_orig/dict/dict0dict.c 2009-06-24 10:47:36.000000000 +0900 |
39 | 78 | +++ b/dict/dict0dict.c Thu Jun 18 19:12:19 2009 -0700 | 87 | +++ innodb_plugin-1.0.3_tmp/dict/dict0dict.c 2009-06-24 10:48:05.000000000 +0900 |
40 | 79 | @@ -4338,7 +4338,8 @@ | 88 | @@ -4338,7 +4338,8 @@ |
41 | 80 | 89 | ||
42 | 81 | ut_ad(mutex_own(&(dict_sys->mutex))); | 90 | ut_ad(mutex_own(&(dict_sys->mutex))); |
43 | @@ -86,9 +95,9 @@ | |||
44 | 86 | 95 | ||
45 | 87 | fprintf(stderr, | 96 | fprintf(stderr, |
46 | 88 | "--------------------------------------\n" | 97 | "--------------------------------------\n" |
50 | 89 | diff -r 7672d7bc731d dict/dict0load.c | 98 | diff -ru innodb_plugin-1.0.3_orig/dict/dict0load.c innodb_plugin-1.0.3_tmp/dict/dict0load.c |
51 | 90 | --- a/dict/dict0load.c Thu Jun 18 19:11:59 2009 -0700 | 99 | --- innodb_plugin-1.0.3_orig/dict/dict0load.c 2009-02-17 17:15:06.000000000 +0900 |
52 | 91 | +++ b/dict/dict0load.c Thu Jun 18 19:12:19 2009 -0700 | 100 | +++ innodb_plugin-1.0.3_tmp/dict/dict0load.c 2009-06-24 10:48:05.000000000 +0900 |
53 | 92 | @@ -223,7 +223,7 @@ | 101 | @@ -223,7 +223,7 @@ |
54 | 93 | /* The table definition was corrupt if there | 102 | /* The table definition was corrupt if there |
55 | 94 | is no index */ | 103 | is no index */ |
56 | @@ -98,9 +107,9 @@ | |||
57 | 98 | dict_update_statistics_low(table, TRUE); | 107 | dict_update_statistics_low(table, TRUE); |
58 | 99 | } | 108 | } |
59 | 100 | 109 | ||
63 | 101 | diff -r 7672d7bc731d handler/ha_innodb.cc | 110 | diff -ru innodb_plugin-1.0.3_orig/handler/ha_innodb.cc innodb_plugin-1.0.3_tmp/handler/ha_innodb.cc |
64 | 102 | --- a/handler/ha_innodb.cc Thu Jun 18 19:11:59 2009 -0700 | 111 | --- innodb_plugin-1.0.3_orig/handler/ha_innodb.cc 2009-06-24 10:47:36.000000000 +0900 |
65 | 103 | +++ b/handler/ha_innodb.cc Thu Jun 18 19:12:19 2009 -0700 | 112 | +++ innodb_plugin-1.0.3_tmp/handler/ha_innodb.cc 2009-06-24 10:48:05.000000000 +0900 |
66 | 104 | @@ -7086,7 +7086,9 @@ | 113 | @@ -7086,7 +7086,9 @@ |
67 | 105 | ib_table = prebuilt->table; | 114 | ib_table = prebuilt->table; |
68 | 106 | 115 | ||
69 | @@ -162,9 +171,9 @@ | |||
70 | 162 | i_s_innodb_patches | 171 | i_s_innodb_patches |
71 | 163 | mysql_declare_plugin_end; | 172 | mysql_declare_plugin_end; |
72 | 164 | 173 | ||
76 | 165 | diff -r 7672d7bc731d handler/i_s.cc | 174 | diff -ru innodb_plugin-1.0.3_orig/handler/i_s.cc innodb_plugin-1.0.3_tmp/handler/i_s.cc |
77 | 166 | --- a/handler/i_s.cc Thu Jun 18 19:11:59 2009 -0700 | 175 | --- innodb_plugin-1.0.3_orig/handler/i_s.cc 2009-06-24 10:47:36.000000000 +0900 |
78 | 167 | +++ b/handler/i_s.cc Thu Jun 18 19:12:19 2009 -0700 | 176 | +++ innodb_plugin-1.0.3_tmp/handler/i_s.cc 2009-06-24 10:48:05.000000000 +0900 |
79 | 168 | @@ -45,6 +45,7 @@ | 177 | @@ -45,6 +45,7 @@ |
80 | 169 | #include "dict0dict.h" /* for dict_index_get_if_in_cache */ | 178 | #include "dict0dict.h" /* for dict_index_get_if_in_cache */ |
81 | 170 | #include "trx0rseg.h" /* for trx_rseg_struct */ | 179 | #include "trx0rseg.h" /* for trx_rseg_struct */ |
82 | @@ -473,9 +482,9 @@ | |||
83 | 473 | + STRUCT_FLD(system_vars, NULL), | 482 | + STRUCT_FLD(system_vars, NULL), |
84 | 474 | + STRUCT_FLD(__reserved1, NULL) | 483 | + STRUCT_FLD(__reserved1, NULL) |
85 | 475 | +}; | 484 | +}; |
89 | 476 | diff -r 7672d7bc731d handler/i_s.h | 485 | diff -ru innodb_plugin-1.0.3_orig/handler/i_s.h innodb_plugin-1.0.3_tmp/handler/i_s.h |
90 | 477 | --- a/handler/i_s.h Thu Jun 18 19:11:59 2009 -0700 | 486 | --- innodb_plugin-1.0.3_orig/handler/i_s.h 2009-06-24 10:47:36.000000000 +0900 |
91 | 478 | +++ b/handler/i_s.h Thu Jun 18 19:12:19 2009 -0700 | 487 | +++ innodb_plugin-1.0.3_tmp/handler/i_s.h 2009-06-24 10:48:05.000000000 +0900 |
92 | 479 | @@ -37,5 +37,7 @@ | 488 | @@ -37,5 +37,7 @@ |
93 | 480 | extern struct st_mysql_plugin i_s_innodb_cmpmem_reset; | 489 | extern struct st_mysql_plugin i_s_innodb_cmpmem_reset; |
94 | 481 | extern struct st_mysql_plugin i_s_innodb_patches; | 490 | extern struct st_mysql_plugin i_s_innodb_patches; |
95 | @@ -484,9 +493,9 @@ | |||
96 | 484 | +extern struct st_mysql_plugin i_s_innodb_index_stats; | 493 | +extern struct st_mysql_plugin i_s_innodb_index_stats; |
97 | 485 | 494 | ||
98 | 486 | #endif /* i_s_h */ | 495 | #endif /* i_s_h */ |
102 | 487 | diff -r 7672d7bc731d handler/innodb_patch_info.h | 496 | diff -ru innodb_plugin-1.0.3_orig/handler/innodb_patch_info.h innodb_plugin-1.0.3_tmp/handler/innodb_patch_info.h |
103 | 488 | --- a/handler/innodb_patch_info.h Thu Jun 18 19:11:59 2009 -0700 | 497 | --- innodb_plugin-1.0.3_orig/handler/innodb_patch_info.h 2009-06-24 10:47:36.000000000 +0900 |
104 | 489 | +++ b/handler/innodb_patch_info.h Thu Jun 18 19:12:19 2009 -0700 | 498 | +++ innodb_plugin-1.0.3_tmp/handler/innodb_patch_info.h 2009-06-24 10:48:05.000000000 +0900 |
105 | 490 | @@ -36,5 +36,6 @@ | 499 | @@ -36,5 +36,6 @@ |
106 | 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"}, |
107 | 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"}, |
108 | @@ -494,9 +503,35 @@ | |||
109 | 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"}, |
110 | 495 | {NULL, NULL, NULL, NULL} | 504 | {NULL, NULL, NULL, NULL} |
111 | 496 | }; | 505 | }; |
115 | 497 | diff -r 7672d7bc731d include/srv0srv.h | 506 | diff -ru innodb_plugin-1.0.3_orig/include/rem0cmp.h innodb_plugin-1.0.3_tmp/include/rem0cmp.h |
116 | 498 | --- a/include/srv0srv.h Thu Jun 18 19:11:59 2009 -0700 | 507 | --- innodb_plugin-1.0.3_orig/include/rem0cmp.h 2009-02-17 18:29:55.000000000 +0900 |
117 | 499 | +++ b/include/srv0srv.h Thu Jun 18 19:12:19 2009 -0700 | 508 | +++ innodb_plugin-1.0.3_tmp/include/rem0cmp.h 2009-06-24 10:51:08.000000000 +0900 |
118 | 509 | @@ -177,10 +177,11 @@ | ||
119 | 510 | matched fields; when the function returns, | ||
120 | 511 | contains the value the for current | ||
121 | 512 | comparison */ | ||
122 | 513 | - ulint* matched_bytes);/* in/out: number of already matched | ||
123 | 514 | + ulint* matched_bytes, /* in/out: number of already matched | ||
124 | 515 | bytes within the first field not completely | ||
125 | 516 | matched; when the function returns, contains | ||
126 | 517 | the value for the current comparison */ | ||
127 | 518 | + ulint stats_method); | ||
128 | 519 | /***************************************************************** | ||
129 | 520 | This function is used to compare two physical records. Only the common | ||
130 | 521 | first fields are compared. */ | ||
131 | 522 | diff -ru innodb_plugin-1.0.3_orig/include/rem0cmp.ic innodb_plugin-1.0.3_tmp/include/rem0cmp.ic | ||
132 | 523 | --- innodb_plugin-1.0.3_orig/include/rem0cmp.ic 2009-02-17 18:29:55.000000000 +0900 | ||
133 | 524 | +++ innodb_plugin-1.0.3_tmp/include/rem0cmp.ic 2009-06-24 10:57:50.000000000 +0900 | ||
134 | 525 | @@ -88,5 +88,5 @@ | ||
135 | 526 | ulint match_b = 0; | ||
136 | 527 | |||
137 | 528 | return(cmp_rec_rec_with_match(rec1, rec2, offsets1, offsets2, index, | ||
138 | 529 | - &match_f, &match_b)); | ||
139 | 530 | + &match_f, &match_b, 0)); | ||
140 | 531 | } | ||
141 | 532 | diff -ru innodb_plugin-1.0.3_orig/include/srv0srv.h innodb_plugin-1.0.3_tmp/include/srv0srv.h | ||
142 | 533 | --- innodb_plugin-1.0.3_orig/include/srv0srv.h 2009-06-24 10:47:36.000000000 +0900 | ||
143 | 534 | +++ innodb_plugin-1.0.3_tmp/include/srv0srv.h 2009-06-24 10:48:05.000000000 +0900 | ||
144 | 500 | @@ -165,6 +165,11 @@ | 535 | @@ -165,6 +165,11 @@ |
145 | 501 | extern ibool srv_innodb_status; | 536 | extern ibool srv_innodb_status; |
146 | 502 | 537 | ||
147 | @@ -509,27 +544,28 @@ | |||
148 | 509 | 544 | ||
149 | 510 | extern ibool srv_use_doublewrite_buf; | 545 | extern ibool srv_use_doublewrite_buf; |
150 | 511 | extern ibool srv_use_checksums; | 546 | extern ibool srv_use_checksums; |
167 | 512 | diff -r 7672d7bc731d page/page0page.c | 547 | diff -ru innodb_plugin-1.0.3_orig/rem/rem0cmp.c innodb_plugin-1.0.3_tmp/rem/rem0cmp.c |
168 | 513 | --- a/page/page0page.c Thu Jun 18 19:11:59 2009 -0700 | 548 | --- innodb_plugin-1.0.3_orig/rem/rem0cmp.c 2009-02-17 19:05:45.000000000 +0900 |
169 | 514 | +++ b/page/page0page.c Thu Jun 18 19:12:19 2009 -0700 | 549 | +++ innodb_plugin-1.0.3_tmp/rem/rem0cmp.c 2009-06-24 10:52:00.000000000 +0900 |
170 | 515 | @@ -2349,7 +2349,7 @@ | 550 | @@ -892,10 +892,11 @@ |
171 | 516 | if (UNIV_LIKELY(count >= PAGE_HEAP_NO_USER_LOW) | 551 | matched fields; when the function returns, |
172 | 517 | && !page_rec_is_supremum(rec)) { | 552 | contains the value the for current |
173 | 518 | if (UNIV_UNLIKELY | 553 | comparison */ |
174 | 519 | - (1 != cmp_rec_rec(rec, old_rec, | 554 | - ulint* matched_bytes) /* in/out: number of already matched |
175 | 520 | + (-1 != cmp_rec_rec(old_rec, rec, | 555 | + ulint* matched_bytes, /* in/out: number of already matched |
176 | 521 | offsets, old_offsets, index))) { | 556 | bytes within the first field not completely |
177 | 522 | fprintf(stderr, | 557 | matched; when the function returns, contains |
178 | 523 | "InnoDB: Records in wrong order" | 558 | the value for the current comparison */ |
179 | 524 | diff -r 7672d7bc731d rem/rem0cmp.c | 559 | + ulint stats_method) |
180 | 525 | --- a/rem/rem0cmp.c Thu Jun 18 19:11:59 2009 -0700 | 560 | { |
181 | 526 | +++ b/rem/rem0cmp.c Thu Jun 18 19:12:19 2009 -0700 | 561 | #ifndef UNIV_HOTBACKUP |
182 | 527 | @@ -989,7 +989,11 @@ | 562 | ulint rec1_n_fields; /* the number of fields in rec */ |
183 | 563 | @@ -989,7 +990,11 @@ | ||
184 | 528 | 564 | ||
185 | 529 | if (rec1_f_len == rec2_f_len) { | 565 | if (rec1_f_len == rec2_f_len) { |
186 | 530 | 566 | ||
187 | 531 | - goto next_field; | 567 | - goto next_field; |
189 | 532 | + if (srv_stats_method == SRV_STATS_METHOD_NULLS_EQUAL) { | 568 | + if (stats_method == SRV_STATS_METHOD_NULLS_EQUAL) { |
190 | 533 | + goto next_field; | 569 | + goto next_field; |
191 | 534 | + } else { | 570 | + } else { |
192 | 535 | + ret = -1; | 571 | + ret = -1; |
193 | @@ -537,9 +573,9 @@ | |||
194 | 537 | 573 | ||
195 | 538 | } else if (rec2_f_len == UNIV_SQL_NULL) { | 574 | } else if (rec2_f_len == UNIV_SQL_NULL) { |
196 | 539 | 575 | ||
200 | 540 | diff -r 7672d7bc731d row/row0mysql.c | 576 | diff -ru innodb_plugin-1.0.3_orig/row/row0mysql.c innodb_plugin-1.0.3_tmp/row/row0mysql.c |
201 | 541 | --- a/row/row0mysql.c Thu Jun 18 19:11:59 2009 -0700 | 577 | --- innodb_plugin-1.0.3_orig/row/row0mysql.c 2009-02-17 19:05:45.000000000 +0900 |
202 | 542 | +++ b/row/row0mysql.c Thu Jun 18 19:12:19 2009 -0700 | 578 | +++ innodb_plugin-1.0.3_tmp/row/row0mysql.c 2009-06-24 10:48:05.000000000 +0900 |
203 | 543 | @@ -854,6 +854,9 @@ | 579 | @@ -854,6 +854,9 @@ |
204 | 544 | 580 | ||
205 | 545 | table->stat_modified_counter = counter + 1; | 581 | table->stat_modified_counter = counter + 1; |
206 | @@ -550,18 +586,18 @@ | |||
207 | 550 | /* Calculate new statistics if 1 / 16 of table has been modified | 586 | /* Calculate new statistics if 1 / 16 of table has been modified |
208 | 551 | since the last time a statistics batch was run, or if | 587 | since the last time a statistics batch was run, or if |
209 | 552 | stat_modified_counter > 2 000 000 000 (to avoid wrap-around). | 588 | stat_modified_counter > 2 000 000 000 (to avoid wrap-around). |
213 | 553 | diff -r 7672d7bc731d scripts/install_innodb_plugins.sql | 589 | diff -ru innodb_plugin-1.0.3_orig/scripts/install_innodb_plugins.sql innodb_plugin-1.0.3_tmp/scripts/install_innodb_plugins.sql |
214 | 554 | --- a/scripts/install_innodb_plugins.sql Thu Jun 18 19:11:59 2009 -0700 | 590 | --- innodb_plugin-1.0.3_orig/scripts/install_innodb_plugins.sql 2009-06-24 10:47:36.000000000 +0900 |
215 | 555 | +++ b/scripts/install_innodb_plugins.sql Thu Jun 18 19:12:19 2009 -0700 | 591 | +++ innodb_plugin-1.0.3_tmp/scripts/install_innodb_plugins.sql 2009-06-24 10:48:05.000000000 +0900 |
216 | 556 | @@ -12,3 +12,5 @@ | 592 | @@ -12,3 +12,5 @@ |
217 | 557 | INSTALL PLUGIN INNODB_BUFFER_POOL_PAGES_BLOB SONAME 'ha_innodb.so'; | 593 | INSTALL PLUGIN INNODB_BUFFER_POOL_PAGES_BLOB SONAME 'ha_innodb.so'; |
218 | 558 | INSTALL PLUGIN INNODB_BUFFER_POOL_PAGES_INDEX SONAME 'ha_innodb.so'; | 594 | INSTALL PLUGIN INNODB_BUFFER_POOL_PAGES_INDEX SONAME 'ha_innodb.so'; |
219 | 559 | INSTALL PLUGIN innodb_rseg SONAME 'ha_innodb.so'; | 595 | INSTALL PLUGIN innodb_rseg SONAME 'ha_innodb.so'; |
220 | 560 | +INSTALL PLUGIN innodb_table_stats SONAME 'ha_innodb.so'; | 596 | +INSTALL PLUGIN innodb_table_stats SONAME 'ha_innodb.so'; |
221 | 561 | +INSTALL PLUGIN innodb_index_stats SONAME 'ha_innodb.so'; | 597 | +INSTALL PLUGIN innodb_index_stats SONAME 'ha_innodb.so'; |
225 | 562 | diff -r 7672d7bc731d srv/srv0srv.c | 598 | diff -ru innodb_plugin-1.0.3_orig/srv/srv0srv.c innodb_plugin-1.0.3_tmp/srv/srv0srv.c |
226 | 563 | --- a/srv/srv0srv.c Thu Jun 18 19:11:59 2009 -0700 | 599 | --- innodb_plugin-1.0.3_orig/srv/srv0srv.c 2009-06-24 10:47:36.000000000 +0900 |
227 | 564 | +++ b/srv/srv0srv.c Thu Jun 18 19:12:19 2009 -0700 | 600 | +++ innodb_plugin-1.0.3_tmp/srv/srv0srv.c 2009-06-24 10:48:05.000000000 +0900 |
228 | 565 | @@ -337,6 +337,8 @@ | 601 | @@ -337,6 +337,8 @@ |
229 | 566 | /* When estimating number of different key values in an index, sample | 602 | /* When estimating number of different key values in an index, sample |
230 | 567 | this many index pages */ | 603 | this many index pages */ |