Merge lp:~percona-toolkit-dev/percona-toolkit/fix-bug-821673 into lp:percona-toolkit/1.0
- fix-bug-821673
- Merge into 1.0
Proposed by
Daniel Nichter
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Daniel Nichter | ||||
Approved revision: | 100 | ||||
Merged at revision: | 95 | ||||
Proposed branch: | lp:~percona-toolkit-dev/percona-toolkit/fix-bug-821673 | ||||
Merge into: | lp:percona-toolkit/1.0 | ||||
Diff against target: |
391 lines (+187/-33) 10 files modified
bin/pt-table-checksum (+7/-8) lib/TableChunker.pm (+9/-10) t/lib/TableChunker.t (+72/-8) t/pt-table-checksum/basics.t (+36/-1) t/pt-table-checksum/chunk_index.t (+2/-6) t/pt-table-checksum/samples/where01.out (+3/-0) t/pt-table-checksum/samples/where01.sql (+26/-0) t/pt-table-checksum/samples/where02.out (+4/-0) t/pt-table-checksum/samples/where02.sql (+26/-0) t/pt-table-checksum/throttle.t (+2/-0) |
||||
To merge this branch: | bzr merge lp:~percona-toolkit-dev/percona-toolkit/fix-bug-821673 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel Nichter | Approve | ||
Review via email: mp+73144@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Daniel Nichter (daniel-nichter) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'bin/pt-table-checksum' | |||
2 | --- bin/pt-table-checksum 2011-08-23 14:31:04 +0000 | |||
3 | +++ bin/pt-table-checksum 2011-08-27 18:33:24 +0000 | |||
4 | @@ -2863,7 +2863,7 @@ | |||
5 | 2863 | 2863 | ||
6 | 2864 | sub _chunk_char { | 2864 | sub _chunk_char { |
7 | 2865 | my ( $self, %args ) = @_; | 2865 | my ( $self, %args ) = @_; |
9 | 2866 | my @required_args = qw(dbh db tbl tbl_struct chunk_col rows_in_range chunk_size); | 2866 | my @required_args = qw(dbh db tbl tbl_struct chunk_col min max rows_in_range chunk_size); |
10 | 2867 | foreach my $arg ( @required_args ) { | 2867 | foreach my $arg ( @required_args ) { |
11 | 2868 | die "I need a $arg argument" unless defined $args{$arg}; | 2868 | die "I need a $arg argument" unless defined $args{$arg}; |
12 | 2869 | } | 2869 | } |
13 | @@ -2874,12 +2874,7 @@ | |||
14 | 2874 | my $row; | 2874 | my $row; |
15 | 2875 | my $sql; | 2875 | my $sql; |
16 | 2876 | 2876 | ||
23 | 2877 | $sql = "SELECT MIN($chunk_col), MAX($chunk_col) FROM $db_tbl " | 2877 | my ($min_col, $max_col) = @{args}{qw(min max)}; |
18 | 2878 | . "ORDER BY `$chunk_col`"; | ||
19 | 2879 | MKDEBUG && _d($dbh, $sql); | ||
20 | 2880 | $row = $dbh->selectrow_arrayref($sql); | ||
21 | 2881 | my ($min_col, $max_col) = ($row->[0], $row->[1]); | ||
22 | 2882 | |||
24 | 2883 | $sql = "SELECT ORD(?) AS min_col_ord, ORD(?) AS max_col_ord"; | 2878 | $sql = "SELECT ORD(?) AS min_col_ord, ORD(?) AS max_col_ord"; |
25 | 2884 | MKDEBUG && _d($dbh, $sql); | 2879 | MKDEBUG && _d($dbh, $sql); |
26 | 2885 | my $ord_sth = $dbh->prepare($sql); # avoid quoting issues | 2880 | my $ord_sth = $dbh->prepare($sql); # avoid quoting issues |
27 | @@ -2950,7 +2945,9 @@ | |||
28 | 2950 | MKDEBUG && _d("Base", $base, "chars:", @chars); | 2945 | MKDEBUG && _d("Base", $base, "chars:", @chars); |
29 | 2951 | 2946 | ||
30 | 2952 | 2947 | ||
32 | 2953 | $sql = "SELECT MAX(LENGTH($chunk_col)) FROM $db_tbl ORDER BY `$chunk_col`"; | 2948 | $sql = "SELECT MAX(LENGTH($chunk_col)) FROM $db_tbl " |
33 | 2949 | . ($args{where} ? "WHERE $args{where} " : "") | ||
34 | 2950 | . "ORDER BY `$chunk_col`"; | ||
35 | 2954 | MKDEBUG && _d($dbh, $sql); | 2951 | MKDEBUG && _d($dbh, $sql); |
36 | 2955 | $row = $dbh->selectrow_arrayref($sql); | 2952 | $row = $dbh->selectrow_arrayref($sql); |
37 | 2956 | my $max_col_len = $row->[0]; | 2953 | my $max_col_len = $row->[0]; |
38 | @@ -5560,6 +5557,7 @@ | |||
39 | 5560 | tbl => $tbl, | 5557 | tbl => $tbl, |
40 | 5561 | chunk_col => $chunk_col, | 5558 | chunk_col => $chunk_col, |
41 | 5562 | tbl_struct => $struct, | 5559 | tbl_struct => $struct, |
42 | 5560 | where => $final_o->get('where'), | ||
43 | 5563 | ); | 5561 | ); |
44 | 5564 | if ( !grep { !defined $params{$_} } qw(min max rows_in_range) ) { | 5562 | if ( !grep { !defined $params{$_} } qw(min max rows_in_range) ) { |
45 | 5565 | @chunks = $ch->calculate_chunks( | 5563 | @chunks = $ch->calculate_chunks( |
46 | @@ -5571,6 +5569,7 @@ | |||
47 | 5571 | chunk_size => $rows_per_chunk, | 5569 | chunk_size => $rows_per_chunk, |
48 | 5572 | zero_chunk => $final_o->get('zero-chunk'), | 5570 | zero_chunk => $final_o->get('zero-chunk'), |
49 | 5573 | chunk_range => $final_o->get('chunk-range'), | 5571 | chunk_range => $final_o->get('chunk-range'), |
50 | 5572 | where => $final_o->get('where'), | ||
51 | 5574 | %params, | 5573 | %params, |
52 | 5575 | ); | 5574 | ); |
53 | 5576 | $maxval = $params{max}; | 5575 | $maxval = $params{max}; |
54 | 5577 | 5576 | ||
55 | === modified file 'lib/TableChunker.pm' | |||
56 | --- lib/TableChunker.pm 2011-07-12 21:47:07 +0000 | |||
57 | +++ lib/TableChunker.pm 2011-08-27 18:33:24 +0000 | |||
58 | @@ -204,6 +204,7 @@ | |||
59 | 204 | # exact - Use exact chunk_size? Use approximates is not. | 204 | # exact - Use exact chunk_size? Use approximates is not. |
60 | 205 | # tries - Fetch up to this many rows to find a non-zero value | 205 | # tries - Fetch up to this many rows to find a non-zero value |
61 | 206 | # chunk_range - Make chunk range open (default) or openclosed | 206 | # chunk_range - Make chunk range open (default) or openclosed |
62 | 207 | # where - WHERE clause. | ||
63 | 207 | # | 208 | # |
64 | 208 | # Returns: | 209 | # Returns: |
65 | 209 | # Array of WHERE predicates like "`col` >= '10' AND `col` < '20'", | 210 | # Array of WHERE predicates like "`col` >= '10' AND `col` < '20'", |
66 | @@ -510,6 +511,9 @@ | |||
67 | 510 | # <TableChunker::get_range_statistics()> | 511 | # <TableChunker::get_range_statistics()> |
68 | 511 | # chunk_size - requested size of each chunk | 512 | # chunk_size - requested size of each chunk |
69 | 512 | # | 513 | # |
70 | 514 | # Optional Arguments: | ||
71 | 515 | # where - WHERE clause. | ||
72 | 516 | # | ||
73 | 513 | # Returns: | 517 | # Returns: |
74 | 514 | # Array of chunker info that <calculate_chunks()> uses to create | 518 | # Array of chunker info that <calculate_chunks()> uses to create |
75 | 515 | # chunks, like: | 519 | # chunks, like: |
76 | @@ -522,7 +526,7 @@ | |||
77 | 522 | # (end code) | 526 | # (end code) |
78 | 523 | sub _chunk_char { | 527 | sub _chunk_char { |
79 | 524 | my ( $self, %args ) = @_; | 528 | my ( $self, %args ) = @_; |
81 | 525 | my @required_args = qw(dbh db tbl tbl_struct chunk_col rows_in_range chunk_size); | 529 | my @required_args = qw(dbh db tbl tbl_struct chunk_col min max rows_in_range chunk_size); |
82 | 526 | foreach my $arg ( @required_args ) { | 530 | foreach my $arg ( @required_args ) { |
83 | 527 | die "I need a $arg argument" unless defined $args{$arg}; | 531 | die "I need a $arg argument" unless defined $args{$arg}; |
84 | 528 | } | 532 | } |
85 | @@ -533,15 +537,8 @@ | |||
86 | 533 | my $row; | 537 | my $row; |
87 | 534 | my $sql; | 538 | my $sql; |
88 | 535 | 539 | ||
89 | 536 | # Get what MySQL says are the min and max column values. | ||
90 | 537 | # For example, is 'a' or 'A' the min according to MySQL? | ||
91 | 538 | $sql = "SELECT MIN($chunk_col), MAX($chunk_col) FROM $db_tbl " | ||
92 | 539 | . "ORDER BY `$chunk_col`"; | ||
93 | 540 | MKDEBUG && _d($dbh, $sql); | ||
94 | 541 | $row = $dbh->selectrow_arrayref($sql); | ||
95 | 542 | my ($min_col, $max_col) = ($row->[0], $row->[1]); | ||
96 | 543 | |||
97 | 544 | # Get the character codes between the min and max column values. | 540 | # Get the character codes between the min and max column values. |
98 | 541 | my ($min_col, $max_col) = @{args}{qw(min max)}; | ||
99 | 545 | $sql = "SELECT ORD(?) AS min_col_ord, ORD(?) AS max_col_ord"; | 542 | $sql = "SELECT ORD(?) AS min_col_ord, ORD(?) AS max_col_ord"; |
100 | 546 | MKDEBUG && _d($dbh, $sql); | 543 | MKDEBUG && _d($dbh, $sql); |
101 | 547 | my $ord_sth = $dbh->prepare($sql); # avoid quoting issues | 544 | my $ord_sth = $dbh->prepare($sql); # avoid quoting issues |
102 | @@ -642,7 +639,9 @@ | |||
103 | 642 | # [ant, apple, azur, boy]. We assume data is more evenly distributed | 639 | # [ant, apple, azur, boy]. We assume data is more evenly distributed |
104 | 643 | # than not so we use the minimum number of characters to express a chunk | 640 | # than not so we use the minimum number of characters to express a chunk |
105 | 644 | # size. | 641 | # size. |
107 | 645 | $sql = "SELECT MAX(LENGTH($chunk_col)) FROM $db_tbl ORDER BY `$chunk_col`"; | 642 | $sql = "SELECT MAX(LENGTH($chunk_col)) FROM $db_tbl " |
108 | 643 | . ($args{where} ? "WHERE $args{where} " : "") | ||
109 | 644 | . "ORDER BY `$chunk_col`"; | ||
110 | 646 | MKDEBUG && _d($dbh, $sql); | 645 | MKDEBUG && _d($dbh, $sql); |
111 | 647 | $row = $dbh->selectrow_arrayref($sql); | 646 | $row = $dbh->selectrow_arrayref($sql); |
112 | 648 | my $max_col_len = $row->[0]; | 647 | my $max_col_len = $row->[0]; |
113 | 649 | 648 | ||
114 | === modified file 't/lib/TableChunker.t' | |||
115 | --- t/lib/TableChunker.t 2011-07-12 21:47:07 +0000 | |||
116 | +++ t/lib/TableChunker.t 2011-08-27 18:33:24 +0000 | |||
117 | @@ -27,7 +27,7 @@ | |||
118 | 27 | plan skip_all => 'Cannot connect to sandbox master'; | 27 | plan skip_all => 'Cannot connect to sandbox master'; |
119 | 28 | } | 28 | } |
120 | 29 | else { | 29 | else { |
122 | 30 | plan tests => 86; | 30 | plan tests => 90; |
123 | 31 | } | 31 | } |
124 | 32 | 32 | ||
125 | 33 | $sb->create_dbs($dbh, ['test']); | 33 | $sb->create_dbs($dbh, ['test']); |
126 | @@ -1174,21 +1174,27 @@ | |||
127 | 1174 | 1174 | ||
128 | 1175 | $sb->load_file('master', "t/lib/samples/char-chunking/world-city.sql", 'test'); | 1175 | $sb->load_file('master', "t/lib/samples/char-chunking/world-city.sql", 'test'); |
129 | 1176 | $t = $p->parse( $du->get_create_table($dbh, $q, 'test', 'world_city') ); | 1176 | $t = $p->parse( $du->get_create_table($dbh, $q, 'test', 'world_city') ); |
130 | 1177 | %params = $c->get_range_statistics( | ||
131 | 1178 | dbh => $dbh, | ||
132 | 1179 | db => 'test', | ||
133 | 1180 | tbl => 'world_city', | ||
134 | 1181 | chunk_col => 'name', | ||
135 | 1182 | tbl_struct => $t, | ||
136 | 1183 | chunk_size => '500', | ||
137 | 1184 | ); | ||
138 | 1177 | @chunks = $c->calculate_chunks( | 1185 | @chunks = $c->calculate_chunks( |
139 | 1186 | dbh => $dbh, | ||
140 | 1187 | db => 'test', | ||
141 | 1188 | tbl => 'world_city', | ||
142 | 1178 | tbl_struct => $t, | 1189 | tbl_struct => $t, |
143 | 1179 | chunk_col => 'name', | 1190 | chunk_col => 'name', |
144 | 1180 | min => 'A Coruña (La Coruña)', | ||
145 | 1181 | max => '´s-Hertogenbosch', | ||
146 | 1182 | rows_in_range => 4079, | ||
147 | 1183 | chunk_size => 500, | 1191 | chunk_size => 500, |
151 | 1184 | dbh => $dbh, | 1192 | %params, |
149 | 1185 | db => 'test', | ||
150 | 1186 | tbl => 'world_city', | ||
152 | 1187 | ); | 1193 | ); |
153 | 1188 | ok( | 1194 | ok( |
154 | 1189 | @chunks >= 9, | 1195 | @chunks >= 9, |
155 | 1190 | "At least 9 char chunks on test.world_city.name" | 1196 | "At least 9 char chunks on test.world_city.name" |
157 | 1191 | ); | 1197 | ) or print STDERR Dumper(\@chunks); |
158 | 1192 | 1198 | ||
159 | 1193 | my $n_rows = count_rows("test.world_city", "name", @chunks); | 1199 | my $n_rows = count_rows("test.world_city", "name", @chunks); |
160 | 1194 | is( | 1200 | is( |
161 | @@ -1231,6 +1237,64 @@ | |||
162 | 1231 | ); | 1237 | ); |
163 | 1232 | }; | 1238 | }; |
164 | 1233 | 1239 | ||
165 | 1240 | # ############################################################################ | ||
166 | 1241 | # Bug 821673: pt-table-checksum doesn't included --where in min max queries | ||
167 | 1242 | # ############################################################################ | ||
168 | 1243 | $sb->load_file('master', "t/pt-table-checksum/samples/where01.sql"); | ||
169 | 1244 | $t = $p->parse( $du->get_create_table($dbh, $q, 'test', 'checksum_test') ); | ||
170 | 1245 | %params = $c->get_range_statistics( | ||
171 | 1246 | dbh => $dbh, | ||
172 | 1247 | db => 'test', | ||
173 | 1248 | tbl => 'checksum_test', | ||
174 | 1249 | chunk_col => 'id', | ||
175 | 1250 | tbl_struct => $t, | ||
176 | 1251 | where => "date = '2011-03-03'", | ||
177 | 1252 | ); | ||
178 | 1253 | is( | ||
179 | 1254 | $params{min}, | ||
180 | 1255 | 11, | ||
181 | 1256 | 'MIN int range stats with --where (bug 821673)' | ||
182 | 1257 | ); | ||
183 | 1258 | is( | ||
184 | 1259 | $params{max}, | ||
185 | 1260 | 15, | ||
186 | 1261 | 'MAX int range stats with --where (bug 821673)' | ||
187 | 1262 | ); | ||
188 | 1263 | |||
189 | 1264 | # char chunking | ||
190 | 1265 | $sb->load_file('master', "t/pt-table-checksum/samples/where02.sql"); | ||
191 | 1266 | $t = $p->parse( $du->get_create_table($dbh, $q, 'test', 'checksum_test') ); | ||
192 | 1267 | %params = $c->get_range_statistics( | ||
193 | 1268 | dbh => $dbh, | ||
194 | 1269 | db => 'test', | ||
195 | 1270 | tbl => 'checksum_test', | ||
196 | 1271 | chunk_col => 'id', | ||
197 | 1272 | tbl_struct => $t, | ||
198 | 1273 | where => "date = '2011-03-03'", | ||
199 | 1274 | ); | ||
200 | 1275 | is( | ||
201 | 1276 | $params{min}, | ||
202 | 1277 | 'Apple', | ||
203 | 1278 | 'MIN char range stats with --where (bug 821673)' | ||
204 | 1279 | ); | ||
205 | 1280 | is( | ||
206 | 1281 | $params{max}, | ||
207 | 1282 | 'raspberry', | ||
208 | 1283 | 'MAX char range stats with --where (bug 821673)' | ||
209 | 1284 | ); | ||
210 | 1285 | |||
211 | 1286 | # It's difficult to construct a char chunk test where WHERE will matter. | ||
212 | 1287 | #@chunks = $c->calculate_chunks( | ||
213 | 1288 | # dbh => $dbh, | ||
214 | 1289 | # db => 'test', | ||
215 | 1290 | # tbl => 'checksum_test', | ||
216 | 1291 | # tbl_struct => $t, | ||
217 | 1292 | # chunk_col => 'id', | ||
218 | 1293 | # chunk_size => 5, | ||
219 | 1294 | # where => "date = '2011-03-03'", | ||
220 | 1295 | # %params, | ||
221 | 1296 | #); | ||
222 | 1297 | |||
223 | 1234 | # ############################################################################# | 1298 | # ############################################################################# |
224 | 1235 | # Done. | 1299 | # Done. |
225 | 1236 | # ############################################################################# | 1300 | # ############################################################################# |
226 | 1237 | 1301 | ||
227 | === modified file 't/pt-table-checksum/basics.t' | |||
228 | --- t/pt-table-checksum/basics.t 2011-07-12 22:56:55 +0000 | |||
229 | +++ t/pt-table-checksum/basics.t 2011-08-27 18:33:24 +0000 | |||
230 | @@ -24,7 +24,7 @@ | |||
231 | 24 | plan skip_all => 'Cannot connect to sandbox master'; | 24 | plan skip_all => 'Cannot connect to sandbox master'; |
232 | 25 | } | 25 | } |
233 | 26 | else { | 26 | else { |
235 | 27 | plan tests => 12; | 27 | plan tests => 14; |
236 | 28 | } | 28 | } |
237 | 29 | 29 | ||
238 | 30 | my ($output, $output2); | 30 | my ($output, $output2); |
239 | @@ -120,6 +120,41 @@ | |||
240 | 120 | "--sleep doesn't sleep unless table is chunked" | 120 | "--sleep doesn't sleep unless table is chunked" |
241 | 121 | ); | 121 | ); |
242 | 122 | 122 | ||
243 | 123 | |||
244 | 124 | # ############################################################################ | ||
245 | 125 | # Bug 821673: pt-table-checksum doesn't included --where in min max queries | ||
246 | 126 | # ############################################################################ | ||
247 | 127 | $sb->load_file('master', "t/pt-table-checksum/samples/where01.sql"); | ||
248 | 128 | |||
249 | 129 | ok( | ||
250 | 130 | no_diff( | ||
251 | 131 | sub { pt_table_checksum::main(@args, | ||
252 | 132 | qw(--no-zero-chunk --chunk-size 5), '--where', "date = '2011-03-03'"); | ||
253 | 133 | }, | ||
254 | 134 | "t/pt-table-checksum/samples/where01.out", | ||
255 | 135 | trf => "awk '{print \$1 \" \" \$2 \" \" \$3 \" \" \$6}'", | ||
256 | 136 | ), | ||
257 | 137 | "--where affects int range stats (bug 821673)" | ||
258 | 138 | ); | ||
259 | 139 | |||
260 | 140 | # Test it again with a varchar primary key. The resulting 5 rows are: | ||
261 | 141 | # | Apple | 2011-03-03 | | ||
262 | 142 | # | lemon | 2011-03-03 | | ||
263 | 143 | # | lime | 2011-03-03 | | ||
264 | 144 | # | pineapple | 2011-03-03 | | ||
265 | 145 | # | raspberry | 2011-03-03 | | ||
266 | 146 | $sb->load_file('master', "t/pt-table-checksum/samples/where02.sql"); | ||
267 | 147 | ok( | ||
268 | 148 | no_diff( | ||
269 | 149 | sub { pt_table_checksum::main(@args, | ||
270 | 150 | qw(--no-zero-chunk --chunk-size 5), '--where', "date = '2011-03-03'"); | ||
271 | 151 | }, | ||
272 | 152 | "t/pt-table-checksum/samples/where02.out", | ||
273 | 153 | trf => "awk '{print \$1 \" \" \$2 \" \" \$3 \" \" \$6}'", | ||
274 | 154 | ), | ||
275 | 155 | "--where affects char range stats (bug 821673)" | ||
276 | 156 | ); | ||
277 | 157 | |||
278 | 123 | # ############################################################################# | 158 | # ############################################################################# |
279 | 124 | # Done. | 159 | # Done. |
280 | 125 | # ############################################################################# | 160 | # ############################################################################# |
281 | 126 | 161 | ||
282 | === modified file 't/pt-table-checksum/chunk_index.t' | |||
283 | --- t/pt-table-checksum/chunk_index.t 2011-07-12 22:56:55 +0000 | |||
284 | +++ t/pt-table-checksum/chunk_index.t 2011-08-27 18:33:24 +0000 | |||
285 | @@ -127,12 +127,8 @@ | |||
286 | 127 | 127 | ||
287 | 128 | is( | 128 | is( |
288 | 129 | $output, | 129 | $output, |
295 | 130 | "issue_519 t SELECT /*issue_519.t:1/5*/ 0 AS chunk_num, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(CRC32(CONCAT_WS('#', `i`, `y`, `t`, CONCAT(ISNULL(`t`)))) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `issue_519`.`t` FORCE INDEX (`y`) WHERE (`y` = 0) AND ((y > 2009)) | 130 | "issue_519 t SELECT /*issue_519.t:1/1*/ 0 AS chunk_num, COUNT(*) AS cnt, COALESCE(LOWER(CONV(BIT_XOR(CAST(CRC32(CONCAT_WS('#', `i`, `y`, `t`, CONCAT(ISNULL(`t`)))) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `issue_519`.`t` FORCE INDEX (`y`) WHERE (1=1) AND ((y > 2009)) |
296 | 131 | issue_519 t `y` = 0 | 131 | issue_519 t 1=1 |
291 | 132 | issue_519 t `y` > 0 AND `y` < '2003' | ||
292 | 133 | issue_519 t `y` >= '2003' AND `y` < '2006' | ||
293 | 134 | issue_519 t `y` >= '2006' AND `y` < '2009' | ||
294 | 135 | issue_519 t `y` >= '2009' | ||
297 | 136 | ", | 132 | ", |
298 | 137 | "Auto-chosen --chunk-index for --where (issue 378)" | 133 | "Auto-chosen --chunk-index for --where (issue 378)" |
299 | 138 | ); | 134 | ); |
300 | 139 | 135 | ||
301 | === added file 't/pt-table-checksum/samples/where01.out' | |||
302 | --- t/pt-table-checksum/samples/where01.out 1970-01-01 00:00:00 +0000 | |||
303 | +++ t/pt-table-checksum/samples/where01.out 2011-08-27 18:33:24 +0000 | |||
304 | @@ -0,0 +1,3 @@ | |||
305 | 1 | DATABASE TABLE CHUNK COUNT | ||
306 | 2 | test checksum_test 0 2 | ||
307 | 3 | test checksum_test 1 3 | ||
308 | 0 | 4 | ||
309 | === added file 't/pt-table-checksum/samples/where01.sql' | |||
310 | --- t/pt-table-checksum/samples/where01.sql 1970-01-01 00:00:00 +0000 | |||
311 | +++ t/pt-table-checksum/samples/where01.sql 2011-08-27 18:33:24 +0000 | |||
312 | @@ -0,0 +1,26 @@ | |||
313 | 1 | drop database if exists test; | ||
314 | 2 | create database test; | ||
315 | 3 | use test; | ||
316 | 4 | |||
317 | 5 | CREATE TABLE `checksum_test` ( | ||
318 | 6 | `id` int(11) NOT NULL DEFAULT '0', | ||
319 | 7 | `date` date DEFAULT NULL, | ||
320 | 8 | PRIMARY KEY (`id`) | ||
321 | 9 | ) ENGINE=InnoDB; | ||
322 | 10 | |||
323 | 11 | INSERT INTO `checksum_test` VALUES | ||
324 | 12 | (1, '2011-03-01'), | ||
325 | 13 | (2, '2011-03-01'), | ||
326 | 14 | (3, '2011-03-01'), | ||
327 | 15 | (4, '2011-03-01'), | ||
328 | 16 | (5, '2011-03-01'), | ||
329 | 17 | (6, '2011-03-02'), | ||
330 | 18 | (7, '2011-03-02'), | ||
331 | 19 | (8, '2011-03-02'), | ||
332 | 20 | (9, '2011-03-02'), | ||
333 | 21 | (10, '2011-03-02'), | ||
334 | 22 | (11, '2011-03-03'), | ||
335 | 23 | (12, '2011-03-03'), | ||
336 | 24 | (13, '2011-03-03'), | ||
337 | 25 | (14, '2011-03-03'), | ||
338 | 26 | (15, '2011-03-03'); | ||
339 | 0 | 27 | ||
340 | === added file 't/pt-table-checksum/samples/where02.out' | |||
341 | --- t/pt-table-checksum/samples/where02.out 1970-01-01 00:00:00 +0000 | |||
342 | +++ t/pt-table-checksum/samples/where02.out 2011-08-27 18:33:24 +0000 | |||
343 | @@ -0,0 +1,4 @@ | |||
344 | 1 | DATABASE TABLE CHUNK COUNT | ||
345 | 2 | test checksum_test 0 1 | ||
346 | 3 | test checksum_test 1 4 | ||
347 | 4 | test checksum_test 2 0 | ||
348 | 0 | 5 | ||
349 | === added file 't/pt-table-checksum/samples/where02.sql' | |||
350 | --- t/pt-table-checksum/samples/where02.sql 1970-01-01 00:00:00 +0000 | |||
351 | +++ t/pt-table-checksum/samples/where02.sql 2011-08-27 18:33:24 +0000 | |||
352 | @@ -0,0 +1,26 @@ | |||
353 | 1 | drop database if exists test; | ||
354 | 2 | create database test; | ||
355 | 3 | use test; | ||
356 | 4 | |||
357 | 5 | CREATE TABLE `checksum_test` ( | ||
358 | 6 | `id` varchar(255) NOT NULL, | ||
359 | 7 | `date` date DEFAULT NULL, | ||
360 | 8 | PRIMARY KEY (`id`) | ||
361 | 9 | ) ENGINE=InnoDB; | ||
362 | 10 | |||
363 | 11 | INSERT INTO `checksum_test` VALUES | ||
364 | 12 | ('Apple', '2011-03-03'), | ||
365 | 13 | ('banana', '2011-03-01'), | ||
366 | 14 | ('orange', '2011-03-01'), | ||
367 | 15 | ('grape', '2011-03-01'), | ||
368 | 16 | ('kiwi', '2011-03-01'), | ||
369 | 17 | ('strawberry', '2011-03-02'), | ||
370 | 18 | ('peach', '2011-03-02'), | ||
371 | 19 | ('mango', '2011-03-02'), | ||
372 | 20 | ('tomato', '2011-03-02'), | ||
373 | 21 | ('nectarine', '2011-03-02'), | ||
374 | 22 | ('pear', '2011-03-01'), | ||
375 | 23 | ('lemon', '2011-03-03'), | ||
376 | 24 | ('lime', '2011-03-03'), | ||
377 | 25 | ('pineapple', '2011-03-03'), | ||
378 | 26 | ('raspberry', '2011-03-03'); | ||
379 | 0 | 27 | ||
380 | === modified file 't/pt-table-checksum/throttle.t' | |||
381 | --- t/pt-table-checksum/throttle.t 2011-08-23 15:11:00 +0000 | |||
382 | +++ t/pt-table-checksum/throttle.t 2011-08-27 18:33:24 +0000 | |||
383 | @@ -281,6 +281,8 @@ | |||
384 | 281 | # Done. | 281 | # Done. |
385 | 282 | # ############################################################################# | 282 | # ############################################################################# |
386 | 283 | diag(`$trunk/sandbox/stop-sandbox 12347 >/dev/null`); | 283 | diag(`$trunk/sandbox/stop-sandbox 12347 >/dev/null`); |
387 | 284 | diag(`/tmp/12346/stop >/dev/null`); # Start/stop clears SHOW SLAVE HOSTS. | ||
388 | 285 | diag(`/tmp/12346/start >/dev/null`); | ||
389 | 284 | $sb->wipe_clean($master_dbh); | 286 | $sb->wipe_clean($master_dbh); |
390 | 285 | diag(`$trunk/sandbox/test-env reset >/dev/null`); | 287 | diag(`$trunk/sandbox/test-env reset >/dev/null`); |
391 | 286 | exit; | 288 | exit; |