Merge lp:~percona-toolkit-dev/percona-toolkit/mysql-5.6-test-fixes into lp:percona-toolkit/2.1
- mysql-5.6-test-fixes
- Merge into 2.1
Status: | Merged |
---|---|
Merged at revision: | 515 |
Proposed branch: | lp:~percona-toolkit-dev/percona-toolkit/mysql-5.6-test-fixes |
Merge into: | lp:percona-toolkit/2.1 |
Diff against target: |
2464 lines (+1350/-241) 42 files modified
bin/pt-deadlock-logger (+6/-3) bin/pt-duplicate-key-checker (+36/-18) bin/pt-fk-error-logger (+5/-1) bin/pt-index-usage (+36/-18) bin/pt-mysql-summary (+4/-2) bin/pt-table-checksum (+13/-7) bin/pt-table-sync (+36/-18) bin/pt-table-usage (+5/-1) bin/pt-upgrade (+43/-2) bin/pt-visual-explain (+5/-1) lib/Sandbox.pm (+22/-4) lib/SchemaIterator.pm (+9/-3) lib/Transformers.pm (+4/-0) sandbox/start-sandbox (+17/-2) sandbox/test-env (+2/-3) t/lib/ExplainAnalyzer.t (+3/-6) t/lib/NibbleIterator.t (+2/-2) t/lib/QueryReportFormatter.t (+9/-7) t/lib/SchemaIterator.t (+2/-6) t/lib/samples/QueryReportFormatter/report031.txt (+12/-0) t/lib/samples/QueryReportFormatter/report032.txt (+58/-0) t/lib/samples/SchemaIterator/all-dbs-tbls-5.6.txt (+537/-0) t/lib/samples/SchemaIterator/mysql-user-ddl-5.6.txt (+48/-0) t/lib/samples/stored-objs.sql (+30/-0) t/pt-archiver/standard_options.t (+91/-65) t/pt-find/pt-find.t (+77/-3) t/pt-heartbeat/bugs.t (+2/-0) t/pt-kill/basics.t (+2/-2) t/pt-kill/kill.t (+2/-2) t/pt-mysql-summary/pt-mysql-summary.t (+9/-6) t/pt-online-schema-change/samples/bug_1045317.sql (+1/-1) t/pt-query-digest/explain.t (+4/-8) t/pt-query-digest/samples/issue_1196-output-5.6.txt (+62/-0) t/pt-table-checksum/basics.t (+9/-12) t/pt-table-checksum/error_handling.t (+3/-3) t/pt-table-checksum/run_time.t (+1/-1) t/pt-table-checksum/samples/default-results-5.6.txt (+41/-0) t/pt-table-checksum/samples/repl-table-myisam.sql (+19/-0) t/pt-table-checksum/samples/static-chunk-size-results-5.6.txt (+41/-0) t/pt-table-checksum/skip_innodb.t (+29/-12) t/pt-table-sync/basics.t (+1/-1) t/pt-upgrade/warnings.t (+12/-21) |
To merge this branch: | bzr merge lp:~percona-toolkit-dev/percona-toolkit/mysql-5.6-test-fixes |
Related bugs: | |
Related blueprints: |
MySQL 5.6 Compatibility
(Essential)
Beta support for MySQL 5.6
(Essential)
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Brian Fraser (community) | Approve | ||
Daniel Nichter | Approve | ||
Review via email: mp+139822@code.launchpad.net |
Commit message
Description of the change
- 505. By Brian Fraser
-
Added two missing config files fort/pt-
config- diff/basics. t - 506. By Brian Fraser
-
Merged pxc-pt-heartbeat
- 507. By Brian Fraser
-
Merged fix-886059-
pt-heartbeat- timezones - 508. By Brian Fraser
-
Merged fix-1082104-
pt-deadlock- logger- username- dash - 509. By Daniel Nichter
-
Set USER=jenkins if not set in util/jenkins-test.
- 510. By Daniel Nichter
-
Fix two possible sources of test errors.
- 511. By Daniel Nichter
-
Only run pt-ioprofile.t if the system has strace.
- 512. By Daniel Nichter
-
Add REFETCH_MYSQL to jenkins-test.
- 513. By Daniel Nichter
-
Fix REFETCH_MYSQL.
Daniel Nichter (daniel-nichter) : | # |
- 514. By Brian Fraser
-
Merged mysql-5.
6-test- fixes and resolved conflicts - 515. By Brian Fraser
-
pt-deadlock-logger: InnoDB timestamps have a different format in 5.6
- 516. By Brian Fraser
-
t/pt-heartbeat/
bugs.t: Wait for test.heartbeat in slave1 before testing - 517. By Brian Fraser
-
pt-deadlock-logger: use a character class instead of \p{Hex}
- 518. By Brian Fraser
-
pt-fk-error-logger: Deal with 5.6 InnoDB timestamps
- 519. By Brian Fraser
-
t/pt-find/
pt-find. t: Update plan - 520. By Daniel Nichter
-
Merge 2.1 r514, just a doc change.
Brian Fraser (fraserbn) : | # |
- 521. By Daniel Nichter
-
Remove ndb_binlog_index from auto-skipped sys tables in SchemaIterator because it wasn't previously skipped in 5.1 and 5.5.
- 522. By Daniel Nichter
-
Update SchemaIterator.t sample files.
- 523. By Daniel Nichter
-
Make timing test more reasonable on fast systems.
Preview Diff
1 | === modified file 'bin/pt-deadlock-logger' | |||
2 | --- bin/pt-deadlock-logger 2012-12-14 01:47:50 +0000 | |||
3 | +++ bin/pt-deadlock-logger 2012-12-20 23:20:29 +0000 | |||
4 | @@ -3759,7 +3759,7 @@ | |||
5 | 3759 | my $n = qr/([^`\s]+)/; # MySQL object name | 3759 | my $n = qr/([^`\s]+)/; # MySQL object name |
6 | 3760 | my $u = qr/(\S+)/; # Username. This is somewhat wrong, but | 3760 | my $u = qr/(\S+)/; # Username. This is somewhat wrong, but |
7 | 3761 | # usernames with spaces are rare enough. | 3761 | # usernames with spaces are rare enough. |
9 | 3762 | my $s = qr/(\d{6} .\d:\d\d:\d\d)/; # InnoDB timestamp | 3762 | my $s = qr/((?:\d{6}|\d{4}-\d\d-\d\d) .\d:\d\d:\d\d)(?: [A-Fa-f0-9]+)?/; # InnoDB timestamp |
10 | 3763 | 3763 | ||
11 | 3764 | # A thread's proc_info can be at least 98 different things I've found in the | 3764 | # A thread's proc_info can be at least 98 different things I've found in the |
12 | 3765 | # source. Fortunately, most of them begin with a gerunded verb. These are | 3765 | # source. Fortunately, most of them begin with a gerunded verb. These are |
13 | @@ -4140,8 +4140,11 @@ | |||
14 | 4140 | 4140 | ||
15 | 4141 | # Extract some miscellaneous data from the deadlock. | 4141 | # Extract some miscellaneous data from the deadlock. |
16 | 4142 | my ( $ts ) = $dl_text =~ m/^$s$/m; | 4142 | my ( $ts ) = $dl_text =~ m/^$s$/m; |
19 | 4143 | my ( $year, $mon, $day, $hour, $min, $sec ) = $ts =~ m/^(\d\d)(\d\d)(\d\d) +(\d+):(\d+):(\d+)$/; | 4143 | my ( $year, $mon, $day, $hour, $min, $sec ) = $ts =~ m/^((?:\d\d)?\d\d)-?(\d\d)-?(\d\d) +(\d+):(\d+):(\d+)$/; |
20 | 4144 | $ts = sprintf('%02d-%02d-%02dT%02d:%02d:%02d', $year + 2000, $mon, $day, $hour, $min, $sec); | 4144 | if ( length($year) == 2 ) { |
21 | 4145 | $year += 2000; | ||
22 | 4146 | } | ||
23 | 4147 | $ts = sprintf('%02d-%02d-%02dT%02d:%02d:%02d', $year, $mon, $day, $hour, $min, $sec); | ||
24 | 4145 | my ( $victim ) = $dl_text =~ m/^\*\*\* WE ROLL BACK TRANSACTION \((\d+)\)$/m; | 4148 | my ( $victim ) = $dl_text =~ m/^\*\*\* WE ROLL BACK TRANSACTION \((\d+)\)$/m; |
25 | 4146 | $victim ||= 0; | 4149 | $victim ||= 0; |
26 | 4147 | 4150 | ||
27 | 4148 | 4151 | ||
28 | === modified file 'bin/pt-duplicate-key-checker' | |||
29 | --- bin/pt-duplicate-key-checker 2012-12-03 03:48:11 +0000 | |||
30 | +++ bin/pt-duplicate-key-checker 2012-12-20 23:20:29 +0000 | |||
31 | @@ -3026,11 +3026,16 @@ | |||
32 | 3026 | 3026 | ||
33 | 3027 | if ( !$self->{initialized} ) { | 3027 | if ( !$self->{initialized} ) { |
34 | 3028 | $self->{initialized} = 1; | 3028 | $self->{initialized} = 1; |
40 | 3029 | if ( $self->{resume}->{tbl} | 3029 | if ( $self->{resume}->{tbl} ) { |
41 | 3030 | && !$self->table_is_allowed(@{$self->{resume}}{qw(db tbl)}) ) { | 3030 | if ( !$self->table_is_allowed(@{$self->{resume}}{qw(db tbl)}) ) { |
42 | 3031 | PTDEBUG && _d('Will resume after', | 3031 | PTDEBUG && _d('Will resume after', |
43 | 3032 | join('.', @{$self->{resume}}{qw(db tbl)})); | 3032 | join('.', @{$self->{resume}}{qw(db tbl)})); |
44 | 3033 | $self->{resume}->{after} = 1; | 3033 | $self->{resume}->{after}->{tbl} = 1; |
45 | 3034 | } | ||
46 | 3035 | if ( !$self->database_is_allowed($self->{resume}->{db}) ) { | ||
47 | 3036 | PTDEBUG && _d('Will resume after', $self->{resume}->{db}); | ||
48 | 3037 | $self->{resume}->{after}->{db} = 1; | ||
49 | 3038 | } | ||
50 | 3034 | } | 3039 | } |
51 | 3035 | } | 3040 | } |
52 | 3036 | 3041 | ||
53 | @@ -3128,16 +3133,17 @@ | |||
54 | 3128 | if ( !defined $self->{dbs} ) { | 3133 | if ( !defined $self->{dbs} ) { |
55 | 3129 | my $sql = 'SHOW DATABASES'; | 3134 | my $sql = 'SHOW DATABASES'; |
56 | 3130 | PTDEBUG && _d($sql); | 3135 | PTDEBUG && _d($sql); |
59 | 3131 | my @dbs = grep { $self->database_is_allowed($_) } | 3136 | my @dbs = grep { |
60 | 3132 | @{$dbh->selectcol_arrayref($sql)}; | 3137 | $self->_resume_from_database($_) |
61 | 3138 | && | ||
62 | 3139 | $self->database_is_allowed($_) | ||
63 | 3140 | } @{$dbh->selectcol_arrayref($sql)}; | ||
64 | 3133 | PTDEBUG && _d('Found', scalar @dbs, 'databases'); | 3141 | PTDEBUG && _d('Found', scalar @dbs, 'databases'); |
65 | 3134 | $self->{dbs} = \@dbs; | 3142 | $self->{dbs} = \@dbs; |
66 | 3135 | } | 3143 | } |
67 | 3136 | 3144 | ||
68 | 3137 | if ( !$self->{db} ) { | 3145 | if ( !$self->{db} ) { |
72 | 3138 | do { | 3146 | $self->{db} = shift @{$self->{dbs}}; |
70 | 3139 | $self->{db} = shift @{$self->{dbs}}; | ||
71 | 3140 | } until $self->_resume_from_database($self->{db}); | ||
73 | 3141 | PTDEBUG && _d('Next database:', $self->{db}); | 3147 | PTDEBUG && _d('Next database:', $self->{db}); |
74 | 3142 | return unless $self->{db}; | 3148 | return unless $self->{db}; |
75 | 3143 | } | 3149 | } |
76 | @@ -3239,9 +3245,15 @@ | |||
77 | 3239 | 3245 | ||
78 | 3240 | my $filter = $self->{filters}; | 3246 | my $filter = $self->{filters}; |
79 | 3241 | 3247 | ||
83 | 3242 | if ( $db eq 'mysql' && ($tbl eq 'general_log' || $tbl eq 'slow_log') ) { | 3248 | return 0 if $db eq 'mysql' && $tbl =~ m/^(?: |
84 | 3243 | return 0; | 3249 | general_log |
85 | 3244 | } | 3250 | |slow_log |
86 | 3251 | |innodb_index_stats | ||
87 | 3252 | |innodb_table_stats | ||
88 | 3253 | |slave_master_info | ||
89 | 3254 | |slave_relay_log_info | ||
90 | 3255 | |slave_worker_info | ||
91 | 3256 | )$/x; | ||
92 | 3245 | 3257 | ||
93 | 3246 | if ( $filter->{'ignore-tables'}->{$tbl} | 3258 | if ( $filter->{'ignore-tables'}->{$tbl} |
94 | 3247 | && ($filter->{'ignore-tables'}->{$tbl} eq '*' | 3259 | && ($filter->{'ignore-tables'}->{$tbl} eq '*' |
95 | @@ -3310,11 +3322,17 @@ | |||
96 | 3310 | my ($self, $db) = @_; | 3322 | my ($self, $db) = @_; |
97 | 3311 | 3323 | ||
98 | 3312 | return 1 unless $self->{resume}->{db}; | 3324 | return 1 unless $self->{resume}->{db}; |
99 | 3313 | |||
100 | 3314 | if ( $db eq $self->{resume}->{db} ) { | 3325 | if ( $db eq $self->{resume}->{db} ) { |
104 | 3315 | PTDEBUG && _d('At resume db', $db); | 3326 | if ( !$self->{resume}->{after}->{db} ) { |
105 | 3316 | delete $self->{resume}->{db}; | 3327 | PTDEBUG && _d('Resuming from db', $db); |
106 | 3317 | return 1; | 3328 | delete $self->{resume}->{db}; |
107 | 3329 | return 1; | ||
108 | 3330 | } | ||
109 | 3331 | else { | ||
110 | 3332 | PTDEBUG && _d('Resuming after db', $db); | ||
111 | 3333 | delete $self->{resume}->{db}; | ||
112 | 3334 | delete $self->{resume}->{tbl}; | ||
113 | 3335 | } | ||
114 | 3318 | } | 3336 | } |
115 | 3319 | 3337 | ||
116 | 3320 | return 0; | 3338 | return 0; |
117 | @@ -3326,7 +3344,7 @@ | |||
118 | 3326 | return 1 unless $self->{resume}->{tbl}; | 3344 | return 1 unless $self->{resume}->{tbl}; |
119 | 3327 | 3345 | ||
120 | 3328 | if ( $tbl eq $self->{resume}->{tbl} ) { | 3346 | if ( $tbl eq $self->{resume}->{tbl} ) { |
122 | 3329 | if ( !$self->{resume}->{after} ) { | 3347 | if ( !$self->{resume}->{after}->{tbl} ) { |
123 | 3330 | PTDEBUG && _d('Resuming from table', $tbl); | 3348 | PTDEBUG && _d('Resuming from table', $tbl); |
124 | 3331 | delete $self->{resume}->{tbl}; | 3349 | delete $self->{resume}->{tbl}; |
125 | 3332 | return 1; | 3350 | return 1; |
126 | 3333 | 3351 | ||
127 | === modified file 'bin/pt-fk-error-logger' | |||
128 | --- bin/pt-fk-error-logger 2012-12-03 03:48:11 +0000 | |||
129 | +++ bin/pt-fk-error-logger 2012-12-20 23:20:29 +0000 | |||
130 | @@ -1942,6 +1942,9 @@ | |||
131 | 1942 | . (defined $f ? '%09.6f' : '%02d'), | 1942 | . (defined $f ? '%09.6f' : '%02d'), |
132 | 1943 | $y + 2000, $m, $d, $h, $i, (defined $f ? $s + $f : $s); | 1943 | $y + 2000, $m, $d, $h, $i, (defined $f ? $s + $f : $s); |
133 | 1944 | } | 1944 | } |
134 | 1945 | elsif ( $val =~ m/^$proper_ts$/ ) { | ||
135 | 1946 | return $val; | ||
136 | 1947 | } | ||
137 | 1945 | return $val; | 1948 | return $val; |
138 | 1946 | } | 1949 | } |
139 | 1947 | 1950 | ||
140 | @@ -3609,7 +3612,8 @@ | |||
141 | 3609 | # Quick check if text even has a foreign key error. | 3612 | # Quick check if text even has a foreign key error. |
142 | 3610 | return unless $text =~ m/LATEST FOREIGN KEY ERROR/; | 3613 | return unless $text =~ m/LATEST FOREIGN KEY ERROR/; |
143 | 3611 | 3614 | ||
145 | 3612 | my $idb_ts = qr/(\d{6} .\d:\d\d:\d\d)/; # InnoDB timestamp | 3615 | # InnoDB timestamp |
146 | 3616 | my $idb_ts = qr/((?:\d{6}|\d{4}-\d\d-\d\d) .\d:\d\d:\d\d)/; | ||
147 | 3613 | 3617 | ||
148 | 3614 | my ($ts, $fke) = $text =~ m/LATEST FOREIGN KEY ERROR.+?$idb_ts\s*(.+?)---/ms; | 3618 | my ($ts, $fke) = $text =~ m/LATEST FOREIGN KEY ERROR.+?$idb_ts\s*(.+?)---/ms; |
149 | 3615 | chomp $fke if $fke; | 3619 | chomp $fke if $fke; |
150 | 3616 | 3620 | ||
151 | === modified file 'bin/pt-index-usage' | |||
152 | --- bin/pt-index-usage 2012-12-03 03:48:11 +0000 | |||
153 | +++ bin/pt-index-usage 2012-12-20 23:20:29 +0000 | |||
154 | @@ -3844,11 +3844,16 @@ | |||
155 | 3844 | 3844 | ||
156 | 3845 | if ( !$self->{initialized} ) { | 3845 | if ( !$self->{initialized} ) { |
157 | 3846 | $self->{initialized} = 1; | 3846 | $self->{initialized} = 1; |
163 | 3847 | if ( $self->{resume}->{tbl} | 3847 | if ( $self->{resume}->{tbl} ) { |
164 | 3848 | && !$self->table_is_allowed(@{$self->{resume}}{qw(db tbl)}) ) { | 3848 | if ( !$self->table_is_allowed(@{$self->{resume}}{qw(db tbl)}) ) { |
165 | 3849 | PTDEBUG && _d('Will resume after', | 3849 | PTDEBUG && _d('Will resume after', |
166 | 3850 | join('.', @{$self->{resume}}{qw(db tbl)})); | 3850 | join('.', @{$self->{resume}}{qw(db tbl)})); |
167 | 3851 | $self->{resume}->{after} = 1; | 3851 | $self->{resume}->{after}->{tbl} = 1; |
168 | 3852 | } | ||
169 | 3853 | if ( !$self->database_is_allowed($self->{resume}->{db}) ) { | ||
170 | 3854 | PTDEBUG && _d('Will resume after', $self->{resume}->{db}); | ||
171 | 3855 | $self->{resume}->{after}->{db} = 1; | ||
172 | 3856 | } | ||
173 | 3852 | } | 3857 | } |
174 | 3853 | } | 3858 | } |
175 | 3854 | 3859 | ||
176 | @@ -3946,16 +3951,17 @@ | |||
177 | 3946 | if ( !defined $self->{dbs} ) { | 3951 | if ( !defined $self->{dbs} ) { |
178 | 3947 | my $sql = 'SHOW DATABASES'; | 3952 | my $sql = 'SHOW DATABASES'; |
179 | 3948 | PTDEBUG && _d($sql); | 3953 | PTDEBUG && _d($sql); |
182 | 3949 | my @dbs = grep { $self->database_is_allowed($_) } | 3954 | my @dbs = grep { |
183 | 3950 | @{$dbh->selectcol_arrayref($sql)}; | 3955 | $self->_resume_from_database($_) |
184 | 3956 | && | ||
185 | 3957 | $self->database_is_allowed($_) | ||
186 | 3958 | } @{$dbh->selectcol_arrayref($sql)}; | ||
187 | 3951 | PTDEBUG && _d('Found', scalar @dbs, 'databases'); | 3959 | PTDEBUG && _d('Found', scalar @dbs, 'databases'); |
188 | 3952 | $self->{dbs} = \@dbs; | 3960 | $self->{dbs} = \@dbs; |
189 | 3953 | } | 3961 | } |
190 | 3954 | 3962 | ||
191 | 3955 | if ( !$self->{db} ) { | 3963 | if ( !$self->{db} ) { |
195 | 3956 | do { | 3964 | $self->{db} = shift @{$self->{dbs}}; |
193 | 3957 | $self->{db} = shift @{$self->{dbs}}; | ||
194 | 3958 | } until $self->_resume_from_database($self->{db}); | ||
196 | 3959 | PTDEBUG && _d('Next database:', $self->{db}); | 3965 | PTDEBUG && _d('Next database:', $self->{db}); |
197 | 3960 | return unless $self->{db}; | 3966 | return unless $self->{db}; |
198 | 3961 | } | 3967 | } |
199 | @@ -4057,9 +4063,15 @@ | |||
200 | 4057 | 4063 | ||
201 | 4058 | my $filter = $self->{filters}; | 4064 | my $filter = $self->{filters}; |
202 | 4059 | 4065 | ||
206 | 4060 | if ( $db eq 'mysql' && ($tbl eq 'general_log' || $tbl eq 'slow_log') ) { | 4066 | return 0 if $db eq 'mysql' && $tbl =~ m/^(?: |
207 | 4061 | return 0; | 4067 | general_log |
208 | 4062 | } | 4068 | |slow_log |
209 | 4069 | |innodb_index_stats | ||
210 | 4070 | |innodb_table_stats | ||
211 | 4071 | |slave_master_info | ||
212 | 4072 | |slave_relay_log_info | ||
213 | 4073 | |slave_worker_info | ||
214 | 4074 | )$/x; | ||
215 | 4063 | 4075 | ||
216 | 4064 | if ( $filter->{'ignore-tables'}->{$tbl} | 4076 | if ( $filter->{'ignore-tables'}->{$tbl} |
217 | 4065 | && ($filter->{'ignore-tables'}->{$tbl} eq '*' | 4077 | && ($filter->{'ignore-tables'}->{$tbl} eq '*' |
218 | @@ -4128,11 +4140,17 @@ | |||
219 | 4128 | my ($self, $db) = @_; | 4140 | my ($self, $db) = @_; |
220 | 4129 | 4141 | ||
221 | 4130 | return 1 unless $self->{resume}->{db}; | 4142 | return 1 unless $self->{resume}->{db}; |
222 | 4131 | |||
223 | 4132 | if ( $db eq $self->{resume}->{db} ) { | 4143 | if ( $db eq $self->{resume}->{db} ) { |
227 | 4133 | PTDEBUG && _d('At resume db', $db); | 4144 | if ( !$self->{resume}->{after}->{db} ) { |
228 | 4134 | delete $self->{resume}->{db}; | 4145 | PTDEBUG && _d('Resuming from db', $db); |
229 | 4135 | return 1; | 4146 | delete $self->{resume}->{db}; |
230 | 4147 | return 1; | ||
231 | 4148 | } | ||
232 | 4149 | else { | ||
233 | 4150 | PTDEBUG && _d('Resuming after db', $db); | ||
234 | 4151 | delete $self->{resume}->{db}; | ||
235 | 4152 | delete $self->{resume}->{tbl}; | ||
236 | 4153 | } | ||
237 | 4136 | } | 4154 | } |
238 | 4137 | 4155 | ||
239 | 4138 | return 0; | 4156 | return 0; |
240 | @@ -4144,7 +4162,7 @@ | |||
241 | 4144 | return 1 unless $self->{resume}->{tbl}; | 4162 | return 1 unless $self->{resume}->{tbl}; |
242 | 4145 | 4163 | ||
243 | 4146 | if ( $tbl eq $self->{resume}->{tbl} ) { | 4164 | if ( $tbl eq $self->{resume}->{tbl} ) { |
245 | 4147 | if ( !$self->{resume}->{after} ) { | 4165 | if ( !$self->{resume}->{after}->{tbl} ) { |
246 | 4148 | PTDEBUG && _d('Resuming from table', $tbl); | 4166 | PTDEBUG && _d('Resuming from table', $tbl); |
247 | 4149 | delete $self->{resume}->{tbl}; | 4167 | delete $self->{resume}->{tbl}; |
248 | 4150 | return 1; | 4168 | return 1; |
249 | 4151 | 4169 | ||
250 | === modified file 'bin/pt-mysql-summary' | |||
251 | --- bin/pt-mysql-summary 2012-12-06 00:10:22 +0000 | |||
252 | +++ bin/pt-mysql-summary 2012-12-20 23:20:29 +0000 | |||
253 | @@ -2332,8 +2332,10 @@ | |||
254 | 2332 | 2332 | ||
255 | 2333 | TOOL="pt-mysql-summary" | 2333 | TOOL="pt-mysql-summary" |
256 | 2334 | 2334 | ||
259 | 2335 | CMD_MYSQL="$(_which mysql)" | 2335 | # These vars are declared earlier in the collect_mysql_info package, |
260 | 2336 | CMD_MYSQLDUMP="$( _which mysqldump )" | 2336 | # but if they're still undefined here, try to find them in PATH. |
261 | 2337 | [ "$CMD_MYSQL" ] || CMD_MYSQL="$(_which mysql)" | ||
262 | 2338 | [ "$CMD_MYSQLDUMP" ] || CMD_MYSQLDUMP="$( _which mysqldump )" | ||
263 | 2337 | 2339 | ||
264 | 2338 | check_mysql () { | 2340 | check_mysql () { |
265 | 2339 | # Check that mysql and mysqldump are in PATH. If not, we're | 2341 | # Check that mysql and mysqldump are in PATH. If not, we're |
266 | 2340 | 2342 | ||
267 | === modified file 'bin/pt-table-checksum' | |||
268 | --- bin/pt-table-checksum 2012-12-11 14:48:44 +0000 | |||
269 | +++ bin/pt-table-checksum 2012-12-20 23:20:29 +0000 | |||
270 | @@ -6986,9 +6986,15 @@ | |||
271 | 6986 | 6986 | ||
272 | 6987 | my $filter = $self->{filters}; | 6987 | my $filter = $self->{filters}; |
273 | 6988 | 6988 | ||
277 | 6989 | if ( $db eq 'mysql' && ($tbl eq 'general_log' || $tbl eq 'slow_log') ) { | 6989 | return 0 if $db eq 'mysql' && $tbl =~ m/^(?: |
278 | 6990 | return 0; | 6990 | general_log |
279 | 6991 | } | 6991 | |slow_log |
280 | 6992 | |innodb_index_stats | ||
281 | 6993 | |innodb_table_stats | ||
282 | 6994 | |slave_master_info | ||
283 | 6995 | |slave_relay_log_info | ||
284 | 6996 | |slave_worker_info | ||
285 | 6997 | )$/x; | ||
286 | 6992 | 6998 | ||
287 | 6993 | if ( $filter->{'ignore-tables'}->{$tbl} | 6999 | if ( $filter->{'ignore-tables'}->{$tbl} |
288 | 6994 | && ($filter->{'ignore-tables'}->{$tbl} eq '*' | 7000 | && ($filter->{'ignore-tables'}->{$tbl} eq '*' |
289 | @@ -10123,9 +10129,9 @@ | |||
290 | 10123 | } | 10129 | } |
291 | 10124 | } | 10130 | } |
292 | 10125 | else { | 10131 | else { |
293 | 10132 | warn $EVAL_ERROR; | ||
294 | 10126 | die "--replicate database $db does not exist and it cannot be " | 10133 | die "--replicate database $db does not exist and it cannot be " |
297 | 10127 | . "created automatically. You need to create the database. " | 10134 | . "created automatically. You need to create the database.\n"; |
296 | 10128 | . $EVAL_ERROR; | ||
298 | 10129 | } | 10135 | } |
299 | 10130 | } | 10136 | } |
300 | 10131 | } | 10137 | } |
301 | @@ -10193,9 +10199,9 @@ | |||
302 | 10193 | } | 10199 | } |
303 | 10194 | } | 10200 | } |
304 | 10195 | else { | 10201 | else { |
305 | 10202 | warn $EVAL_ERROR; | ||
306 | 10196 | die "--replicate table $tbl does not exist and it cannot be " | 10203 | die "--replicate table $tbl does not exist and it cannot be " |
309 | 10197 | . "created automatically. You need to create the table. " | 10204 | . "created automatically. You need to create the table.\n" |
308 | 10198 | . $EVAL_ERROR; | ||
310 | 10199 | } | 10205 | } |
311 | 10200 | } | 10206 | } |
312 | 10201 | } | 10207 | } |
313 | 10202 | 10208 | ||
314 | === modified file 'bin/pt-table-sync' | |||
315 | --- bin/pt-table-sync 2012-12-03 03:48:11 +0000 | |||
316 | +++ bin/pt-table-sync 2012-12-20 23:20:29 +0000 | |||
317 | @@ -7521,11 +7521,16 @@ | |||
318 | 7521 | 7521 | ||
319 | 7522 | if ( !$self->{initialized} ) { | 7522 | if ( !$self->{initialized} ) { |
320 | 7523 | $self->{initialized} = 1; | 7523 | $self->{initialized} = 1; |
326 | 7524 | if ( $self->{resume}->{tbl} | 7524 | if ( $self->{resume}->{tbl} ) { |
327 | 7525 | && !$self->table_is_allowed(@{$self->{resume}}{qw(db tbl)}) ) { | 7525 | if ( !$self->table_is_allowed(@{$self->{resume}}{qw(db tbl)}) ) { |
328 | 7526 | PTDEBUG && _d('Will resume after', | 7526 | PTDEBUG && _d('Will resume after', |
329 | 7527 | join('.', @{$self->{resume}}{qw(db tbl)})); | 7527 | join('.', @{$self->{resume}}{qw(db tbl)})); |
330 | 7528 | $self->{resume}->{after} = 1; | 7528 | $self->{resume}->{after}->{tbl} = 1; |
331 | 7529 | } | ||
332 | 7530 | if ( !$self->database_is_allowed($self->{resume}->{db}) ) { | ||
333 | 7531 | PTDEBUG && _d('Will resume after', $self->{resume}->{db}); | ||
334 | 7532 | $self->{resume}->{after}->{db} = 1; | ||
335 | 7533 | } | ||
336 | 7529 | } | 7534 | } |
337 | 7530 | } | 7535 | } |
338 | 7531 | 7536 | ||
339 | @@ -7623,16 +7628,17 @@ | |||
340 | 7623 | if ( !defined $self->{dbs} ) { | 7628 | if ( !defined $self->{dbs} ) { |
341 | 7624 | my $sql = 'SHOW DATABASES'; | 7629 | my $sql = 'SHOW DATABASES'; |
342 | 7625 | PTDEBUG && _d($sql); | 7630 | PTDEBUG && _d($sql); |
345 | 7626 | my @dbs = grep { $self->database_is_allowed($_) } | 7631 | my @dbs = grep { |
346 | 7627 | @{$dbh->selectcol_arrayref($sql)}; | 7632 | $self->_resume_from_database($_) |
347 | 7633 | && | ||
348 | 7634 | $self->database_is_allowed($_) | ||
349 | 7635 | } @{$dbh->selectcol_arrayref($sql)}; | ||
350 | 7628 | PTDEBUG && _d('Found', scalar @dbs, 'databases'); | 7636 | PTDEBUG && _d('Found', scalar @dbs, 'databases'); |
351 | 7629 | $self->{dbs} = \@dbs; | 7637 | $self->{dbs} = \@dbs; |
352 | 7630 | } | 7638 | } |
353 | 7631 | 7639 | ||
354 | 7632 | if ( !$self->{db} ) { | 7640 | if ( !$self->{db} ) { |
358 | 7633 | do { | 7641 | $self->{db} = shift @{$self->{dbs}}; |
356 | 7634 | $self->{db} = shift @{$self->{dbs}}; | ||
357 | 7635 | } until $self->_resume_from_database($self->{db}); | ||
359 | 7636 | PTDEBUG && _d('Next database:', $self->{db}); | 7642 | PTDEBUG && _d('Next database:', $self->{db}); |
360 | 7637 | return unless $self->{db}; | 7643 | return unless $self->{db}; |
361 | 7638 | } | 7644 | } |
362 | @@ -7734,9 +7740,15 @@ | |||
363 | 7734 | 7740 | ||
364 | 7735 | my $filter = $self->{filters}; | 7741 | my $filter = $self->{filters}; |
365 | 7736 | 7742 | ||
369 | 7737 | if ( $db eq 'mysql' && ($tbl eq 'general_log' || $tbl eq 'slow_log') ) { | 7743 | return 0 if $db eq 'mysql' && $tbl =~ m/^(?: |
370 | 7738 | return 0; | 7744 | general_log |
371 | 7739 | } | 7745 | |slow_log |
372 | 7746 | |innodb_index_stats | ||
373 | 7747 | |innodb_table_stats | ||
374 | 7748 | |slave_master_info | ||
375 | 7749 | |slave_relay_log_info | ||
376 | 7750 | |slave_worker_info | ||
377 | 7751 | )$/x; | ||
378 | 7740 | 7752 | ||
379 | 7741 | if ( $filter->{'ignore-tables'}->{$tbl} | 7753 | if ( $filter->{'ignore-tables'}->{$tbl} |
380 | 7742 | && ($filter->{'ignore-tables'}->{$tbl} eq '*' | 7754 | && ($filter->{'ignore-tables'}->{$tbl} eq '*' |
381 | @@ -7805,11 +7817,17 @@ | |||
382 | 7805 | my ($self, $db) = @_; | 7817 | my ($self, $db) = @_; |
383 | 7806 | 7818 | ||
384 | 7807 | return 1 unless $self->{resume}->{db}; | 7819 | return 1 unless $self->{resume}->{db}; |
385 | 7808 | |||
386 | 7809 | if ( $db eq $self->{resume}->{db} ) { | 7820 | if ( $db eq $self->{resume}->{db} ) { |
390 | 7810 | PTDEBUG && _d('At resume db', $db); | 7821 | if ( !$self->{resume}->{after}->{db} ) { |
391 | 7811 | delete $self->{resume}->{db}; | 7822 | PTDEBUG && _d('Resuming from db', $db); |
392 | 7812 | return 1; | 7823 | delete $self->{resume}->{db}; |
393 | 7824 | return 1; | ||
394 | 7825 | } | ||
395 | 7826 | else { | ||
396 | 7827 | PTDEBUG && _d('Resuming after db', $db); | ||
397 | 7828 | delete $self->{resume}->{db}; | ||
398 | 7829 | delete $self->{resume}->{tbl}; | ||
399 | 7830 | } | ||
400 | 7813 | } | 7831 | } |
401 | 7814 | 7832 | ||
402 | 7815 | return 0; | 7833 | return 0; |
403 | @@ -7821,7 +7839,7 @@ | |||
404 | 7821 | return 1 unless $self->{resume}->{tbl}; | 7839 | return 1 unless $self->{resume}->{tbl}; |
405 | 7822 | 7840 | ||
406 | 7823 | if ( $tbl eq $self->{resume}->{tbl} ) { | 7841 | if ( $tbl eq $self->{resume}->{tbl} ) { |
408 | 7824 | if ( !$self->{resume}->{after} ) { | 7842 | if ( !$self->{resume}->{after}->{tbl} ) { |
409 | 7825 | PTDEBUG && _d('Resuming from table', $tbl); | 7843 | PTDEBUG && _d('Resuming from table', $tbl); |
410 | 7826 | delete $self->{resume}->{tbl}; | 7844 | delete $self->{resume}->{tbl}; |
411 | 7827 | return 1; | 7845 | return 1; |
412 | 7828 | 7846 | ||
413 | === modified file 'bin/pt-table-usage' | |||
414 | --- bin/pt-table-usage 2012-11-19 18:47:13 +0000 | |||
415 | +++ bin/pt-table-usage 2012-12-20 23:20:29 +0000 | |||
416 | @@ -212,7 +212,8 @@ | |||
417 | 212 | . join(';', map { "$opts{$_}->{dsn}=$info->{$_}" } | 212 | . join(';', map { "$opts{$_}->{dsn}=$info->{$_}" } |
418 | 213 | grep { defined $info->{$_} } | 213 | grep { defined $info->{$_} } |
419 | 214 | qw(F h P S A)) | 214 | qw(F h P S A)) |
421 | 215 | . ';mysql_read_default_group=client'; | 215 | . ';mysql_read_default_group=client' |
422 | 216 | . ($info->{L} ? ';mysql_local_infile=1' : ''); | ||
423 | 216 | } | 217 | } |
424 | 217 | PTDEBUG && _d($dsn); | 218 | PTDEBUG && _d($dsn); |
425 | 218 | return ($dsn, $info->{u}, $info->{p}); | 219 | return ($dsn, $info->{u}, $info->{p}); |
426 | @@ -241,6 +242,9 @@ | |||
427 | 241 | mysql_enable_utf8 => ($cxn_string =~ m/charset=utf8/i ? 1 : 0), | 242 | mysql_enable_utf8 => ($cxn_string =~ m/charset=utf8/i ? 1 : 0), |
428 | 242 | }; | 243 | }; |
429 | 243 | @{$defaults}{ keys %$opts } = values %$opts; | 244 | @{$defaults}{ keys %$opts } = values %$opts; |
430 | 245 | if (delete $defaults->{L}) { # L for LOAD DATA LOCAL INFILE, our own extension | ||
431 | 246 | $defaults->{mysql_local_infile} = 1; | ||
432 | 247 | } | ||
433 | 244 | 248 | ||
434 | 245 | if ( $opts->{mysql_use_result} ) { | 249 | if ( $opts->{mysql_use_result} ) { |
435 | 246 | $defaults->{mysql_use_result} = 1; | 250 | $defaults->{mysql_use_result} = 1; |
436 | 247 | 251 | ||
437 | === modified file 'bin/pt-upgrade' | |||
438 | --- bin/pt-upgrade 2012-12-03 03:48:11 +0000 | |||
439 | +++ bin/pt-upgrade 2012-12-20 23:20:29 +0000 | |||
440 | @@ -11980,7 +11980,8 @@ | |||
441 | 11980 | # ######################################################################## | 11980 | # ######################################################################## |
442 | 11981 | # Do the version-check | 11981 | # Do the version-check |
443 | 11982 | # ######################################################################## | 11982 | # ######################################################################## |
445 | 11983 | if ( $o->get('version-check') ne 'off' && (!$o->has('quiet') || !$o->get('quiet')) ) { | 11983 | if ( $o->get('version-check') ne 'off' |
446 | 11984 | && (!$o->has('quiet') || !$o->get('quiet')) ) { | ||
447 | 11984 | Pingback::version_check( | 11985 | Pingback::version_check( |
448 | 11985 | instances => [ map({ +{ dbh => $_->{dbh}, dsn => $_->{dsn} } } @$hosts) ], | 11986 | instances => [ map({ +{ dbh => $_->{dbh}, dsn => $_->{dsn} } } @$hosts) ], |
449 | 11986 | protocol => $o->get('version-check'), | 11987 | protocol => $o->get('version-check'), |
450 | @@ -11988,6 +11989,15 @@ | |||
451 | 11988 | } | 11989 | } |
452 | 11989 | 11990 | ||
453 | 11990 | # ######################################################################## | 11991 | # ######################################################################## |
454 | 11992 | # Disable the query cache. | ||
455 | 11993 | # ######################################################################## | ||
456 | 11994 | if ( $o->get('disable-query-cache') ) { | ||
457 | 11995 | foreach my $host ( @$hosts ) { | ||
458 | 11996 | disable_query_cache($host); | ||
459 | 11997 | } | ||
460 | 11998 | } | ||
461 | 11999 | |||
462 | 12000 | # ######################################################################## | ||
463 | 11991 | # Short version: do it! Long version: this callback does the main work. | 12001 | # Short version: do it! Long version: this callback does the main work. |
464 | 11992 | # The big picture is: | 12002 | # The big picture is: |
465 | 11993 | # [event] -> exec on hosts -> compare -> aggregate -> [meta-event] | 12003 | # [event] -> exec on hosts -> compare -> aggregate -> [meta-event] |
466 | @@ -12385,6 +12395,31 @@ | |||
467 | 12385 | return $dbh; | 12395 | return $dbh; |
468 | 12386 | } | 12396 | } |
469 | 12387 | 12397 | ||
470 | 12398 | sub disable_query_cache { | ||
471 | 12399 | my ($host) = @_; | ||
472 | 12400 | die "I need a host argument" unless $host; | ||
473 | 12401 | my ($dbh, $host_name) = @{$host}{qw(dbh name)}; | ||
474 | 12402 | |||
475 | 12403 | my $sql = 'SELECT @@query_cache_type'; | ||
476 | 12404 | PTDEBUG && _d($host_name, $sql); | ||
477 | 12405 | my ($query_cache_type) = $dbh->selectrow_array($sql); | ||
478 | 12406 | PTDEBUG && _d($host_name, $query_cache_type); | ||
479 | 12407 | return if ($query_cache_type || '') =~ m/OFF|0/; | ||
480 | 12408 | |||
481 | 12409 | $sql = q/SET SESSION query_cache_type = OFF/; | ||
482 | 12410 | eval { | ||
483 | 12411 | PTDEBUG && _d($host_name, $sql); | ||
484 | 12412 | $dbh->do($sql); | ||
485 | 12413 | }; | ||
486 | 12414 | if ( $EVAL_ERROR ) { | ||
487 | 12415 | warn $EVAL_ERROR; | ||
488 | 12416 | die "Failed to $sql on $host_name. Disable the query cache " | ||
489 | 12417 | . "manually, or specify --no-disable-query-cache.\n"; | ||
490 | 12418 | } | ||
491 | 12419 | |||
492 | 12420 | return; | ||
493 | 12421 | } | ||
494 | 12422 | |||
495 | 12388 | # Catches signals so we can exit gracefully. | 12423 | # Catches signals so we can exit gracefully. |
496 | 12389 | sub sig_int { | 12424 | sub sig_int { |
497 | 12390 | my ( $signal ) = @_; | 12425 | my ( $signal ) = @_; |
498 | @@ -12693,6 +12728,12 @@ | |||
499 | 12693 | Fork to the background and detach from the shell. POSIX | 12728 | Fork to the background and detach from the shell. POSIX |
500 | 12694 | operating systems only. | 12729 | operating systems only. |
501 | 12695 | 12730 | ||
502 | 12731 | =item --[no]disable-query-cache | ||
503 | 12732 | |||
504 | 12733 | default: yes | ||
505 | 12734 | |||
506 | 12735 | C<SET SESSION query_cache_type = OFF> to disable the query cache. | ||
507 | 12736 | |||
508 | 12696 | =item --explain-hosts | 12737 | =item --explain-hosts |
509 | 12697 | 12738 | ||
510 | 12698 | Print connection information and exit. | 12739 | Print connection information and exit. |
511 | @@ -12861,7 +12902,7 @@ | |||
512 | 12861 | 12902 | ||
513 | 12862 | =item --set-vars | 12903 | =item --set-vars |
514 | 12863 | 12904 | ||
516 | 12864 | type: string; default: wait_timeout=10000,query_cache_type=0 | 12905 | type: string; default: wait_timeout=10000 |
517 | 12865 | 12906 | ||
518 | 12866 | Set these MySQL variables. Immediately after connecting to MySQL, this | 12907 | Set these MySQL variables. Immediately after connecting to MySQL, this |
519 | 12867 | string will be appended to SET and executed. | 12908 | string will be appended to SET and executed. |
520 | 12868 | 12909 | ||
521 | === modified file 'bin/pt-visual-explain' | |||
522 | --- bin/pt-visual-explain 2012-11-19 18:47:13 +0000 | |||
523 | +++ bin/pt-visual-explain 2012-12-20 23:20:29 +0000 | |||
524 | @@ -1900,7 +1900,8 @@ | |||
525 | 1900 | . join(';', map { "$opts{$_}->{dsn}=$info->{$_}" } | 1900 | . join(';', map { "$opts{$_}->{dsn}=$info->{$_}" } |
526 | 1901 | grep { defined $info->{$_} } | 1901 | grep { defined $info->{$_} } |
527 | 1902 | qw(F h P S A)) | 1902 | qw(F h P S A)) |
529 | 1903 | . ';mysql_read_default_group=client'; | 1903 | . ';mysql_read_default_group=client' |
530 | 1904 | . ($info->{L} ? ';mysql_local_infile=1' : ''); | ||
531 | 1904 | } | 1905 | } |
532 | 1905 | PTDEBUG && _d($dsn); | 1906 | PTDEBUG && _d($dsn); |
533 | 1906 | return ($dsn, $info->{u}, $info->{p}); | 1907 | return ($dsn, $info->{u}, $info->{p}); |
534 | @@ -1929,6 +1930,9 @@ | |||
535 | 1929 | mysql_enable_utf8 => ($cxn_string =~ m/charset=utf8/i ? 1 : 0), | 1930 | mysql_enable_utf8 => ($cxn_string =~ m/charset=utf8/i ? 1 : 0), |
536 | 1930 | }; | 1931 | }; |
537 | 1931 | @{$defaults}{ keys %$opts } = values %$opts; | 1932 | @{$defaults}{ keys %$opts } = values %$opts; |
538 | 1933 | if (delete $defaults->{L}) { # L for LOAD DATA LOCAL INFILE, our own extension | ||
539 | 1934 | $defaults->{mysql_local_infile} = 1; | ||
540 | 1935 | } | ||
541 | 1932 | 1936 | ||
542 | 1933 | if ( $opts->{mysql_use_result} ) { | 1937 | if ( $opts->{mysql_use_result} ) { |
543 | 1934 | $defaults->{mysql_use_result} = 1; | 1938 | $defaults->{mysql_use_result} = 1; |
544 | 1935 | 1939 | ||
545 | === modified file 'lib/Sandbox.pm' | |||
546 | --- lib/Sandbox.pm 2012-11-30 18:13:04 +0000 | |||
547 | +++ lib/Sandbox.pm 2012-12-20 23:20:29 +0000 | |||
548 | @@ -126,12 +126,13 @@ | |||
549 | 126 | } | 126 | } |
550 | 127 | 127 | ||
551 | 128 | sub get_dbh_for { | 128 | sub get_dbh_for { |
553 | 129 | my ( $self, $server, $cxn_ops ) = @_; | 129 | my ( $self, $server, $cxn_ops, $user ) = @_; |
554 | 130 | _check_server($server); | 130 | _check_server($server); |
555 | 131 | $cxn_ops ||= { AutoCommit => 1 }; | 131 | $cxn_ops ||= { AutoCommit => 1 }; |
556 | 132 | $user ||= 'msandbox'; | ||
557 | 132 | PTDEBUG && _d('dbh for', $server, 'on port', $port_for{$server}); | 133 | PTDEBUG && _d('dbh for', $server, 'on port', $port_for{$server}); |
558 | 133 | my $dp = $self->{DSNParser}; | 134 | my $dp = $self->{DSNParser}; |
560 | 134 | my $dsn = $dp->parse('h=127.0.0.1,u=msandbox,p=msandbox,P=' . $port_for{$server}); | 135 | my $dsn = $dp->parse("h=127.0.0.1,u=$user,p=msandbox,P=" . $port_for{$server}); |
561 | 135 | my $dbh; | 136 | my $dbh; |
562 | 136 | # This is primarily for the benefit of CompareResults, but it's | 137 | # This is primarily for the benefit of CompareResults, but it's |
563 | 137 | # also quite convenient when using an affected OS | 138 | # also quite convenient when using an affected OS |
564 | @@ -335,11 +336,11 @@ | |||
565 | 335 | my $master_dbh = $self->get_dbh_for($args{master} || 'master'); | 336 | my $master_dbh = $self->get_dbh_for($args{master} || 'master'); |
566 | 336 | my $slave2_dbh = $self->get_dbh_for($args{slave} || 'slave2'); | 337 | my $slave2_dbh = $self->get_dbh_for($args{slave} || 'slave2'); |
567 | 337 | my ($ping) = $master_dbh->selectrow_array("SELECT MD5(RAND())"); | 338 | my ($ping) = $master_dbh->selectrow_array("SELECT MD5(RAND())"); |
569 | 338 | $master_dbh->do("UPDATE percona_test.sentinel SET ping='$ping' WHERE id=1"); | 339 | $master_dbh->do("UPDATE percona_test.sentinel SET ping='$ping' WHERE id=1 /* wait_for_slaves */"); |
570 | 339 | PerconaTest::wait_until( | 340 | PerconaTest::wait_until( |
571 | 340 | sub { | 341 | sub { |
572 | 341 | my ($pong) = $slave2_dbh->selectrow_array( | 342 | my ($pong) = $slave2_dbh->selectrow_array( |
574 | 342 | "SELECT ping FROM percona_test.sentinel WHERE id=1"); | 343 | "SELECT ping FROM percona_test.sentinel WHERE id=1 /* wait_for_slaves */"); |
575 | 343 | return $ping eq $pong; | 344 | return $ping eq $pong; |
576 | 344 | }, undef, 300 | 345 | }, undef, 300 |
577 | 345 | ); | 346 | ); |
578 | @@ -542,6 +543,23 @@ | |||
579 | 542 | return "/tmp/$port/my.sandbox.cnf" | 543 | return "/tmp/$port/my.sandbox.cnf" |
580 | 543 | } | 544 | } |
581 | 544 | 545 | ||
582 | 546 | sub do_as_root { | ||
583 | 547 | my ($self, $server, @queries) = @_; | ||
584 | 548 | my $dbh = $self->get_dbh_for($server, undef, 'root'); | ||
585 | 549 | my $ok = 1; | ||
586 | 550 | eval { | ||
587 | 551 | foreach my $query ( @queries ) { | ||
588 | 552 | $dbh->do($query); | ||
589 | 553 | } | ||
590 | 554 | }; | ||
591 | 555 | if ( $EVAL_ERROR ) { | ||
592 | 556 | $ok = 0; | ||
593 | 557 | warn $EVAL_ERROR; | ||
594 | 558 | } | ||
595 | 559 | $dbh->disconnect; | ||
596 | 560 | return $ok; | ||
597 | 561 | } | ||
598 | 562 | |||
599 | 545 | sub _d { | 563 | sub _d { |
600 | 546 | my ($package, undef, $line) = caller 0; | 564 | my ($package, undef, $line) = caller 0; |
601 | 547 | @_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; } | 565 | @_ = map { (my $temp = $_) =~ s/\n/\n# /g; $temp; } |
602 | 548 | 566 | ||
603 | === modified file 'lib/SchemaIterator.pm' | |||
604 | --- lib/SchemaIterator.pm 2012-12-05 23:30:29 +0000 | |||
605 | +++ lib/SchemaIterator.pm 2012-12-20 23:20:29 +0000 | |||
606 | @@ -444,9 +444,15 @@ | |||
607 | 444 | my $filter = $self->{filters}; | 444 | my $filter = $self->{filters}; |
608 | 445 | 445 | ||
609 | 446 | # Always auto-skip these pseudo tables. | 446 | # Always auto-skip these pseudo tables. |
613 | 447 | if ( $db eq 'mysql' && ($tbl eq 'general_log' || $tbl eq 'slow_log') ) { | 447 | return 0 if $db eq 'mysql' && $tbl =~ m/^(?: |
614 | 448 | return 0; | 448 | general_log |
615 | 449 | } | 449 | |slow_log |
616 | 450 | |innodb_index_stats | ||
617 | 451 | |innodb_table_stats | ||
618 | 452 | |slave_master_info | ||
619 | 453 | |slave_relay_log_info | ||
620 | 454 | |slave_worker_info | ||
621 | 455 | )$/x; | ||
622 | 450 | 456 | ||
623 | 451 | if ( $filter->{'ignore-tables'}->{$tbl} | 457 | if ( $filter->{'ignore-tables'}->{$tbl} |
624 | 452 | && ($filter->{'ignore-tables'}->{$tbl} eq '*' | 458 | && ($filter->{'ignore-tables'}->{$tbl} eq '*' |
625 | 453 | 459 | ||
626 | === modified file 'lib/Transformers.pm' | |||
627 | --- lib/Transformers.pm 2012-02-07 14:07:41 +0000 | |||
628 | +++ lib/Transformers.pm 2012-12-20 23:20:29 +0000 | |||
629 | @@ -193,6 +193,10 @@ | |||
630 | 193 | . (defined $f ? '%09.6f' : '%02d'), | 193 | . (defined $f ? '%09.6f' : '%02d'), |
631 | 194 | $y + 2000, $m, $d, $h, $i, (defined $f ? $s + $f : $s); | 194 | $y + 2000, $m, $d, $h, $i, (defined $f ? $s + $f : $s); |
632 | 195 | } | 195 | } |
633 | 196 | # MySQL 5.6+ uses "proper" timestamps | ||
634 | 197 | elsif ( $val =~ m/^$proper_ts$/ ) { | ||
635 | 198 | return $val; | ||
636 | 199 | } | ||
637 | 196 | return $val; | 200 | return $val; |
638 | 197 | } | 201 | } |
639 | 198 | 202 | ||
640 | 199 | 203 | ||
641 | === modified file 'sandbox/servers/5.6/data.tar.gz' | |||
642 | 200 | Binary files sandbox/servers/5.6/data.tar.gz 2012-10-16 15:13:19 +0000 and sandbox/servers/5.6/data.tar.gz 2012-12-20 23:20:29 +0000 differ | 204 | Binary files sandbox/servers/5.6/data.tar.gz 2012-10-16 15:13:19 +0000 and sandbox/servers/5.6/data.tar.gz 2012-12-20 23:20:29 +0000 differ |
643 | === modified file 'sandbox/start-sandbox' | |||
644 | --- sandbox/start-sandbox 2012-12-11 21:43:45 +0000 | |||
645 | +++ sandbox/start-sandbox 2012-12-20 23:20:29 +0000 | |||
646 | @@ -34,7 +34,7 @@ | |||
647 | 34 | cp $PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version/my.sandbox.cnf /tmp/$port | 34 | cp $PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version/my.sandbox.cnf /tmp/$port |
648 | 35 | tar xzf $PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version/data.tar.gz -C /tmp/$port | 35 | tar xzf $PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version/data.tar.gz -C /tmp/$port |
649 | 36 | 36 | ||
651 | 37 | for script in `ls $PERCONA_TOOLKIT_BRANCH/sandbox/servers/*`; do | 37 | for script in "$PERCONA_TOOLKIT_BRANCH/sandbox/servers/"*; do |
652 | 38 | if [ -f $script ]; then | 38 | if [ -f $script ]; then |
653 | 39 | cp $script /tmp/$port | 39 | cp $script /tmp/$port |
654 | 40 | fi | 40 | fi |
655 | @@ -89,6 +89,9 @@ | |||
656 | 89 | if [ -n "$SKIP_INNODB" ]; then | 89 | if [ -n "$SKIP_INNODB" ]; then |
657 | 90 | echo "skip-innodb" >> /tmp/$port/my.sandbox.cnf | 90 | echo "skip-innodb" >> /tmp/$port/my.sandbox.cnf |
658 | 91 | echo "default-storage-engine=myisam" >> /tmp/$port/my.sandbox.cnf | 91 | echo "default-storage-engine=myisam" >> /tmp/$port/my.sandbox.cnf |
659 | 92 | if [ "$version" ">" "5.5" ]; then | ||
660 | 93 | echo "default-tmp-storage-engine=myisam" >> /tmp/$port/my.sandbox.cnf | ||
661 | 94 | fi | ||
662 | 92 | fi | 95 | fi |
663 | 93 | if [ -n "$MODE_ANSI" ]; then | 96 | if [ -n "$MODE_ANSI" ]; then |
664 | 94 | echo "sql_mode=ansi" >> /tmp/$port/my.sandbox.cnf | 97 | echo "sql_mode=ansi" >> /tmp/$port/my.sandbox.cnf |
665 | @@ -99,6 +102,10 @@ | |||
666 | 99 | if [ -n "$LOCAL_INFILE" ]; then | 102 | if [ -n "$LOCAL_INFILE" ]; then |
667 | 100 | echo "local-infile=$LOCAL_INFILE" >> /tmp/$port/my.sandbox.cnf | 103 | echo "local-infile=$LOCAL_INFILE" >> /tmp/$port/my.sandbox.cnf |
668 | 101 | fi | 104 | fi |
669 | 105 | if [ -n "$QUERY_CACHE_SIZE" ]; then | ||
670 | 106 | echo "query_cache_type=1" >> /tmp/$port/my.sandbox.cnf | ||
671 | 107 | echo "query_cache_size=$QUERY_CACHE_SIZE" >> /tmp/$port/my.sandbox.cnf | ||
672 | 108 | fi | ||
673 | 102 | 109 | ||
674 | 103 | # If the sandbox is a slave, set it read_only. | 110 | # If the sandbox is a slave, set it read_only. |
675 | 104 | if [ "$type" = "slave" ]; then | 111 | if [ "$type" = "slave" ]; then |
676 | @@ -116,13 +123,21 @@ | |||
677 | 116 | debug_sandbox $port | 123 | debug_sandbox $port |
678 | 117 | exit 1 | 124 | exit 1 |
679 | 118 | fi | 125 | fi |
680 | 126 | |||
681 | 127 | for sql in "$PERCONA_TOOLKIT_BRANCH/sandbox/servers/$version/"*.sql; do | ||
682 | 128 | [ -f "$sql" ] && /tmp/$port/use < $sql | ||
683 | 129 | done | ||
684 | 119 | fi | 130 | fi |
685 | 120 | else | 131 | else |
686 | 121 | echo "Sandbox $type $port failed to start." >&2 | 132 | echo "Sandbox $type $port failed to start." >&2 |
687 | 122 | debug_sandbox $port | 133 | debug_sandbox $port |
688 | 123 | exit 1 | 134 | exit 1 |
689 | 124 | fi | 135 | fi |
691 | 125 | 136 | ||
692 | 137 | /tmp/$port/use -e "CREATE DATABASE IF NOT EXISTS percona_test"; | ||
693 | 138 | /tmp/$port/use -e "CREATE TABLE IF NOT EXISTS percona_test.sentinel (id INT PRIMARY KEY, ping VARCHAR(64) NOT NULL DEFAULT '')"; | ||
694 | 139 | /tmp/$port/use -e "REPLACE INTO percona_test.sentinel (id, ping) VALUES (1, '')"; | ||
695 | 140 | |||
696 | 126 | # If the sandbox is a slave, start the slave. | 141 | # If the sandbox is a slave, start the slave. |
697 | 127 | if [ "$type" = "slave" ]; then | 142 | if [ "$type" = "slave" ]; then |
698 | 128 | /tmp/$port/use -e "change master to master_host='127.0.0.1', master_user='msandbox', master_password='msandbox', master_port=$master_port" | 143 | /tmp/$port/use -e "change master to master_host='127.0.0.1', master_user='msandbox', master_password='msandbox', master_port=$master_port" |
699 | 129 | 144 | ||
700 | === modified file 'sandbox/test-env' | |||
701 | --- sandbox/test-env 2012-12-11 21:43:45 +0000 | |||
702 | +++ sandbox/test-env 2012-12-20 23:20:29 +0000 | |||
703 | @@ -334,11 +334,10 @@ | |||
704 | 334 | ../util/check-load-data | 334 | ../util/check-load-data |
705 | 335 | 335 | ||
706 | 336 | ping=$(/tmp/12345/use -ss -e "SELECT MD5(RAND())") | 336 | ping=$(/tmp/12345/use -ss -e "SELECT MD5(RAND())") |
709 | 337 | /tmp/12345/use -e "create table percona_test.sentinel(id int primary key, ping varchar(64) not null default '')" | 337 | /tmp/12345/use -e "UPDATE percona_test.sentinel SET ping='$ping' WHERE id=1"; |
708 | 338 | /tmp/12345/use -e "insert into percona_test.sentinel(id, ping) values(1, '$ping')"; | ||
710 | 339 | echo -n "Waiting for replication to finish..." | 338 | echo -n "Waiting for replication to finish..." |
711 | 340 | for i in $(_seq 60); do | 339 | for i in $(_seq 60); do |
713 | 341 | pong=$(/tmp/12347/use -ss -e 'select ping from percona_test.sentinel where id=1' 2>/dev/null) | 340 | pong=$(/tmp/12347/use -ss -e 'SELECT ping FROM percona_test.sentinel WHERE id=1' 2>/dev/null) |
714 | 342 | [ "$ping" = "$pong" ] && break | 341 | [ "$ping" = "$pong" ] && break |
715 | 343 | echo -n '.' | 342 | echo -n '.' |
716 | 344 | sleep 1 | 343 | sleep 1 |
717 | 345 | 344 | ||
718 | === modified file 't/lib/ExplainAnalyzer.t' | |||
719 | --- t/lib/ExplainAnalyzer.t 2012-06-03 17:54:32 +0000 | |||
720 | +++ t/lib/ExplainAnalyzer.t 2012-12-20 23:20:29 +0000 | |||
721 | @@ -31,9 +31,6 @@ | |||
722 | 31 | if ( !$dbh ) { | 31 | if ( !$dbh ) { |
723 | 32 | plan skip_all => "Cannot connect to sandbox master"; | 32 | plan skip_all => "Cannot connect to sandbox master"; |
724 | 33 | } | 33 | } |
725 | 34 | else { | ||
726 | 35 | plan tests => 17; | ||
727 | 36 | } | ||
728 | 37 | 34 | ||
729 | 38 | $dbh->do('use sakila'); | 35 | $dbh->do('use sakila'); |
730 | 39 | 36 | ||
731 | @@ -60,7 +57,7 @@ | |||
732 | 60 | key_len => 2, | 57 | key_len => 2, |
733 | 61 | ref => 'const', | 58 | ref => 'const', |
734 | 62 | rows => 1, | 59 | rows => 1, |
736 | 63 | Extra => '', | 60 | Extra => $sandbox_version eq '5.6' ? undef : '', |
737 | 64 | }, | 61 | }, |
738 | 65 | ], | 62 | ], |
739 | 66 | 'Got a simple EXPLAIN result', | 63 | 'Got a simple EXPLAIN result', |
740 | @@ -81,7 +78,7 @@ | |||
741 | 81 | key_len => 2, | 78 | key_len => 2, |
742 | 82 | ref => 'const', | 79 | ref => 'const', |
743 | 83 | rows => 1, | 80 | rows => 1, |
745 | 84 | Extra => '', | 81 | Extra => $sandbox_version eq '5.6' ? undef : '', |
746 | 85 | }, | 82 | }, |
747 | 86 | ], | 83 | ], |
748 | 87 | 'Got EXPLAIN result for a DELETE', | 84 | 'Got EXPLAIN result for a DELETE', |
749 | @@ -575,4 +572,4 @@ | |||
750 | 575 | # Done. | 572 | # Done. |
751 | 576 | # ############################################################################# | 573 | # ############################################################################# |
752 | 577 | ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); | 574 | ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); |
754 | 578 | exit; | 575 | done_testing; |
755 | 579 | 576 | ||
756 | === modified file 't/lib/NibbleIterator.t' | |||
757 | --- t/lib/NibbleIterator.t 2012-11-28 22:00:30 +0000 | |||
758 | +++ t/lib/NibbleIterator.t 2012-12-20 23:20:29 +0000 | |||
759 | @@ -713,8 +713,8 @@ | |||
760 | 713 | # ############################################################################ | 713 | # ############################################################################ |
761 | 714 | $ni = make_nibble_iter( | 714 | $ni = make_nibble_iter( |
762 | 715 | db => 'mysql', | 715 | db => 'mysql', |
765 | 716 | tbl => 'host', | 716 | tbl => 'columns_priv', |
766 | 717 | argv => [qw(--tables mysql.host --chunk-size-limit 0)], | 717 | argv => [qw(--tables mysql.columns_priv --chunk-size-limit 0)], |
767 | 718 | ); | 718 | ); |
768 | 719 | 719 | ||
769 | 720 | @rows = (); | 720 | @rows = (); |
770 | 721 | 721 | ||
771 | === modified file 't/lib/QueryReportFormatter.t' | |||
772 | --- t/lib/QueryReportFormatter.t 2012-11-15 18:17:03 +0000 | |||
773 | +++ t/lib/QueryReportFormatter.t 2012-12-20 23:20:29 +0000 | |||
774 | @@ -1141,9 +1141,9 @@ | |||
775 | 1141 | ); | 1141 | ); |
776 | 1142 | 1142 | ||
777 | 1143 | my $explain = load_file( | 1143 | my $explain = load_file( |
781 | 1144 | $sandbox_version ge '5.1' | 1144 | $sandbox_version eq '5.6' ? "t/lib/samples/QueryReportFormatter/report031.txt" |
782 | 1145 | ? "t/lib/samples/QueryReportFormatter/report025.txt" | 1145 | : $sandbox_version ge '5.1' ? "t/lib/samples/QueryReportFormatter/report025.txt" |
783 | 1146 | : "t/lib/samples/QueryReportFormatter/report026.txt"); | 1146 | : "t/lib/samples/QueryReportFormatter/report026.txt"); |
784 | 1147 | 1147 | ||
785 | 1148 | is( | 1148 | is( |
786 | 1149 | $qrf->explain_report("select * from qrf.t where i=2", 'qrf'), | 1149 | $qrf->explain_report("select * from qrf.t where i=2", 'qrf'), |
787 | @@ -1180,11 +1180,13 @@ | |||
788 | 1180 | # so if it doesn't USE db then the EXPLAIN will fail. Here we reset | 1180 | # so if it doesn't USE db then the EXPLAIN will fail. Here we reset |
789 | 1181 | # the db to something else because we already called explain_report() | 1181 | # the db to something else because we already called explain_report() |
790 | 1182 | # above which did USE qrf. | 1182 | # above which did USE qrf. |
791 | 1183 | # | ||
792 | 1184 | # 5.6 really is that different: ia vs. TF>aI. It's smarter. | ||
793 | 1183 | $dbh->do("USE mysql"); | 1185 | $dbh->do("USE mysql"); |
794 | 1184 | my $explain_sparkline = $qrf->explain_sparkline($arg, 'qrf'); | 1186 | my $explain_sparkline = $qrf->explain_sparkline($arg, 'qrf'); |
795 | 1185 | is( | 1187 | is( |
796 | 1186 | $explain_sparkline, | 1188 | $explain_sparkline, |
798 | 1187 | "TF>aI", | 1189 | $sandbox_version eq '5.6' ? "ia" : "TF>aI", |
799 | 1188 | "explain_sparkling() uses db" | 1190 | "explain_sparkling() uses db" |
800 | 1189 | ); | 1191 | ); |
801 | 1190 | 1192 | ||
802 | @@ -1206,9 +1208,9 @@ | |||
803 | 1206 | groupby => 'fingerprint', | 1208 | groupby => 'fingerprint', |
804 | 1207 | ); | 1209 | ); |
805 | 1208 | }, | 1210 | }, |
809 | 1209 | ($sandbox_version ge '5.1' ? | 1211 | ( $sandbox_version eq '5.6' ? "t/lib/samples/QueryReportFormatter/report032.txt" |
810 | 1210 | "t/lib/samples/QueryReportFormatter/report027.txt" | 1212 | : $sandbox_version ge '5.1' ? "t/lib/samples/QueryReportFormatter/report027.txt" |
811 | 1211 | : "t/lib/samples/QueryReportFormatter/report029.txt"), | 1213 | : "t/lib/samples/QueryReportFormatter/report029.txt"), |
812 | 1212 | ), | 1214 | ), |
813 | 1213 | "EXPLAIN sparkline (issue 1141)" | 1215 | "EXPLAIN sparkline (issue 1141)" |
814 | 1214 | ); | 1216 | ); |
815 | 1215 | 1217 | ||
816 | === modified file 't/lib/SchemaIterator.t' | |||
817 | --- t/lib/SchemaIterator.t 2012-12-05 23:30:29 +0000 | |||
818 | +++ t/lib/SchemaIterator.t 2012-12-20 23:20:29 +0000 | |||
819 | @@ -149,9 +149,7 @@ | |||
820 | 149 | # Test simple, unfiltered get_db_itr(). | 149 | # Test simple, unfiltered get_db_itr(). |
821 | 150 | # ######################################################################## | 150 | # ######################################################################## |
822 | 151 | test_so( | 151 | test_so( |
826 | 152 | result => $sandbox_version ge '5.5' ? "$out/all-dbs-tbls.txt" | 152 | result => "$out/all-dbs-tbls-$sandbox_version.txt", |
824 | 153 | : $sandbox_version ge '5.1' ? "$out/all-dbs-tbls-5.1.txt" | ||
825 | 154 | : "$out/all-dbs-tbls-5.0.txt", | ||
827 | 155 | test_name => "Iterate all schema objects with dbh", | 153 | test_name => "Iterate all schema objects with dbh", |
828 | 156 | ); | 154 | ); |
829 | 157 | 155 | ||
830 | @@ -331,9 +329,7 @@ | |||
831 | 331 | # ######################################################################## | 329 | # ######################################################################## |
832 | 332 | test_so( | 330 | test_so( |
833 | 333 | filters => [qw(-t mysql.user)], | 331 | filters => [qw(-t mysql.user)], |
837 | 334 | result => $sandbox_version ge '5.5' ? "$out/mysql-user-ddl-5.5.txt" | 332 | result => "$out/mysql-user-ddl-$sandbox_version.txt", |
835 | 335 | : $sandbox_version ge '5.1' ? "$out/mysql-user-ddl.txt" | ||
836 | 336 | : "$out/mysql-user-ddl-5.0.txt", | ||
838 | 337 | test_name => "Get CREATE TABLE with dbh", | 333 | test_name => "Get CREATE TABLE with dbh", |
839 | 338 | ); | 334 | ); |
840 | 339 | 335 | ||
841 | 340 | 336 | ||
842 | === added file 't/lib/samples/QueryReportFormatter/report031.txt' | |||
843 | --- t/lib/samples/QueryReportFormatter/report031.txt 1970-01-01 00:00:00 +0000 | |||
844 | +++ t/lib/samples/QueryReportFormatter/report031.txt 2012-12-20 23:20:29 +0000 | |||
845 | @@ -0,0 +1,12 @@ | |||
846 | 1 | # *************************** 1. row *************************** | ||
847 | 2 | # id: 1 | ||
848 | 3 | # select_type: SIMPLE | ||
849 | 4 | # table: t | ||
850 | 5 | # partitions: NULL | ||
851 | 6 | # type: const | ||
852 | 7 | # possible_keys: PRIMARY | ||
853 | 8 | # key: PRIMARY | ||
854 | 9 | # key_len: 4 | ||
855 | 10 | # ref: const | ||
856 | 11 | # rows: 1 | ||
857 | 12 | # Extra: NULL | ||
858 | 0 | 13 | ||
859 | === added file 't/lib/samples/QueryReportFormatter/report032.txt' | |||
860 | --- t/lib/samples/QueryReportFormatter/report032.txt 1970-01-01 00:00:00 +0000 | |||
861 | +++ t/lib/samples/QueryReportFormatter/report032.txt 2012-12-20 23:20:29 +0000 | |||
862 | @@ -0,0 +1,58 @@ | |||
863 | 1 | |||
864 | 2 | # Profile | ||
865 | 3 | # Rank Query ID Response time Calls R/Call Apdx V/M EXPLAIN Item | ||
866 | 4 | # ==== ================== ============= ===== ====== ==== ===== ======= ========= | ||
867 | 5 | # 1 0x46F81B022F1AD76B 0.0003 100.0% 1 0.0003 NS 0.00 ia SELECT t | ||
868 | 6 | # MISC 0xMISC 0.0003 100.0% 1 0.0003 NS 0.0 MISC <1 ITEMS> | ||
869 | 7 | |||
870 | 8 | # Query 1: 0 QPS, 0x concurrency, ID 0x46F81B022F1AD76B at byte 0 ________ | ||
871 | 9 | # Scores: Apdex = NS [0.0]*, V/M = 0.00 | ||
872 | 10 | # EXPLAIN sparkline: ia | ||
873 | 11 | # Query_time sparkline: | ^ | | ||
874 | 12 | # Time range: all events occurred at 2009-12-08 09:23:49.637394 | ||
875 | 13 | # Attribute pct total min max avg 95% stddev median | ||
876 | 14 | # ============ === ======= ======= ======= ======= ======= ======= ======= | ||
877 | 15 | # Count 100 1 | ||
878 | 16 | # Exec time 100 286us 286us 286us 286us 286us 0 286us | ||
879 | 17 | # Query size 100 90 90 90 90 90 0 90 | ||
880 | 18 | # String: | ||
881 | 19 | # cmd Query | ||
882 | 20 | # Databases qrf | ||
883 | 21 | # Query_time distribution | ||
884 | 22 | # 1us | ||
885 | 23 | # 10us | ||
886 | 24 | # 100us ################################################################ | ||
887 | 25 | # 1ms | ||
888 | 26 | # 10ms | ||
889 | 27 | # 100ms | ||
890 | 28 | # 1s | ||
891 | 29 | # 10s+ | ||
892 | 30 | # Tables | ||
893 | 31 | # SHOW TABLE STATUS FROM `qrf` LIKE 't'\G | ||
894 | 32 | # SHOW CREATE TABLE `qrf`.`t`\G | ||
895 | 33 | # EXPLAIN /*!50100 PARTITIONS*/ | ||
896 | 34 | select t1.i from t as t1 join t as t2 where t1.i < t2.i and t1.v is not null order by t1.i\G | ||
897 | 35 | # *************************** 1. row *************************** | ||
898 | 36 | # id: 1 | ||
899 | 37 | # select_type: SIMPLE | ||
900 | 38 | # table: t1 | ||
901 | 39 | # partitions: NULL | ||
902 | 40 | # type: index | ||
903 | 41 | # possible_keys: PRIMARY | ||
904 | 42 | # key: PRIMARY | ||
905 | 43 | # key_len: 4 | ||
906 | 44 | # ref: NULL | ||
907 | 45 | # rows: 4 | ||
908 | 46 | # Extra: Using where | ||
909 | 47 | # *************************** 2. row *************************** | ||
910 | 48 | # id: 1 | ||
911 | 49 | # select_type: SIMPLE | ||
912 | 50 | # table: t2 | ||
913 | 51 | # partitions: NULL | ||
914 | 52 | # type: ALL | ||
915 | 53 | # possible_keys: PRIMARY | ||
916 | 54 | # key: NULL | ||
917 | 55 | # key_len: NULL | ||
918 | 56 | # ref: NULL | ||
919 | 57 | # rows: 4 | ||
920 | 58 | # Extra: Range checked for each record (index map: 0x1) | ||
921 | 0 | 59 | ||
922 | === renamed file 't/lib/samples/SchemaIterator/all-dbs-tbls.txt' => 't/lib/samples/SchemaIterator/all-dbs-tbls-5.5.txt' | |||
923 | === added file 't/lib/samples/SchemaIterator/all-dbs-tbls-5.6.txt' | |||
924 | --- t/lib/samples/SchemaIterator/all-dbs-tbls-5.6.txt 1970-01-01 00:00:00 +0000 | |||
925 | +++ t/lib/samples/SchemaIterator/all-dbs-tbls-5.6.txt 2012-12-20 23:20:29 +0000 | |||
926 | @@ -0,0 +1,537 @@ | |||
927 | 1 | mysql.columns_priv | ||
928 | 2 | CREATE TABLE `columns_priv` ( | ||
929 | 3 | `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
930 | 4 | `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
931 | 5 | `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
932 | 6 | `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
933 | 7 | `Column_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
934 | 8 | `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
935 | 9 | `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '', | ||
936 | 10 | PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`,`Column_name`) | ||
937 | 11 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Column privileges' | ||
938 | 12 | |||
939 | 13 | mysql.db | ||
940 | 14 | CREATE TABLE `db` ( | ||
941 | 15 | `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
942 | 16 | `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
943 | 17 | `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
944 | 18 | `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
945 | 19 | `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
946 | 20 | `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
947 | 21 | `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
948 | 22 | `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
949 | 23 | `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
950 | 24 | `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
951 | 25 | `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
952 | 26 | `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
953 | 27 | `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
954 | 28 | `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
955 | 29 | `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
956 | 30 | `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
957 | 31 | `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
958 | 32 | `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
959 | 33 | `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
960 | 34 | `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
961 | 35 | `Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
962 | 36 | `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
963 | 37 | PRIMARY KEY (`Host`,`Db`,`User`), | ||
964 | 38 | KEY `User` (`User`) | ||
965 | 39 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Database privileges' | ||
966 | 40 | |||
967 | 41 | mysql.event | ||
968 | 42 | CREATE TABLE `event` ( | ||
969 | 43 | `db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', | ||
970 | 44 | `name` char(64) NOT NULL DEFAULT '', | ||
971 | 45 | `body` longblob NOT NULL, | ||
972 | 46 | `definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', | ||
973 | 47 | `execute_at` datetime DEFAULT NULL, | ||
974 | 48 | `interval_value` int(11) DEFAULT NULL, | ||
975 | 49 | `interval_field` enum('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') DEFAULT NULL, | ||
976 | 50 | `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
977 | 51 | `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', | ||
978 | 52 | `last_executed` datetime DEFAULT NULL, | ||
979 | 53 | `starts` datetime DEFAULT NULL, | ||
980 | 54 | `ends` datetime DEFAULT NULL, | ||
981 | 55 | `status` enum('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL DEFAULT 'ENABLED', | ||
982 | 56 | `on_completion` enum('DROP','PRESERVE') NOT NULL DEFAULT 'DROP', | ||
983 | 57 | `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '', | ||
984 | 58 | `comment` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', | ||
985 | 59 | `originator` int(10) unsigned NOT NULL, | ||
986 | 60 | `time_zone` char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', | ||
987 | 61 | `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, | ||
988 | 62 | `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, | ||
989 | 63 | `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, | ||
990 | 64 | `body_utf8` longblob, | ||
991 | 65 | PRIMARY KEY (`db`,`name`) | ||
992 | 66 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Events' | ||
993 | 67 | |||
994 | 68 | mysql.func | ||
995 | 69 | CREATE TABLE `func` ( | ||
996 | 70 | `name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
997 | 71 | `ret` tinyint(1) NOT NULL DEFAULT '0', | ||
998 | 72 | `dl` char(128) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
999 | 73 | `type` enum('function','aggregate') CHARACTER SET utf8 NOT NULL, | ||
1000 | 74 | PRIMARY KEY (`name`) | ||
1001 | 75 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User defined functions' | ||
1002 | 76 | |||
1003 | 77 | mysql.help_category | ||
1004 | 78 | CREATE TABLE `help_category` ( | ||
1005 | 79 | `help_category_id` smallint(5) unsigned NOT NULL, | ||
1006 | 80 | `name` char(64) NOT NULL, | ||
1007 | 81 | `parent_category_id` smallint(5) unsigned DEFAULT NULL, | ||
1008 | 82 | `url` char(128) NOT NULL, | ||
1009 | 83 | PRIMARY KEY (`help_category_id`), | ||
1010 | 84 | UNIQUE KEY `name` (`name`) | ||
1011 | 85 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='help categories' | ||
1012 | 86 | |||
1013 | 87 | mysql.help_keyword | ||
1014 | 88 | CREATE TABLE `help_keyword` ( | ||
1015 | 89 | `help_keyword_id` int(10) unsigned NOT NULL, | ||
1016 | 90 | `name` char(64) NOT NULL, | ||
1017 | 91 | PRIMARY KEY (`help_keyword_id`), | ||
1018 | 92 | UNIQUE KEY `name` (`name`) | ||
1019 | 93 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='help keywords' | ||
1020 | 94 | |||
1021 | 95 | mysql.help_relation | ||
1022 | 96 | CREATE TABLE `help_relation` ( | ||
1023 | 97 | `help_topic_id` int(10) unsigned NOT NULL, | ||
1024 | 98 | `help_keyword_id` int(10) unsigned NOT NULL, | ||
1025 | 99 | PRIMARY KEY (`help_keyword_id`,`help_topic_id`) | ||
1026 | 100 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='keyword-topic relation' | ||
1027 | 101 | |||
1028 | 102 | mysql.help_topic | ||
1029 | 103 | CREATE TABLE `help_topic` ( | ||
1030 | 104 | `help_topic_id` int(10) unsigned NOT NULL, | ||
1031 | 105 | `name` char(64) NOT NULL, | ||
1032 | 106 | `help_category_id` smallint(5) unsigned NOT NULL, | ||
1033 | 107 | `description` text NOT NULL, | ||
1034 | 108 | `example` text NOT NULL, | ||
1035 | 109 | `url` char(128) NOT NULL, | ||
1036 | 110 | PRIMARY KEY (`help_topic_id`), | ||
1037 | 111 | UNIQUE KEY `name` (`name`) | ||
1038 | 112 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='help topics' | ||
1039 | 113 | |||
1040 | 114 | mysql.ndb_binlog_index | ||
1041 | 115 | CREATE TABLE `ndb_binlog_index` ( | ||
1042 | 116 | `Position` bigint(20) unsigned NOT NULL, | ||
1043 | 117 | `File` varchar(255) NOT NULL, | ||
1044 | 118 | `epoch` bigint(20) unsigned NOT NULL, | ||
1045 | 119 | `inserts` int(10) unsigned NOT NULL, | ||
1046 | 120 | `updates` int(10) unsigned NOT NULL, | ||
1047 | 121 | `deletes` int(10) unsigned NOT NULL, | ||
1048 | 122 | `schemaops` int(10) unsigned NOT NULL, | ||
1049 | 123 | `orig_server_id` int(10) unsigned NOT NULL, | ||
1050 | 124 | `orig_epoch` bigint(20) unsigned NOT NULL, | ||
1051 | 125 | `gci` int(10) unsigned NOT NULL, | ||
1052 | 126 | PRIMARY KEY (`epoch`,`orig_server_id`,`orig_epoch`) | ||
1053 | 127 | ) ENGINE=MyISAM DEFAULT CHARSET=latin1 | ||
1054 | 128 | |||
1055 | 129 | mysql.plugin | ||
1056 | 130 | CREATE TABLE `plugin` ( | ||
1057 | 131 | `name` varchar(64) NOT NULL DEFAULT '', | ||
1058 | 132 | `dl` varchar(128) NOT NULL DEFAULT '', | ||
1059 | 133 | PRIMARY KEY (`name`) | ||
1060 | 134 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL plugins' | ||
1061 | 135 | |||
1062 | 136 | mysql.proc | ||
1063 | 137 | CREATE TABLE `proc` ( | ||
1064 | 138 | `db` char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', | ||
1065 | 139 | `name` char(64) NOT NULL DEFAULT '', | ||
1066 | 140 | `type` enum('FUNCTION','PROCEDURE') NOT NULL, | ||
1067 | 141 | `specific_name` char(64) NOT NULL DEFAULT '', | ||
1068 | 142 | `language` enum('SQL') NOT NULL DEFAULT 'SQL', | ||
1069 | 143 | `sql_data_access` enum('CONTAINS_SQL','NO_SQL','READS_SQL_DATA','MODIFIES_SQL_DATA') NOT NULL DEFAULT 'CONTAINS_SQL', | ||
1070 | 144 | `is_deterministic` enum('YES','NO') NOT NULL DEFAULT 'NO', | ||
1071 | 145 | `security_type` enum('INVOKER','DEFINER') NOT NULL DEFAULT 'DEFINER', | ||
1072 | 146 | `param_list` blob NOT NULL, | ||
1073 | 147 | `returns` longblob NOT NULL, | ||
1074 | 148 | `body` longblob NOT NULL, | ||
1075 | 149 | `definer` char(77) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', | ||
1076 | 150 | `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
1077 | 151 | `modified` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', | ||
1078 | 152 | `sql_mode` set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','NOT_USED','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') NOT NULL DEFAULT '', | ||
1079 | 153 | `comment` text CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, | ||
1080 | 154 | `character_set_client` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, | ||
1081 | 155 | `collation_connection` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, | ||
1082 | 156 | `db_collation` char(32) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, | ||
1083 | 157 | `body_utf8` longblob, | ||
1084 | 158 | PRIMARY KEY (`db`,`name`,`type`) | ||
1085 | 159 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Stored Procedures' | ||
1086 | 160 | |||
1087 | 161 | mysql.procs_priv | ||
1088 | 162 | CREATE TABLE `procs_priv` ( | ||
1089 | 163 | `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
1090 | 164 | `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
1091 | 165 | `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
1092 | 166 | `Routine_name` char(64) CHARACTER SET utf8 NOT NULL DEFAULT '', | ||
1093 | 167 | `Routine_type` enum('FUNCTION','PROCEDURE') COLLATE utf8_bin NOT NULL, | ||
1094 | 168 | `Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
1095 | 169 | `Proc_priv` set('Execute','Alter Routine','Grant') CHARACTER SET utf8 NOT NULL DEFAULT '', | ||
1096 | 170 | `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
1097 | 171 | PRIMARY KEY (`Host`,`Db`,`User`,`Routine_name`,`Routine_type`), | ||
1098 | 172 | KEY `Grantor` (`Grantor`) | ||
1099 | 173 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Procedure privileges' | ||
1100 | 174 | |||
1101 | 175 | mysql.proxies_priv | ||
1102 | 176 | CREATE TABLE `proxies_priv` ( | ||
1103 | 177 | `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
1104 | 178 | `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
1105 | 179 | `Proxied_host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
1106 | 180 | `Proxied_user` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
1107 | 181 | `With_grant` tinyint(1) NOT NULL DEFAULT '0', | ||
1108 | 182 | `Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
1109 | 183 | `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
1110 | 184 | PRIMARY KEY (`Host`,`User`,`Proxied_host`,`Proxied_user`), | ||
1111 | 185 | KEY `Grantor` (`Grantor`) | ||
1112 | 186 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User proxy privileges' | ||
1113 | 187 | |||
1114 | 188 | mysql.servers | ||
1115 | 189 | CREATE TABLE `servers` ( | ||
1116 | 190 | `Server_name` char(64) NOT NULL DEFAULT '', | ||
1117 | 191 | `Host` char(64) NOT NULL DEFAULT '', | ||
1118 | 192 | `Db` char(64) NOT NULL DEFAULT '', | ||
1119 | 193 | `Username` char(64) NOT NULL DEFAULT '', | ||
1120 | 194 | `Password` char(64) NOT NULL DEFAULT '', | ||
1121 | 195 | `Port` int(4) NOT NULL DEFAULT '0', | ||
1122 | 196 | `Socket` char(64) NOT NULL DEFAULT '', | ||
1123 | 197 | `Wrapper` char(64) NOT NULL DEFAULT '', | ||
1124 | 198 | `Owner` char(64) NOT NULL DEFAULT '', | ||
1125 | 199 | PRIMARY KEY (`Server_name`) | ||
1126 | 200 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='MySQL Foreign Servers table' | ||
1127 | 201 | |||
1128 | 202 | mysql.tables_priv | ||
1129 | 203 | CREATE TABLE `tables_priv` ( | ||
1130 | 204 | `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
1131 | 205 | `Db` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
1132 | 206 | `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
1133 | 207 | `Table_name` char(64) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
1134 | 208 | `Grantor` char(77) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
1135 | 209 | `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
1136 | 210 | `Table_priv` set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') CHARACTER SET utf8 NOT NULL DEFAULT '', | ||
1137 | 211 | `Column_priv` set('Select','Insert','Update','References') CHARACTER SET utf8 NOT NULL DEFAULT '', | ||
1138 | 212 | PRIMARY KEY (`Host`,`Db`,`User`,`Table_name`), | ||
1139 | 213 | KEY `Grantor` (`Grantor`) | ||
1140 | 214 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Table privileges' | ||
1141 | 215 | |||
1142 | 216 | mysql.time_zone | ||
1143 | 217 | CREATE TABLE `time_zone` ( | ||
1144 | 218 | `Time_zone_id` int(10) unsigned NOT NULL AUTO_INCREMENT, | ||
1145 | 219 | `Use_leap_seconds` enum('Y','N') NOT NULL DEFAULT 'N', | ||
1146 | 220 | PRIMARY KEY (`Time_zone_id`) | ||
1147 | 221 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zones' | ||
1148 | 222 | |||
1149 | 223 | mysql.time_zone_leap_second | ||
1150 | 224 | CREATE TABLE `time_zone_leap_second` ( | ||
1151 | 225 | `Transition_time` bigint(20) NOT NULL, | ||
1152 | 226 | `Correction` int(11) NOT NULL, | ||
1153 | 227 | PRIMARY KEY (`Transition_time`) | ||
1154 | 228 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Leap seconds information for time zones' | ||
1155 | 229 | |||
1156 | 230 | mysql.time_zone_name | ||
1157 | 231 | CREATE TABLE `time_zone_name` ( | ||
1158 | 232 | `Name` char(64) NOT NULL, | ||
1159 | 233 | `Time_zone_id` int(10) unsigned NOT NULL, | ||
1160 | 234 | PRIMARY KEY (`Name`) | ||
1161 | 235 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zone names' | ||
1162 | 236 | |||
1163 | 237 | mysql.time_zone_transition | ||
1164 | 238 | CREATE TABLE `time_zone_transition` ( | ||
1165 | 239 | `Time_zone_id` int(10) unsigned NOT NULL, | ||
1166 | 240 | `Transition_time` bigint(20) NOT NULL, | ||
1167 | 241 | `Transition_type_id` int(10) unsigned NOT NULL, | ||
1168 | 242 | PRIMARY KEY (`Time_zone_id`,`Transition_time`) | ||
1169 | 243 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zone transitions' | ||
1170 | 244 | |||
1171 | 245 | mysql.time_zone_transition_type | ||
1172 | 246 | CREATE TABLE `time_zone_transition_type` ( | ||
1173 | 247 | `Time_zone_id` int(10) unsigned NOT NULL, | ||
1174 | 248 | `Transition_type_id` int(10) unsigned NOT NULL, | ||
1175 | 249 | `Offset` int(11) NOT NULL DEFAULT '0', | ||
1176 | 250 | `Is_DST` tinyint(3) unsigned NOT NULL DEFAULT '0', | ||
1177 | 251 | `Abbreviation` char(8) NOT NULL DEFAULT '', | ||
1178 | 252 | PRIMARY KEY (`Time_zone_id`,`Transition_type_id`) | ||
1179 | 253 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Time zone transition types' | ||
1180 | 254 | |||
1181 | 255 | mysql.user | ||
1182 | 256 | CREATE TABLE `user` ( | ||
1183 | 257 | `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
1184 | 258 | `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
1185 | 259 | `Password` char(41) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', | ||
1186 | 260 | `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1187 | 261 | `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1188 | 262 | `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1189 | 263 | `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1190 | 264 | `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1191 | 265 | `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1192 | 266 | `Reload_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1193 | 267 | `Shutdown_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1194 | 268 | `Process_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1195 | 269 | `File_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1196 | 270 | `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1197 | 271 | `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1198 | 272 | `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1199 | 273 | `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1200 | 274 | `Show_db_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1201 | 275 | `Super_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1202 | 276 | `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1203 | 277 | `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1204 | 278 | `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1205 | 279 | `Repl_slave_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1206 | 280 | `Repl_client_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1207 | 281 | `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1208 | 282 | `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1209 | 283 | `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1210 | 284 | `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1211 | 285 | `Create_user_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1212 | 286 | `Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1213 | 287 | `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1214 | 288 | `Create_tablespace_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1215 | 289 | `ssl_type` enum('','ANY','X509','SPECIFIED') CHARACTER SET utf8 NOT NULL DEFAULT '', | ||
1216 | 290 | `ssl_cipher` blob NOT NULL, | ||
1217 | 291 | `x509_issuer` blob NOT NULL, | ||
1218 | 292 | `x509_subject` blob NOT NULL, | ||
1219 | 293 | `max_questions` int(11) unsigned NOT NULL DEFAULT '0', | ||
1220 | 294 | `max_updates` int(11) unsigned NOT NULL DEFAULT '0', | ||
1221 | 295 | `max_connections` int(11) unsigned NOT NULL DEFAULT '0', | ||
1222 | 296 | `max_user_connections` int(11) unsigned NOT NULL DEFAULT '0', | ||
1223 | 297 | `plugin` char(64) COLLATE utf8_bin DEFAULT '', | ||
1224 | 298 | `authentication_string` text COLLATE utf8_bin, | ||
1225 | 299 | `password_expired` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1226 | 300 | PRIMARY KEY (`Host`,`User`) | ||
1227 | 301 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges' | ||
1228 | 302 | |||
1229 | 303 | percona_test.checksums | ||
1230 | 304 | CREATE TABLE `checksums` ( | ||
1231 | 305 | `db_tbl` varchar(128) NOT NULL, | ||
1232 | 306 | `checksum` int(10) unsigned NOT NULL, | ||
1233 | 307 | PRIMARY KEY (`db_tbl`) | ||
1234 | 308 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1 | ||
1235 | 309 | |||
1236 | 310 | percona_test.load_data | ||
1237 | 311 | CREATE TABLE `load_data` ( | ||
1238 | 312 | `i` int(11) DEFAULT NULL | ||
1239 | 313 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1 | ||
1240 | 314 | |||
1241 | 315 | percona_test.sentinel | ||
1242 | 316 | CREATE TABLE `sentinel` ( | ||
1243 | 317 | `id` int(11) NOT NULL, | ||
1244 | 318 | `ping` varchar(64) NOT NULL DEFAULT '', | ||
1245 | 319 | PRIMARY KEY (`id`) | ||
1246 | 320 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1 | ||
1247 | 321 | |||
1248 | 322 | sakila.actor | ||
1249 | 323 | CREATE TABLE `actor` ( | ||
1250 | 324 | `actor_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, | ||
1251 | 325 | `first_name` varchar(45) NOT NULL, | ||
1252 | 326 | `last_name` varchar(45) NOT NULL, | ||
1253 | 327 | `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
1254 | 328 | PRIMARY KEY (`actor_id`), | ||
1255 | 329 | KEY `idx_actor_last_name` (`last_name`) | ||
1256 | 330 | ) ENGINE=InnoDB AUTO_INCREMENT=201 DEFAULT CHARSET=utf8 | ||
1257 | 331 | |||
1258 | 332 | sakila.address | ||
1259 | 333 | CREATE TABLE `address` ( | ||
1260 | 334 | `address_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, | ||
1261 | 335 | `address` varchar(50) NOT NULL, | ||
1262 | 336 | `address2` varchar(50) DEFAULT NULL, | ||
1263 | 337 | `district` varchar(20) NOT NULL, | ||
1264 | 338 | `city_id` smallint(5) unsigned NOT NULL, | ||
1265 | 339 | `postal_code` varchar(10) DEFAULT NULL, | ||
1266 | 340 | `phone` varchar(20) NOT NULL, | ||
1267 | 341 | `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
1268 | 342 | PRIMARY KEY (`address_id`), | ||
1269 | 343 | KEY `idx_fk_city_id` (`city_id`), | ||
1270 | 344 | CONSTRAINT `fk_address_city` FOREIGN KEY (`city_id`) REFERENCES `city` (`city_id`) ON UPDATE CASCADE | ||
1271 | 345 | ) ENGINE=InnoDB AUTO_INCREMENT=606 DEFAULT CHARSET=utf8 | ||
1272 | 346 | |||
1273 | 347 | sakila.category | ||
1274 | 348 | CREATE TABLE `category` ( | ||
1275 | 349 | `category_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, | ||
1276 | 350 | `name` varchar(25) NOT NULL, | ||
1277 | 351 | `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
1278 | 352 | PRIMARY KEY (`category_id`) | ||
1279 | 353 | ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 | ||
1280 | 354 | |||
1281 | 355 | sakila.city | ||
1282 | 356 | CREATE TABLE `city` ( | ||
1283 | 357 | `city_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, | ||
1284 | 358 | `city` varchar(50) NOT NULL, | ||
1285 | 359 | `country_id` smallint(5) unsigned NOT NULL, | ||
1286 | 360 | `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
1287 | 361 | PRIMARY KEY (`city_id`), | ||
1288 | 362 | KEY `idx_fk_country_id` (`country_id`), | ||
1289 | 363 | CONSTRAINT `fk_city_country` FOREIGN KEY (`country_id`) REFERENCES `country` (`country_id`) ON UPDATE CASCADE | ||
1290 | 364 | ) ENGINE=InnoDB AUTO_INCREMENT=601 DEFAULT CHARSET=utf8 | ||
1291 | 365 | |||
1292 | 366 | sakila.country | ||
1293 | 367 | CREATE TABLE `country` ( | ||
1294 | 368 | `country_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, | ||
1295 | 369 | `country` varchar(50) NOT NULL, | ||
1296 | 370 | `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
1297 | 371 | PRIMARY KEY (`country_id`) | ||
1298 | 372 | ) ENGINE=InnoDB AUTO_INCREMENT=110 DEFAULT CHARSET=utf8 | ||
1299 | 373 | |||
1300 | 374 | sakila.customer | ||
1301 | 375 | CREATE TABLE `customer` ( | ||
1302 | 376 | `customer_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, | ||
1303 | 377 | `store_id` tinyint(3) unsigned NOT NULL, | ||
1304 | 378 | `first_name` varchar(45) NOT NULL, | ||
1305 | 379 | `last_name` varchar(45) NOT NULL, | ||
1306 | 380 | `email` varchar(50) DEFAULT NULL, | ||
1307 | 381 | `address_id` smallint(5) unsigned NOT NULL, | ||
1308 | 382 | `active` tinyint(1) NOT NULL DEFAULT '1', | ||
1309 | 383 | `create_date` datetime NOT NULL, | ||
1310 | 384 | `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
1311 | 385 | PRIMARY KEY (`customer_id`), | ||
1312 | 386 | KEY `idx_fk_store_id` (`store_id`), | ||
1313 | 387 | KEY `idx_fk_address_id` (`address_id`), | ||
1314 | 388 | KEY `idx_last_name` (`last_name`), | ||
1315 | 389 | CONSTRAINT `fk_customer_address` FOREIGN KEY (`address_id`) REFERENCES `address` (`address_id`) ON UPDATE CASCADE, | ||
1316 | 390 | CONSTRAINT `fk_customer_store` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON UPDATE CASCADE | ||
1317 | 391 | ) ENGINE=InnoDB AUTO_INCREMENT=600 DEFAULT CHARSET=utf8 | ||
1318 | 392 | |||
1319 | 393 | sakila.film | ||
1320 | 394 | CREATE TABLE `film` ( | ||
1321 | 395 | `film_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, | ||
1322 | 396 | `title` varchar(255) NOT NULL, | ||
1323 | 397 | `description` text, | ||
1324 | 398 | `release_year` year(4) DEFAULT NULL, | ||
1325 | 399 | `language_id` tinyint(3) unsigned NOT NULL, | ||
1326 | 400 | `original_language_id` tinyint(3) unsigned DEFAULT NULL, | ||
1327 | 401 | `rental_duration` tinyint(3) unsigned NOT NULL DEFAULT '3', | ||
1328 | 402 | `rental_rate` decimal(4,2) NOT NULL DEFAULT '4.99', | ||
1329 | 403 | `length` smallint(5) unsigned DEFAULT NULL, | ||
1330 | 404 | `replacement_cost` decimal(5,2) NOT NULL DEFAULT '19.99', | ||
1331 | 405 | `rating` enum('G','PG','PG-13','R','NC-17') DEFAULT 'G', | ||
1332 | 406 | `special_features` set('Trailers','Commentaries','Deleted Scenes','Behind the Scenes') DEFAULT NULL, | ||
1333 | 407 | `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
1334 | 408 | PRIMARY KEY (`film_id`), | ||
1335 | 409 | KEY `idx_title` (`title`), | ||
1336 | 410 | KEY `idx_fk_language_id` (`language_id`), | ||
1337 | 411 | KEY `idx_fk_original_language_id` (`original_language_id`), | ||
1338 | 412 | CONSTRAINT `fk_film_language` FOREIGN KEY (`language_id`) REFERENCES `language` (`language_id`) ON UPDATE CASCADE, | ||
1339 | 413 | CONSTRAINT `fk_film_language_original` FOREIGN KEY (`original_language_id`) REFERENCES `language` (`language_id`) ON UPDATE CASCADE | ||
1340 | 414 | ) ENGINE=InnoDB AUTO_INCREMENT=1001 DEFAULT CHARSET=utf8 | ||
1341 | 415 | |||
1342 | 416 | sakila.film_actor | ||
1343 | 417 | CREATE TABLE `film_actor` ( | ||
1344 | 418 | `actor_id` smallint(5) unsigned NOT NULL, | ||
1345 | 419 | `film_id` smallint(5) unsigned NOT NULL, | ||
1346 | 420 | `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
1347 | 421 | PRIMARY KEY (`actor_id`,`film_id`), | ||
1348 | 422 | KEY `idx_fk_film_id` (`film_id`), | ||
1349 | 423 | CONSTRAINT `fk_film_actor_actor` FOREIGN KEY (`actor_id`) REFERENCES `actor` (`actor_id`) ON UPDATE CASCADE, | ||
1350 | 424 | CONSTRAINT `fk_film_actor_film` FOREIGN KEY (`film_id`) REFERENCES `film` (`film_id`) ON UPDATE CASCADE | ||
1351 | 425 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 | ||
1352 | 426 | |||
1353 | 427 | sakila.film_category | ||
1354 | 428 | CREATE TABLE `film_category` ( | ||
1355 | 429 | `film_id` smallint(5) unsigned NOT NULL, | ||
1356 | 430 | `category_id` tinyint(3) unsigned NOT NULL, | ||
1357 | 431 | `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
1358 | 432 | PRIMARY KEY (`film_id`,`category_id`), | ||
1359 | 433 | KEY `fk_film_category_category` (`category_id`), | ||
1360 | 434 | CONSTRAINT `fk_film_category_film` FOREIGN KEY (`film_id`) REFERENCES `film` (`film_id`) ON UPDATE CASCADE, | ||
1361 | 435 | CONSTRAINT `fk_film_category_category` FOREIGN KEY (`category_id`) REFERENCES `category` (`category_id`) ON UPDATE CASCADE | ||
1362 | 436 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 | ||
1363 | 437 | |||
1364 | 438 | sakila.film_text | ||
1365 | 439 | CREATE TABLE `film_text` ( | ||
1366 | 440 | `film_id` smallint(6) NOT NULL, | ||
1367 | 441 | `title` varchar(255) NOT NULL, | ||
1368 | 442 | `description` text, | ||
1369 | 443 | PRIMARY KEY (`film_id`), | ||
1370 | 444 | FULLTEXT KEY `idx_title_description` (`title`,`description`) | ||
1371 | 445 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 | ||
1372 | 446 | |||
1373 | 447 | sakila.inventory | ||
1374 | 448 | CREATE TABLE `inventory` ( | ||
1375 | 449 | `inventory_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT, | ||
1376 | 450 | `film_id` smallint(5) unsigned NOT NULL, | ||
1377 | 451 | `store_id` tinyint(3) unsigned NOT NULL, | ||
1378 | 452 | `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
1379 | 453 | PRIMARY KEY (`inventory_id`), | ||
1380 | 454 | KEY `idx_fk_film_id` (`film_id`), | ||
1381 | 455 | KEY `idx_store_id_film_id` (`store_id`,`film_id`), | ||
1382 | 456 | CONSTRAINT `fk_inventory_store` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON UPDATE CASCADE, | ||
1383 | 457 | CONSTRAINT `fk_inventory_film` FOREIGN KEY (`film_id`) REFERENCES `film` (`film_id`) ON UPDATE CASCADE | ||
1384 | 458 | ) ENGINE=InnoDB AUTO_INCREMENT=4582 DEFAULT CHARSET=utf8 | ||
1385 | 459 | |||
1386 | 460 | sakila.language | ||
1387 | 461 | CREATE TABLE `language` ( | ||
1388 | 462 | `language_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, | ||
1389 | 463 | `name` char(20) NOT NULL, | ||
1390 | 464 | `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
1391 | 465 | PRIMARY KEY (`language_id`) | ||
1392 | 466 | ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 | ||
1393 | 467 | |||
1394 | 468 | sakila.payment | ||
1395 | 469 | CREATE TABLE `payment` ( | ||
1396 | 470 | `payment_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, | ||
1397 | 471 | `customer_id` smallint(5) unsigned NOT NULL, | ||
1398 | 472 | `staff_id` tinyint(3) unsigned NOT NULL, | ||
1399 | 473 | `rental_id` int(11) DEFAULT NULL, | ||
1400 | 474 | `amount` decimal(5,2) NOT NULL, | ||
1401 | 475 | `payment_date` datetime NOT NULL, | ||
1402 | 476 | `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
1403 | 477 | PRIMARY KEY (`payment_id`), | ||
1404 | 478 | KEY `idx_fk_staff_id` (`staff_id`), | ||
1405 | 479 | KEY `idx_fk_customer_id` (`customer_id`), | ||
1406 | 480 | KEY `fk_payment_rental` (`rental_id`), | ||
1407 | 481 | CONSTRAINT `fk_payment_rental` FOREIGN KEY (`rental_id`) REFERENCES `rental` (`rental_id`) ON DELETE SET NULL ON UPDATE CASCADE, | ||
1408 | 482 | CONSTRAINT `fk_payment_customer` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE, | ||
1409 | 483 | CONSTRAINT `fk_payment_staff` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE | ||
1410 | 484 | ) ENGINE=InnoDB AUTO_INCREMENT=16050 DEFAULT CHARSET=utf8 | ||
1411 | 485 | |||
1412 | 486 | sakila.rental | ||
1413 | 487 | CREATE TABLE `rental` ( | ||
1414 | 488 | `rental_id` int(11) NOT NULL AUTO_INCREMENT, | ||
1415 | 489 | `rental_date` datetime NOT NULL, | ||
1416 | 490 | `inventory_id` mediumint(8) unsigned NOT NULL, | ||
1417 | 491 | `customer_id` smallint(5) unsigned NOT NULL, | ||
1418 | 492 | `return_date` datetime DEFAULT NULL, | ||
1419 | 493 | `staff_id` tinyint(3) unsigned NOT NULL, | ||
1420 | 494 | `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
1421 | 495 | PRIMARY KEY (`rental_id`), | ||
1422 | 496 | UNIQUE KEY `rental_date` (`rental_date`,`inventory_id`,`customer_id`), | ||
1423 | 497 | KEY `idx_fk_inventory_id` (`inventory_id`), | ||
1424 | 498 | KEY `idx_fk_customer_id` (`customer_id`), | ||
1425 | 499 | KEY `idx_fk_staff_id` (`staff_id`), | ||
1426 | 500 | CONSTRAINT `fk_rental_staff` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE, | ||
1427 | 501 | CONSTRAINT `fk_rental_inventory` FOREIGN KEY (`inventory_id`) REFERENCES `inventory` (`inventory_id`) ON UPDATE CASCADE, | ||
1428 | 502 | CONSTRAINT `fk_rental_customer` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE | ||
1429 | 503 | ) ENGINE=InnoDB AUTO_INCREMENT=16050 DEFAULT CHARSET=utf8 | ||
1430 | 504 | |||
1431 | 505 | sakila.staff | ||
1432 | 506 | CREATE TABLE `staff` ( | ||
1433 | 507 | `staff_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, | ||
1434 | 508 | `first_name` varchar(45) NOT NULL, | ||
1435 | 509 | `last_name` varchar(45) NOT NULL, | ||
1436 | 510 | `address_id` smallint(5) unsigned NOT NULL, | ||
1437 | 511 | `picture` blob, | ||
1438 | 512 | `email` varchar(50) DEFAULT NULL, | ||
1439 | 513 | `store_id` tinyint(3) unsigned NOT NULL, | ||
1440 | 514 | `active` tinyint(1) NOT NULL DEFAULT '1', | ||
1441 | 515 | `username` varchar(16) NOT NULL, | ||
1442 | 516 | `password` varchar(40) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL, | ||
1443 | 517 | `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
1444 | 518 | PRIMARY KEY (`staff_id`), | ||
1445 | 519 | KEY `idx_fk_store_id` (`store_id`), | ||
1446 | 520 | KEY `idx_fk_address_id` (`address_id`), | ||
1447 | 521 | CONSTRAINT `fk_staff_store` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON UPDATE CASCADE, | ||
1448 | 522 | CONSTRAINT `fk_staff_address` FOREIGN KEY (`address_id`) REFERENCES `address` (`address_id`) ON UPDATE CASCADE | ||
1449 | 523 | ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 | ||
1450 | 524 | |||
1451 | 525 | sakila.store | ||
1452 | 526 | CREATE TABLE `store` ( | ||
1453 | 527 | `store_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, | ||
1454 | 528 | `manager_staff_id` tinyint(3) unsigned NOT NULL, | ||
1455 | 529 | `address_id` smallint(5) unsigned NOT NULL, | ||
1456 | 530 | `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | ||
1457 | 531 | PRIMARY KEY (`store_id`), | ||
1458 | 532 | UNIQUE KEY `idx_unique_manager` (`manager_staff_id`), | ||
1459 | 533 | KEY `idx_fk_address_id` (`address_id`), | ||
1460 | 534 | CONSTRAINT `fk_store_staff` FOREIGN KEY (`manager_staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE, | ||
1461 | 535 | CONSTRAINT `fk_store_address` FOREIGN KEY (`address_id`) REFERENCES `address` (`address_id`) ON UPDATE CASCADE | ||
1462 | 536 | ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 | ||
1463 | 537 | |||
1464 | 0 | 538 | ||
1465 | === renamed file 't/lib/samples/SchemaIterator/mysql-user-ddl.txt' => 't/lib/samples/SchemaIterator/mysql-user-ddl-5.1.txt' | |||
1466 | === added file 't/lib/samples/SchemaIterator/mysql-user-ddl-5.6.txt' | |||
1467 | --- t/lib/samples/SchemaIterator/mysql-user-ddl-5.6.txt 1970-01-01 00:00:00 +0000 | |||
1468 | +++ t/lib/samples/SchemaIterator/mysql-user-ddl-5.6.txt 2012-12-20 23:20:29 +0000 | |||
1469 | @@ -0,0 +1,48 @@ | |||
1470 | 1 | mysql.user | ||
1471 | 2 | CREATE TABLE `user` ( | ||
1472 | 3 | `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
1473 | 4 | `User` char(16) COLLATE utf8_bin NOT NULL DEFAULT '', | ||
1474 | 5 | `Password` char(41) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '', | ||
1475 | 6 | `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1476 | 7 | `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1477 | 8 | `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1478 | 9 | `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1479 | 10 | `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1480 | 11 | `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1481 | 12 | `Reload_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1482 | 13 | `Shutdown_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1483 | 14 | `Process_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1484 | 15 | `File_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1485 | 16 | `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1486 | 17 | `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1487 | 18 | `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1488 | 19 | `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1489 | 20 | `Show_db_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1490 | 21 | `Super_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1491 | 22 | `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1492 | 23 | `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1493 | 24 | `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1494 | 25 | `Repl_slave_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1495 | 26 | `Repl_client_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1496 | 27 | `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1497 | 28 | `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1498 | 29 | `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1499 | 30 | `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1500 | 31 | `Create_user_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1501 | 32 | `Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1502 | 33 | `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1503 | 34 | `Create_tablespace_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1504 | 35 | `ssl_type` enum('','ANY','X509','SPECIFIED') CHARACTER SET utf8 NOT NULL DEFAULT '', | ||
1505 | 36 | `ssl_cipher` blob NOT NULL, | ||
1506 | 37 | `x509_issuer` blob NOT NULL, | ||
1507 | 38 | `x509_subject` blob NOT NULL, | ||
1508 | 39 | `max_questions` int(11) unsigned NOT NULL DEFAULT '0', | ||
1509 | 40 | `max_updates` int(11) unsigned NOT NULL DEFAULT '0', | ||
1510 | 41 | `max_connections` int(11) unsigned NOT NULL DEFAULT '0', | ||
1511 | 42 | `max_user_connections` int(11) unsigned NOT NULL DEFAULT '0', | ||
1512 | 43 | `plugin` char(64) COLLATE utf8_bin DEFAULT '', | ||
1513 | 44 | `authentication_string` text COLLATE utf8_bin, | ||
1514 | 45 | `password_expired` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N', | ||
1515 | 46 | PRIMARY KEY (`Host`,`User`) | ||
1516 | 47 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges' | ||
1517 | 48 | |||
1518 | 0 | 49 | ||
1519 | === added file 't/lib/samples/stored-objs.sql' | |||
1520 | --- t/lib/samples/stored-objs.sql 1970-01-01 00:00:00 +0000 | |||
1521 | +++ t/lib/samples/stored-objs.sql 2012-12-20 23:20:29 +0000 | |||
1522 | @@ -0,0 +1,30 @@ | |||
1523 | 1 | DROP DATABASE IF EXISTS pt_find; | ||
1524 | 2 | CREATE DATABASE pt_find; | ||
1525 | 3 | USE pt_find; | ||
1526 | 4 | |||
1527 | 5 | create table t1 ( | ||
1528 | 6 | id int not null primary key | ||
1529 | 7 | ) engine=innodb; | ||
1530 | 8 | |||
1531 | 9 | create table t2 ( | ||
1532 | 10 | id int not null primary key | ||
1533 | 11 | ) engine=innodb; | ||
1534 | 12 | |||
1535 | 13 | CREATE FUNCTION hello (s CHAR(20)) | ||
1536 | 14 | RETURNS CHAR(50) DETERMINISTIC | ||
1537 | 15 | RETURN CONCAT('Hello, ',s,'!'); | ||
1538 | 16 | |||
1539 | 17 | delimiter // | ||
1540 | 18 | |||
1541 | 19 | CREATE PROCEDURE simpleproc (OUT param1 INT) | ||
1542 | 20 | BEGIN | ||
1543 | 21 | SELECT COUNT(*) INTO param1 FROM t; | ||
1544 | 22 | END// | ||
1545 | 23 | |||
1546 | 24 | CREATE TRIGGER ins_trg BEFORE INSERT ON t1 | ||
1547 | 25 | FOR EACH ROW BEGIN | ||
1548 | 26 | INSERT INTO t2 VALUES (NEW.id); | ||
1549 | 27 | END; | ||
1550 | 28 | // | ||
1551 | 29 | |||
1552 | 30 | delimiter ; | ||
1553 | 0 | 31 | ||
1554 | === modified file 't/pt-archiver/standard_options.t' | |||
1555 | --- t/pt-archiver/standard_options.t 2012-06-07 03:14:20 +0000 | |||
1556 | +++ t/pt-archiver/standard_options.t 2012-12-20 23:20:29 +0000 | |||
1557 | @@ -23,101 +23,127 @@ | |||
1558 | 23 | if ( !$dbh ) { | 23 | if ( !$dbh ) { |
1559 | 24 | plan skip_all => 'Cannot connect to sandbox master'; | 24 | plan skip_all => 'Cannot connect to sandbox master'; |
1560 | 25 | } | 25 | } |
1563 | 26 | else { | 26 | elsif ( !$dbh2 ) { |
1564 | 27 | plan tests => 7; | 27 | plan skip_all => 'Cannot connect to sandbox slave'; |
1565 | 28 | } | 28 | } |
1566 | 29 | 29 | ||
1567 | 30 | my $output; | 30 | my $output; |
1570 | 31 | my $cnf = "/tmp/12345/my.sandbox.cnf"; | 31 | my $cnf = "/tmp/12345/my.sandbox.cnf"; |
1571 | 32 | my $cmd = "$trunk/bin/pt-archiver"; | 32 | my $pid_file = "/tmp/pt-archiver-test.pid.$PID"; |
1572 | 33 | my $sentinel = "/tmp/pt-archiver-test.sentinel.$PID"; | ||
1573 | 33 | 34 | ||
1574 | 34 | $sb->create_dbs($dbh, [qw(test)]); | 35 | $sb->create_dbs($dbh, [qw(test)]); |
1575 | 35 | 36 | ||
1588 | 36 | SKIP: { | 37 | ok( |
1589 | 37 | skip 'Sandbox master does not have the sakila database', 1 | 38 | no_diff( |
1590 | 38 | unless @{$dbh->selectcol_arrayref("SHOW DATABASES LIKE 'sakila'")}; | 39 | sub { |
1591 | 39 | 40 | pt_archiver::main('--source', "F=$cnf,h=127.1,D=sakila,t=film", | |
1592 | 40 | $output = `$cmd --source F=$cnf,h=127.1,D=sakila,t=film --no-check-charset --where "film_id < 100" --purge --dry-run --port 12345 | diff $trunk/t/pt-archiver/samples/issue-248.txt -`; | 41 | qw(--no-check-charset --purge --dry-run --port 12345), |
1593 | 41 | is( | 42 | "--where", "film_id < 100") |
1594 | 42 | $output, | 43 | }, |
1595 | 43 | '', | 44 | "t/pt-archiver/samples/issue-248.txt", |
1596 | 44 | 'DSNs inherit from standard connection options (issue 248)' | 45 | ), |
1597 | 45 | ); | 46 | 'DSNs inherit from standard connection options (issue 248)' |
1598 | 46 | }; | 47 | ); |
1587 | 47 | |||
1599 | 48 | 48 | ||
1600 | 49 | # Test with a sentinel file | 49 | # Test with a sentinel file |
1601 | 50 | $sb->load_file('master', 't/pt-archiver/samples/table1.sql'); | 50 | $sb->load_file('master', 't/pt-archiver/samples/table1.sql'); |
1603 | 51 | diag(`touch sentinel`); | 51 | diag(`touch $sentinel`); |
1604 | 52 | |||
1605 | 52 | $output = output( | 53 | $output = output( |
1609 | 53 | sub { pt_archiver::main(qw(--where 1=1 --why-quit --sentinel sentinel), "--source", "D=test,t=table_1,F=$cnf", qw(--purge)) }, | 54 | sub { pt_archiver::main("--source", "D=test,t=table_1,F=$cnf", |
1610 | 54 | ); | 55 | qw(--where 1=1 --why-quit --purge), |
1611 | 55 | like($output, qr/because sentinel/, 'Exits because of sentinel'); | 56 | "--sentinel", $sentinel) |
1612 | 57 | }, | ||
1613 | 58 | stderr => 1, | ||
1614 | 59 | ); | ||
1615 | 60 | |||
1616 | 61 | like( | ||
1617 | 62 | $output, | ||
1618 | 63 | qr/because sentinel file $sentinel exists/, | ||
1619 | 64 | 'Exits because of sentinel' | ||
1620 | 65 | ); | ||
1621 | 66 | |||
1622 | 56 | $output = `/tmp/12345/use -N -e "select count(*) from test.table_1"`; | 67 | $output = `/tmp/12345/use -N -e "select count(*) from test.table_1"`; |
1625 | 57 | is($output + 0, 4, 'No rows were deleted'); | 68 | is( |
1626 | 58 | `rm sentinel`; | 69 | $output + 0, |
1627 | 70 | 4, | ||
1628 | 71 | 'No rows were deleted' | ||
1629 | 72 | ) or diag($output); | ||
1630 | 73 | |||
1631 | 74 | diag(`rm -f $sentinel`); | ||
1632 | 59 | 75 | ||
1633 | 60 | # Test --stop, which sets the sentinel | 76 | # Test --stop, which sets the sentinel |
1634 | 61 | $output = output( | 77 | $output = output( |
1639 | 62 | sub { pt_archiver::main(qw(--sentinel sentinel --stop)) }, | 78 | sub { pt_archiver::main("--sentinel", $sentinel, "--stop") }, |
1640 | 63 | ); | 79 | ); |
1641 | 64 | like($output, qr/Successfully created file sentinel/, 'Created the sentinel OK'); | 80 | |
1642 | 65 | diag(`rm -f sentinel >/dev/null`); | 81 | like( |
1643 | 82 | $output, | ||
1644 | 83 | qr/Successfully created file $sentinel/, | ||
1645 | 84 | 'Created the sentinel OK' | ||
1646 | 85 | ); | ||
1647 | 86 | |||
1648 | 87 | diag(`rm -f $sentinel`); | ||
1649 | 66 | 88 | ||
1650 | 67 | # ############################################################################# | 89 | # ############################################################################# |
1651 | 68 | # Issue 391: Add --pid option to mk-table-sync | 90 | # Issue 391: Add --pid option to mk-table-sync |
1652 | 69 | # ############################################################################# | 91 | # ############################################################################# |
1655 | 70 | `touch /tmp/mk-archiver.pid`; | 92 | diag(`touch $pid_file`); |
1656 | 71 | $output = `$cmd --where 1=1 --source F=$cnf,D=test,t=issue_131_src --statistics --dest t=issue_131_dst --pid /tmp/mk-archiver.pid 2>&1`; | 93 | |
1657 | 94 | $output = output( | ||
1658 | 95 | sub { pt_archiver::main('--source', "F=$cnf,D=test,t=issue_131_src", | ||
1659 | 96 | qw(--where 1=1 --statistics --dest t=issue_131_dst), | ||
1660 | 97 | "--pid", $pid_file) | ||
1661 | 98 | }, | ||
1662 | 99 | stderr => 1, | ||
1663 | 100 | ); | ||
1664 | 101 | |||
1665 | 72 | like( | 102 | like( |
1666 | 73 | $output, | 103 | $output, |
1668 | 74 | qr{PID file /tmp/mk-archiver.pid already exists}, | 104 | qr{PID file $pid_file already exists}, |
1669 | 75 | 'Dies if PID file already exists (issue 391)' | 105 | 'Dies if PID file already exists (issue 391)' |
1670 | 76 | ); | 106 | ); |
1671 | 77 | 107 | ||
1673 | 78 | `rm -rf /tmp/mk-archiver.pid`; | 108 | diag(`rm -f $pid_file`); |
1674 | 79 | 109 | ||
1675 | 80 | # ############################################################################# | 110 | # ############################################################################# |
1676 | 81 | # Issue 460: mk-archiver does not inherit DSN as documented | 111 | # Issue 460: mk-archiver does not inherit DSN as documented |
1677 | 82 | # ############################################################################# | 112 | # ############################################################################# |
1711 | 83 | SKIP: { | 113 | |
1712 | 84 | skip 'Cannot connect to sandbox slave1', 1 unless $dbh2; | 114 | # This test will achive rows from dbh:test.table_1 to dbh2:test.table_2. |
1713 | 85 | 115 | $sb->load_file('master', 't/pt-archiver/samples/tables1-4.sql'); | |
1714 | 86 | # This test will achive rows from dbh:test.table_1 to dbh2:test.table_2. | 116 | |
1715 | 87 | $sb->load_file('master', 't/pt-archiver/samples/tables1-4.sql'); | 117 | # Change passwords so defaults files won't work. |
1716 | 88 | 118 | $sb->do_as_root( | |
1717 | 89 | # Change passwords so defaults files won't work. | 119 | 'master', |
1718 | 90 | $dbh->do("SET PASSWORD FOR msandbox = PASSWORD('foo')"); | 120 | q/CREATE USER 'bob'@'%' IDENTIFIED BY 'foo'/, |
1719 | 91 | $dbh2->do("SET PASSWORD FOR msandbox = PASSWORD('foo')"); | 121 | q/GRANT ALL ON *.* TO 'bob'@'%'/, |
1720 | 92 | 122 | ); | |
1721 | 93 | $dbh2->do('TRUNCATE TABLE test.table_2'); | 123 | $dbh2->do('TRUNCATE TABLE test.table_2'); |
1722 | 94 | 124 | $sb->wait_for_slaves; | |
1723 | 95 | $output = `$trunk/bin/pt-archiver --where 1=1 --source h=127.1,P=12345,D=test,t=table_1,u=msandbox,p=foo --dest P=12346,t=table_2 2>&1`; | 125 | |
1724 | 96 | my $r = $dbh2->selectall_arrayref('SELECT * FROM test.table_2'); | 126 | $output = output( |
1725 | 97 | is( | 127 | sub { pt_archiver::main( |
1726 | 98 | scalar @$r, | 128 | '--source', 'h=127.1,P=12345,D=test,t=table_1,u=bob,p=foo', |
1727 | 99 | 4, | 129 | '--dest', 'P=12346,t=table_2', |
1728 | 100 | '--dest inherited from --source' | 130 | qw(--where 1=1)) |
1729 | 101 | ); | 131 | }, |
1730 | 102 | 132 | stderr => 1, | |
1731 | 103 | # Set the passwords back. If this fails we should bail out because | 133 | ); |
1732 | 104 | # nothing else is going to work. | 134 | |
1733 | 105 | eval { | 135 | my $r = $dbh2->selectall_arrayref('SELECT * FROM test.table_2'); |
1734 | 106 | $dbh->do("SET PASSWORD FOR msandbox = PASSWORD('msandbox')"); | 136 | is( |
1735 | 107 | $dbh2->do("SET PASSWORD FOR msandbox = PASSWORD('msandbox')"); | 137 | scalar @$r, |
1736 | 108 | }; | 138 | 4, |
1737 | 109 | if ( $EVAL_ERROR ) { | 139 | '--dest inherited from --source' |
1738 | 110 | BAIL_OUT('Failed to reset the msandbox password on the master or slave ' | 140 | ); |
1739 | 111 | . 'sandbox. Check the Maatkit test environment with "test-env ' | 141 | |
1740 | 112 | . 'status" and restart with "test-env restart". The error was: ' | 142 | $sb->do_as_root('master', q/DROP USER 'bob'@'%'/); |
1708 | 113 | . $EVAL_ERROR); | ||
1709 | 114 | } | ||
1710 | 115 | }; | ||
1741 | 116 | 143 | ||
1742 | 117 | # ############################################################################# | 144 | # ############################################################################# |
1743 | 118 | # Done. | 145 | # Done. |
1744 | 119 | # ############################################################################# | 146 | # ############################################################################# |
1745 | 120 | $sb->wipe_clean($dbh); | 147 | $sb->wipe_clean($dbh); |
1746 | 121 | $sb->wipe_clean($dbh2) if $dbh2; | ||
1747 | 122 | ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); | 148 | ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); |
1749 | 123 | exit; | 149 | done_testing; |
1750 | 124 | 150 | ||
1751 | === modified file 't/pt-find/pt-find.t' | |||
1752 | --- t/pt-find/pt-find.t 2012-12-07 22:46:51 +0000 | |||
1753 | +++ t/pt-find/pt-find.t 2012-12-20 23:20:29 +0000 | |||
1754 | @@ -22,9 +22,8 @@ | |||
1755 | 22 | if ( !$dbh ) { | 22 | if ( !$dbh ) { |
1756 | 23 | plan skip_all => 'Cannot connect to sandbox master'; | 23 | plan skip_all => 'Cannot connect to sandbox master'; |
1757 | 24 | } | 24 | } |
1761 | 25 | else { | 25 | |
1762 | 26 | plan tests => 23; | 26 | $sb->load_file('master', 't/lib/samples/stored-objs.sql'); |
1760 | 27 | } | ||
1763 | 28 | 27 | ||
1764 | 29 | my $output; | 28 | my $output; |
1765 | 30 | my $cnf = '/tmp/12345/my.sandbox.cnf'; | 29 | my $cnf = '/tmp/12345/my.sandbox.cnf'; |
1766 | @@ -111,6 +110,80 @@ | |||
1767 | 111 | "--view that doesn't match" | 110 | "--view that doesn't match" |
1768 | 112 | ); | 111 | ); |
1769 | 113 | 112 | ||
1770 | 113 | # Test --procedure. | ||
1771 | 114 | $output = `$cmd pt_find --procedure param1 --print`; | ||
1772 | 115 | is( | ||
1773 | 116 | $output, | ||
1774 | 117 | "`pt_find`.`PROCEDURE simpleproc`\n", | ||
1775 | 118 | '--procedure that matches' | ||
1776 | 119 | ); | ||
1777 | 120 | |||
1778 | 121 | $output = `$cmd pt_find --procedure blah --print`; | ||
1779 | 122 | is( | ||
1780 | 123 | $output, | ||
1781 | 124 | '', | ||
1782 | 125 | "--procedure that doesn't match" | ||
1783 | 126 | ); | ||
1784 | 127 | |||
1785 | 128 | # Test --function. | ||
1786 | 129 | $output = `$cmd pt_find --function Hello --print`; | ||
1787 | 130 | is( | ||
1788 | 131 | $output, | ||
1789 | 132 | "`pt_find`.`FUNCTION hello`\n", | ||
1790 | 133 | '--function that matches' | ||
1791 | 134 | ); | ||
1792 | 135 | |||
1793 | 136 | $output = `$cmd pt_find --function blah --print`; | ||
1794 | 137 | is( | ||
1795 | 138 | $output, | ||
1796 | 139 | '', | ||
1797 | 140 | "--function that doesn't match" | ||
1798 | 141 | ); | ||
1799 | 142 | |||
1800 | 143 | # Test --trigger without --trigger-table. | ||
1801 | 144 | $output = `$cmd pt_find --trigger 'INSERT INTO t2' --print`; | ||
1802 | 145 | is( | ||
1803 | 146 | $output, | ||
1804 | 147 | "`pt_find`.`INSERT TRIGGER ins_trg on t1`\n", | ||
1805 | 148 | '--trigger that matches without --trigger-table' | ||
1806 | 149 | ); | ||
1807 | 150 | |||
1808 | 151 | $output = `$cmd pt_find --trigger blah --print`; | ||
1809 | 152 | is( | ||
1810 | 153 | $output, | ||
1811 | 154 | '', | ||
1812 | 155 | "--trigger that doesn't match without --trigger-table" | ||
1813 | 156 | ); | ||
1814 | 157 | |||
1815 | 158 | # Test --trigger with --trigger-table. | ||
1816 | 159 | $output = `$cmd pt_find --trigger 'INSERT INTO t2' --trigger-table t1 --print`; | ||
1817 | 160 | is( | ||
1818 | 161 | $output, | ||
1819 | 162 | "`pt_find`.`INSERT TRIGGER ins_trg on t1`\n", | ||
1820 | 163 | '--trigger that matches with matching --trigger-table' | ||
1821 | 164 | ); | ||
1822 | 165 | |||
1823 | 166 | $output = `$cmd pt_find --trigger blah --trigger-table t1 --print`; | ||
1824 | 167 | is( | ||
1825 | 168 | $output, | ||
1826 | 169 | '', | ||
1827 | 170 | "--trigger that doesn't match with matching --trigger-table" | ||
1828 | 171 | ); | ||
1829 | 172 | |||
1830 | 173 | $output = `$cmd pt_find --trigger 'INSERT INTO t2' --trigger-table foo --print`; | ||
1831 | 174 | is( | ||
1832 | 175 | $output, | ||
1833 | 176 | '', | ||
1834 | 177 | '--trigger that matches with non-matching --trigger-table' | ||
1835 | 178 | ); | ||
1836 | 179 | |||
1837 | 180 | $output = `$cmd pt_find --trigger blah --trigger-table foo --print`; | ||
1838 | 181 | is( | ||
1839 | 182 | $output, | ||
1840 | 183 | '', | ||
1841 | 184 | "--trigger that doesn't match with non-matching --trigger-table" | ||
1842 | 185 | ); | ||
1843 | 186 | |||
1844 | 114 | # Test NULL sizes. | 187 | # Test NULL sizes. |
1845 | 115 | $output = `$cmd sakila --datasize NULL`, | 188 | $output = `$cmd sakila --datasize NULL`, |
1846 | 116 | is( | 189 | is( |
1847 | @@ -223,4 +296,5 @@ | |||
1848 | 223 | # ############################################################################# | 296 | # ############################################################################# |
1849 | 224 | $sb->wipe_clean($dbh); | 297 | $sb->wipe_clean($dbh); |
1850 | 225 | ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); | 298 | ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); |
1851 | 299 | done_testing; | ||
1852 | 226 | exit; | 300 | exit; |
1853 | 227 | 301 | ||
1854 | === modified file 't/pt-heartbeat/bugs.t' | |||
1855 | --- t/pt-heartbeat/bugs.t 2012-12-13 16:20:48 +0000 | |||
1856 | +++ t/pt-heartbeat/bugs.t 2012-12-20 23:20:29 +0000 | |||
1857 | @@ -84,6 +84,8 @@ | |||
1858 | 84 | 84 | ||
1859 | 85 | start_update_instance( $master_port ); | 85 | start_update_instance( $master_port ); |
1860 | 86 | 86 | ||
1861 | 87 | PerconaTest::wait_for_table($slave1_dbh, 'test.heartbeat', 'server_id=12345'); | ||
1862 | 88 | |||
1863 | 87 | my $slave1_dsn = $sb->dsn_for('slave1'); | 89 | my $slave1_dsn = $sb->dsn_for('slave1'); |
1864 | 88 | # Using full_output here to work around a Perl bug: Only the first explicit | 90 | # Using full_output here to work around a Perl bug: Only the first explicit |
1865 | 89 | # tzset works. | 91 | # tzset works. |
1866 | 90 | 92 | ||
1867 | === modified file 't/pt-kill/basics.t' | |||
1868 | --- t/pt-kill/basics.t 2012-07-12 22:49:15 +0000 | |||
1869 | +++ t/pt-kill/basics.t 2012-12-20 23:20:29 +0000 | |||
1870 | @@ -35,7 +35,7 @@ | |||
1871 | 35 | 35 | ||
1872 | 36 | # Shell out to a sleep(10) query and try to capture the query. | 36 | # Shell out to a sleep(10) query and try to capture the query. |
1873 | 37 | # Backticks don't work here. | 37 | # Backticks don't work here. |
1875 | 38 | system("/tmp/12345/use -h127.1 -P12345 -umsandbox -pmsandbox -e 'select sleep(5)' >/dev/null &"); | 38 | system("/tmp/12345/use -e 'select sleep(5)' >/dev/null &"); |
1876 | 39 | 39 | ||
1877 | 40 | $output = `$cmd --busy-time 1s --print --run-time 10`; | 40 | $output = `$cmd --busy-time 1s --print --run-time 10`; |
1878 | 41 | 41 | ||
1879 | @@ -59,7 +59,7 @@ | |||
1880 | 59 | # --iterations was 0, and another bug when --run-time was not respected. | 59 | # --iterations was 0, and another bug when --run-time was not respected. |
1881 | 60 | # Do it all over again, this time with --iterations 0. | 60 | # Do it all over again, this time with --iterations 0. |
1882 | 61 | # Re issue 1181, --iterations no longer exists, but we'll still keep this test. | 61 | # Re issue 1181, --iterations no longer exists, but we'll still keep this test. |
1884 | 62 | system("/tmp/12345/use -h127.1 -P12345 -umsandbox -pmsandbox -e 'select sleep(10)' >/dev/null&"); | 62 | system("/tmp/12345/use -e 'select sleep(10)' >/dev/null&"); |
1885 | 63 | $output = `$cmd --busy-time 1s --print --run-time 11s`; | 63 | $output = `$cmd --busy-time 1s --print --run-time 11s`; |
1886 | 64 | @times = $output =~ m/\(Query (\d+) sec\)/g; | 64 | @times = $output =~ m/\(Query (\d+) sec\)/g; |
1887 | 65 | ok( | 65 | ok( |
1888 | 66 | 66 | ||
1889 | === modified file 't/pt-kill/kill.t' | |||
1890 | --- t/pt-kill/kill.t 2012-12-04 21:05:32 +0000 | |||
1891 | +++ t/pt-kill/kill.t 2012-12-20 23:20:29 +0000 | |||
1892 | @@ -35,7 +35,7 @@ | |||
1893 | 35 | # TODO: These tests need something to match, so we background | 35 | # TODO: These tests need something to match, so we background |
1894 | 36 | # a SLEEP(4) query and match that, but this isn't ideal because | 36 | # a SLEEP(4) query and match that, but this isn't ideal because |
1895 | 37 | # it's time-based. Better is to use a specific db and --match-db. | 37 | # it's time-based. Better is to use a specific db and --match-db. |
1897 | 38 | my $sys_cmd = "/tmp/12345/use -h127.1 -P12345 -umsandbox -pmsandbox -e 'select sleep(4)' >/dev/null 2>&1 &"; | 38 | my $sys_cmd = "/tmp/12345/use -e 'select sleep(4)' >/dev/null 2>&1 &"; |
1898 | 39 | 39 | ||
1899 | 40 | # ############################################################################# | 40 | # ############################################################################# |
1900 | 41 | # Test that --kill kills the connection. | 41 | # Test that --kill kills the connection. |
1901 | @@ -83,7 +83,7 @@ | |||
1902 | 83 | # Here's how this works. This cmd is going to try 2 queries on the same | 83 | # Here's how this works. This cmd is going to try 2 queries on the same |
1903 | 84 | # connection: sleep5 and sleep3. --kill-query will kill sleep5 causing | 84 | # connection: sleep5 and sleep3. --kill-query will kill sleep5 causing |
1904 | 85 | # sleep3 to start using the same connection id (pid). | 85 | # sleep3 to start using the same connection id (pid). |
1906 | 86 | system("/tmp/12345/use -h127.1 -P12345 -umsandbox -pmsandbox -e 'select sleep(5); select sleep(3)' >/dev/null&"); | 86 | system("/tmp/12345/use -e 'select sleep(5); select sleep(3)' >/dev/null&"); |
1907 | 87 | sleep 0.5; | 87 | sleep 0.5; |
1908 | 88 | $rows = $dbh->selectall_hashref('show processlist', 'id'); | 88 | $rows = $dbh->selectall_hashref('show processlist', 'id'); |
1909 | 89 | $pid = 0; # reuse, reset | 89 | $pid = 0; # reuse, reset |
1910 | 90 | 90 | ||
1911 | === modified file 't/pt-mysql-summary/pt-mysql-summary.t' | |||
1912 | --- t/pt-mysql-summary/pt-mysql-summary.t 2012-11-27 22:05:45 +0000 | |||
1913 | +++ t/pt-mysql-summary/pt-mysql-summary.t 2012-12-20 23:20:29 +0000 | |||
1914 | @@ -19,13 +19,18 @@ | |||
1915 | 19 | 19 | ||
1916 | 20 | local $ENV{PTDEBUG} = ""; | 20 | local $ENV{PTDEBUG} = ""; |
1917 | 21 | 21 | ||
1918 | 22 | # mysqldump from earlier versions doesn't seem to work with 5.6, | ||
1919 | 23 | # so use the actual mysqldump from each MySQL bin which should | ||
1920 | 24 | # always be compatible with itself. | ||
1921 | 25 | my $env = qq\CMD_MYSQLDUMP="$ENV{PERCONA_TOOLKIT_SANDBOX}/bin/mysqldump"\; | ||
1922 | 26 | |||
1923 | 22 | # | 27 | # |
1924 | 23 | # --save-samples | 28 | # --save-samples |
1925 | 24 | # | 29 | # |
1926 | 25 | 30 | ||
1927 | 26 | my $dir = tempdir( "percona-testXXXXXXXX", CLEANUP => 1 ); | 31 | my $dir = tempdir( "percona-testXXXXXXXX", CLEANUP => 1 ); |
1928 | 27 | 32 | ||
1930 | 28 | `$trunk/bin/$tool --sleep 1 --save-samples $dir -- --defaults-file=/tmp/12345/my.sandbox.cnf`; | 33 | `$env $trunk/bin/$tool --sleep 1 --save-samples $dir -- --defaults-file=/tmp/12345/my.sandbox.cnf`; |
1931 | 29 | 34 | ||
1932 | 30 | ok( | 35 | ok( |
1933 | 31 | -e $dir, | 36 | -e $dir, |
1934 | @@ -41,13 +46,13 @@ | |||
1935 | 41 | "And leaves all files in there" | 46 | "And leaves all files in there" |
1936 | 42 | ) or diag($n_files, `ls -l $dir`); | 47 | ) or diag($n_files, `ls -l $dir`); |
1937 | 43 | 48 | ||
1939 | 44 | undef($dir); | 49 | undef($dir); # rm the dir because CLEANUP => 1 |
1940 | 45 | 50 | ||
1941 | 46 | # | 51 | # |
1942 | 47 | # --databases | 52 | # --databases |
1943 | 48 | # | 53 | # |
1944 | 49 | 54 | ||
1946 | 50 | my $out = `$trunk/bin/$tool --sleep 1 --databases mysql 2>/dev/null -- --defaults-file=/tmp/12345/my.sandbox.cnf`; | 55 | my $out = `$env $trunk/bin/$tool --sleep 1 --databases mysql 2>/dev/null -- --defaults-file=/tmp/12345/my.sandbox.cnf`; |
1947 | 51 | 56 | ||
1948 | 52 | like( | 57 | like( |
1949 | 53 | $out, | 58 | $out, |
1950 | @@ -61,8 +66,7 @@ | |||
1951 | 61 | no_diff( | 66 | no_diff( |
1952 | 62 | sub { | 67 | sub { |
1953 | 63 | local $ENV{_NO_FALSE_NEGATIVES} = 1; | 68 | local $ENV{_NO_FALSE_NEGATIVES} = 1; |
1956 | 64 | my $out = `$trunk/bin/$tool --read-samples $trunk/t/pt-mysql-summary/samples/temp00$i -- --defaults-file=/tmp/12345/my.sandbox.cnf | tail -n+3 | perl -wlnpe 's/Skipping schema analysis.*/Skipping schema analysis/'`; | 69 | print `$env $trunk/bin/$tool --read-samples $trunk/t/pt-mysql-summary/samples/temp00$i -- --defaults-file=/tmp/12345/my.sandbox.cnf | tail -n+3 | perl -wlnpe 's/Skipping schema analysis.*/Skipping schema analysis/'` |
1955 | 65 | print $out; | ||
1957 | 66 | }, | 70 | }, |
1958 | 67 | "t/pt-mysql-summary/samples/expected_output_temp00$i.txt", | 71 | "t/pt-mysql-summary/samples/expected_output_temp00$i.txt", |
1959 | 68 | ), | 72 | ), |
1960 | @@ -82,4 +86,3 @@ | |||
1961 | 82 | ); | 86 | ); |
1962 | 83 | 87 | ||
1963 | 84 | done_testing; | 88 | done_testing; |
1964 | 85 | exit; | ||
1965 | 86 | 89 | ||
1966 | === modified file 't/pt-online-schema-change/samples/bug_1045317.sql' | |||
1967 | --- t/pt-online-schema-change/samples/bug_1045317.sql 2012-11-06 17:22:56 +0000 | |||
1968 | +++ t/pt-online-schema-change/samples/bug_1045317.sql 2012-12-20 23:20:29 +0000 | |||
1969 | @@ -6,5 +6,5 @@ | |||
1970 | 6 | `val` ENUM('M','E','H') NOT NULL, | 6 | `val` ENUM('M','E','H') NOT NULL, |
1971 | 7 | PRIMARY KEY (`id`) | 7 | PRIMARY KEY (`id`) |
1972 | 8 | ); | 8 | ); |
1973 | 9 | |||
1974 | 10 | INSERT INTO `bits` VALUES (1, 'M'), (2, 'E'), (3, 'H'); | 9 | INSERT INTO `bits` VALUES (1, 'M'), (2, 'E'), (3, 'H'); |
1975 | 10 | ANALYZE TABLE bits; | ||
1976 | 11 | 11 | ||
1977 | === modified file 't/pt-query-digest/explain.t' | |||
1978 | --- t/pt-query-digest/explain.t 2012-11-21 16:58:40 +0000 | |||
1979 | +++ t/pt-query-digest/explain.t 2012-12-20 23:20:29 +0000 | |||
1980 | @@ -23,9 +23,6 @@ | |||
1981 | 23 | if ( !$dbh ) { | 23 | if ( !$dbh ) { |
1982 | 24 | plan skip_all => 'Cannot connect to sandbox master'; | 24 | plan skip_all => 'Cannot connect to sandbox master'; |
1983 | 25 | } | 25 | } |
1984 | 26 | else { | ||
1985 | 27 | plan tests => 6; | ||
1986 | 28 | } | ||
1987 | 29 | 26 | ||
1988 | 30 | my $sample = "t/pt-query-digest/samples/"; | 27 | my $sample = "t/pt-query-digest/samples/"; |
1989 | 31 | 28 | ||
1990 | @@ -90,7 +87,6 @@ | |||
1991 | 90 | 'Analysis for slow007 with --explain, failed', | 87 | 'Analysis for slow007 with --explain, failed', |
1992 | 91 | ); | 88 | ); |
1993 | 92 | 89 | ||
1994 | 93 | |||
1995 | 94 | # ############################################################################# | 90 | # ############################################################################# |
1996 | 95 | # Issue 1196: mk-query-digest --explain is broken | 91 | # Issue 1196: mk-query-digest --explain is broken |
1997 | 96 | # ############################################################################# | 92 | # ############################################################################# |
1998 | @@ -102,9 +98,9 @@ | |||
1999 | 102 | '--report-format', 'profile,query_report', | 98 | '--report-format', 'profile,query_report', |
2000 | 103 | "$trunk/t/pt-query-digest/samples/issue_1196.log",) | 99 | "$trunk/t/pt-query-digest/samples/issue_1196.log",) |
2001 | 104 | }, | 100 | }, |
2005 | 105 | ($sandbox_version ge '5.1' | 101 | ( $sandbox_version eq '5.6' ? "$sample/issue_1196-output-5.6.txt" |
2006 | 106 | ? "t/pt-query-digest/samples/issue_1196-output.txt" | 102 | : $sandbox_version ge '5.1' ? "$sample/issue_1196-output.txt" |
2007 | 107 | : "t/pt-query-digest/samples/issue_1196-output-5.0.txt"), | 103 | : "$sample/issue_1196-output-5.0.txt"), |
2008 | 108 | ), | 104 | ), |
2009 | 109 | "--explain sparkline uses event db and doesn't crash ea (issue 1196" | 105 | "--explain sparkline uses event db and doesn't crash ea (issue 1196" |
2010 | 110 | ); | 106 | ); |
2011 | @@ -114,4 +110,4 @@ | |||
2012 | 114 | # ############################################################################# | 110 | # ############################################################################# |
2013 | 115 | $sb->wipe_clean($dbh); | 111 | $sb->wipe_clean($dbh); |
2014 | 116 | ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); | 112 | ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); |
2016 | 117 | exit; | 113 | done_testing; |
2017 | 118 | 114 | ||
2018 | === added file 't/pt-query-digest/samples/issue_1196-output-5.6.txt' | |||
2019 | --- t/pt-query-digest/samples/issue_1196-output-5.6.txt 1970-01-01 00:00:00 +0000 | |||
2020 | +++ t/pt-query-digest/samples/issue_1196-output-5.6.txt 2012-12-20 23:20:29 +0000 | |||
2021 | @@ -0,0 +1,62 @@ | |||
2022 | 1 | |||
2023 | 2 | # Profile | ||
2024 | 3 | # Rank Query ID Response time Calls R/Call Apdx V/M EXPLAIN Item | ||
2025 | 4 | # ==== ================== ============= ===== ====== ==== ===== ======= ======== | ||
2026 | 5 | # 1 0xD4B6A5CD2F2F485C 0.2148 100.0% 1 0.2148 1.00 0.00 TF>aa SELECT t | ||
2027 | 6 | |||
2028 | 7 | # Query 1: 0 QPS, 0x concurrency, ID 0xD4B6A5CD2F2F485C at byte 0 ________ | ||
2029 | 8 | # This item is included in the report because it matches --limit. | ||
2030 | 9 | # Scores: Apdex = 1.00 [1.0]*, V/M = 0.00 | ||
2031 | 10 | # EXPLAIN sparkline: TF>aa | ||
2032 | 11 | # Query_time sparkline: | ^ | | ||
2033 | 12 | # Time range: all events occurred at 2010-12-14 16:12:28 | ||
2034 | 13 | # Attribute pct total min max avg 95% stddev median | ||
2035 | 14 | # ============ === ======= ======= ======= ======= ======= ======= ======= | ||
2036 | 15 | # Count 100 1 | ||
2037 | 16 | # Exec time 100 215ms 215ms 215ms 215ms 215ms 0 215ms | ||
2038 | 17 | # Lock time 99 162us 162us 162us 162us 162us 0 162us | ||
2039 | 18 | # Rows sent 100 10 10 10 10 10 0 10 | ||
2040 | 19 | # Rows examine 100 1.96k 1.96k 1.96k 1.96k 1.96k 0 1.96k | ||
2041 | 20 | # Query size 100 82 82 82 82 82 0 82 | ||
2042 | 21 | # String: | ||
2043 | 22 | # Databases issue_1196 | ||
2044 | 23 | # Hosts localhost | ||
2045 | 24 | # Users root | ||
2046 | 25 | # Query_time distribution | ||
2047 | 26 | # 1us | ||
2048 | 27 | # 10us | ||
2049 | 28 | # 100us | ||
2050 | 29 | # 1ms | ||
2051 | 30 | # 10ms | ||
2052 | 31 | # 100ms ################################################################ | ||
2053 | 32 | # 1s | ||
2054 | 33 | # 10s+ | ||
2055 | 34 | # Tables | ||
2056 | 35 | # SHOW TABLE STATUS FROM `issue_1196` LIKE 't'\G | ||
2057 | 36 | # SHOW CREATE TABLE `issue_1196`.`t`\G | ||
2058 | 37 | # EXPLAIN /*!50100 PARTITIONS*/ | ||
2059 | 38 | select t.a, count(*) from t join t t2 using(a) group by 1 order by 2 desc limit 10\G | ||
2060 | 39 | # *************************** 1. row *************************** | ||
2061 | 40 | # id: 1 | ||
2062 | 41 | # select_type: SIMPLE | ||
2063 | 42 | # table: t | ||
2064 | 43 | # partitions: NULL | ||
2065 | 44 | # type: ALL | ||
2066 | 45 | # possible_keys: NULL | ||
2067 | 46 | # key: NULL | ||
2068 | 47 | # key_len: NULL | ||
2069 | 48 | # ref: NULL | ||
2070 | 49 | # rows: 14 | ||
2071 | 50 | # Extra: Using temporary; Using filesort | ||
2072 | 51 | # *************************** 2. row *************************** | ||
2073 | 52 | # id: 1 | ||
2074 | 53 | # select_type: SIMPLE | ||
2075 | 54 | # table: t2 | ||
2076 | 55 | # partitions: NULL | ||
2077 | 56 | # type: ALL | ||
2078 | 57 | # possible_keys: NULL | ||
2079 | 58 | # key: NULL | ||
2080 | 59 | # key_len: NULL | ||
2081 | 60 | # ref: NULL | ||
2082 | 61 | # rows: 14 | ||
2083 | 62 | # Extra: Using where; Using join buffer (Block Nested Loop) | ||
2084 | 0 | 63 | ||
2085 | === modified file 't/pt-table-checksum/basics.t' | |||
2086 | --- t/pt-table-checksum/basics.t 2012-11-21 16:58:40 +0000 | |||
2087 | +++ t/pt-table-checksum/basics.t 2012-12-20 23:20:29 +0000 | |||
2088 | @@ -68,9 +68,7 @@ | |||
2089 | 68 | ok( | 68 | ok( |
2090 | 69 | no_diff( | 69 | no_diff( |
2091 | 70 | sub { pt_table_checksum::main(@args) }, | 70 | sub { pt_table_checksum::main(@args) }, |
2095 | 71 | $sandbox_version gt "5.1 " ? "$sample/default-results-5.5.txt" | 71 | "$sample/default-results-$sandbox_version.txt", |
2093 | 72 | : $sandbox_version gt "5.0 " ? "$sample/default-results-5.1.txt" | ||
2094 | 73 | : "$sample/default-results-5.0.txt", | ||
2096 | 74 | post_pipe => 'awk \'{print $2 " " $3 " " $4 " " $6 " " $8}\'', | 72 | post_pipe => 'awk \'{print $2 " " $3 " " $4 " " $6 " " $8}\'', |
2097 | 75 | ), | 73 | ), |
2098 | 76 | "Default checksum" | 74 | "Default checksum" |
2099 | @@ -93,29 +91,28 @@ | |||
2100 | 93 | ok( | 91 | ok( |
2101 | 94 | no_diff( | 92 | no_diff( |
2102 | 95 | sub { pt_table_checksum::main(@args, qw(--chunk-time 0)) }, | 93 | sub { pt_table_checksum::main(@args, qw(--chunk-time 0)) }, |
2106 | 96 | $sandbox_version gt "5.1" ? "$sample/static-chunk-size-results-5.5.txt" | 94 | "$sample/static-chunk-size-results-$sandbox_version.txt", |
2104 | 97 | : $sandbox_version gt "5.0" ? "$sample/static-chunk-size-results-5.1.txt" | ||
2105 | 98 | : "$sample/static-chunk-size-results-5.0.txt", | ||
2107 | 99 | post_pipe => 'awk \'{print $2 " " $3 " " $4 " " $5 " " $6 " " $8}\'', | 95 | post_pipe => 'awk \'{print $2 " " $3 " " $4 " " $5 " " $6 " " $8}\'', |
2108 | 100 | ), | 96 | ), |
2109 | 101 | "Static chunk size (--chunk-time 0)" | 97 | "Static chunk size (--chunk-time 0)" |
2110 | 102 | ); | 98 | ); |
2111 | 103 | 99 | ||
2112 | 100 | my $n_checksums = $sandbox_version eq "5.6" ? 89 | ||
2113 | 101 | : $sandbox_version eq "5.5" ? 90 | ||
2114 | 102 | : $sandbox_version eq "5.1" ? 89 | ||
2115 | 103 | : 85; | ||
2116 | 104 | |||
2117 | 104 | $row = $master_dbh->selectrow_arrayref("select count(*) from percona.checksums"); | 105 | $row = $master_dbh->selectrow_arrayref("select count(*) from percona.checksums"); |
2118 | 105 | is( | 106 | is( |
2119 | 106 | $row->[0], | 107 | $row->[0], |
2123 | 107 | ( $sandbox_version gt "5.1" ? 90 | 108 | $n_checksums, |
2121 | 108 | : $sandbox_version gt "5.0" ? 89 | ||
2122 | 109 | : 85), | ||
2124 | 110 | 'Expected checksums on master' | 109 | 'Expected checksums on master' |
2125 | 111 | ); | 110 | ); |
2126 | 112 | 111 | ||
2127 | 113 | $row = $slave1_dbh->selectrow_arrayref("select count(*) from percona.checksums"); | 112 | $row = $slave1_dbh->selectrow_arrayref("select count(*) from percona.checksums"); |
2128 | 114 | is( | 113 | is( |
2129 | 115 | $row->[0], | 114 | $row->[0], |
2133 | 116 | ( $sandbox_version gt "5.1" ? 90 | 115 | $n_checksums, |
2131 | 117 | : $sandbox_version gt "5.0" ? 89 | ||
2132 | 118 | : 85), | ||
2134 | 119 | 'Expected checksums on slave' | 116 | 'Expected checksums on slave' |
2135 | 120 | ); | 117 | ); |
2136 | 121 | 118 | ||
2137 | 122 | 119 | ||
2138 | === modified file 't/pt-table-checksum/error_handling.t' | |||
2139 | --- t/pt-table-checksum/error_handling.t 2012-11-21 16:58:40 +0000 | |||
2140 | +++ t/pt-table-checksum/error_handling.t 2012-12-20 23:20:29 +0000 | |||
2141 | @@ -178,8 +178,8 @@ | |||
2142 | 178 | # Use the --replicate table created by the previous ^ tests. | 178 | # Use the --replicate table created by the previous ^ tests. |
2143 | 179 | 179 | ||
2144 | 180 | # Create a user that can't create the --replicate table. | 180 | # Create a user that can't create the --replicate table. |
2147 | 181 | diag(`/tmp/12345/use -uroot -pmsandbox < $trunk/t/lib/samples/ro-checksum-user.sql`); | 181 | diag(`/tmp/12345/use -uroot < $trunk/t/lib/samples/ro-checksum-user.sql`); |
2148 | 182 | diag(`/tmp/12345/use -uroot -pmsandbox -e "GRANT REPLICATION CLIENT, REPLICATION SLAVE ON *.* TO ro_checksum_user\@'%'"`); | 182 | diag(`/tmp/12345/use -uroot -e "GRANT REPLICATION CLIENT, REPLICATION SLAVE ON *.* TO ro_checksum_user\@'%'"`); |
2149 | 183 | 183 | ||
2150 | 184 | # Remove the --replicate table from slave1 and slave2, | 184 | # Remove the --replicate table from slave1 and slave2, |
2151 | 185 | # so it's only on the master... | 185 | # so it's only on the master... |
2152 | @@ -199,7 +199,7 @@ | |||
2153 | 199 | "CREATE DATABASE error and db is missing on slaves (bug 1039569)" | 199 | "CREATE DATABASE error and db is missing on slaves (bug 1039569)" |
2154 | 200 | ); | 200 | ); |
2155 | 201 | 201 | ||
2157 | 202 | diag(`/tmp/12345/use -uroot -pmsandbox -e "DROP USER ro_checksum_user\@'%'"`); | 202 | diag(`/tmp/12345/use -uroot -e "DROP USER ro_checksum_user\@'%'"`); |
2158 | 203 | 203 | ||
2159 | 204 | # ############################################################################# | 204 | # ############################################################################# |
2160 | 205 | # Done. | 205 | # Done. |
2161 | 206 | 206 | ||
2162 | === modified file 't/pt-table-checksum/run_time.t' | |||
2163 | --- t/pt-table-checksum/run_time.t 2012-11-21 16:58:40 +0000 | |||
2164 | +++ t/pt-table-checksum/run_time.t 2012-12-20 23:20:29 +0000 | |||
2165 | @@ -44,7 +44,7 @@ | |||
2166 | 44 | my $t = time - $t0; | 44 | my $t = time - $t0; |
2167 | 45 | 45 | ||
2168 | 46 | ok( | 46 | ok( |
2170 | 47 | $t >= 1.5 && $t <= 2.5, | 47 | $t >= 1.1 && $t <= 2.5, |
2171 | 48 | "Ran in roughly --run-time 1 second" | 48 | "Ran in roughly --run-time 1 second" |
2172 | 49 | ) or diag("Actual run time: $t"); | 49 | ) or diag("Actual run time: $t"); |
2173 | 50 | 50 | ||
2174 | 51 | 51 | ||
2175 | === added file 't/pt-table-checksum/samples/default-results-5.6.txt' | |||
2176 | --- t/pt-table-checksum/samples/default-results-5.6.txt 1970-01-01 00:00:00 +0000 | |||
2177 | +++ t/pt-table-checksum/samples/default-results-5.6.txt 2012-12-20 23:20:29 +0000 | |||
2178 | @@ -0,0 +1,41 @@ | |||
2179 | 1 | ERRORS DIFFS ROWS SKIPPED TABLE | ||
2180 | 2 | 0 0 0 0 mysql.columns_priv | ||
2181 | 3 | 0 0 2 0 mysql.db | ||
2182 | 4 | 0 0 0 0 mysql.event | ||
2183 | 5 | 0 0 0 0 mysql.func | ||
2184 | 6 | 0 0 39 0 mysql.help_category | ||
2185 | 7 | 0 0 461 0 mysql.help_keyword | ||
2186 | 8 | 0 0 1045 0 mysql.help_relation | ||
2187 | 9 | 0 0 324 0 mysql.help_topic | ||
2188 | 10 | 0 0 0 0 mysql.ndb_binlog_index | ||
2189 | 11 | 0 0 0 0 mysql.plugin | ||
2190 | 12 | 0 0 0 0 mysql.proc | ||
2191 | 13 | 0 0 0 0 mysql.procs_priv | ||
2192 | 14 | 0 0 2 0 mysql.proxies_priv | ||
2193 | 15 | 0 0 0 0 mysql.servers | ||
2194 | 16 | 0 0 0 0 mysql.tables_priv | ||
2195 | 17 | 0 0 0 0 mysql.time_zone | ||
2196 | 18 | 0 0 0 0 mysql.time_zone_leap_second | ||
2197 | 19 | 0 0 0 0 mysql.time_zone_name | ||
2198 | 20 | 0 0 0 0 mysql.time_zone_transition | ||
2199 | 21 | 0 0 0 0 mysql.time_zone_transition_type | ||
2200 | 22 | 0 0 2 0 mysql.user | ||
2201 | 23 | 0 0 42 0 percona_test.checksums | ||
2202 | 24 | 0 0 1 0 percona_test.load_data | ||
2203 | 25 | 0 0 1 0 percona_test.sentinel | ||
2204 | 26 | 0 0 200 0 sakila.actor | ||
2205 | 27 | 0 0 603 0 sakila.address | ||
2206 | 28 | 0 0 16 0 sakila.category | ||
2207 | 29 | 0 0 600 0 sakila.city | ||
2208 | 30 | 0 0 109 0 sakila.country | ||
2209 | 31 | 0 0 599 0 sakila.customer | ||
2210 | 32 | 0 0 1000 0 sakila.film | ||
2211 | 33 | 0 0 5462 0 sakila.film_actor | ||
2212 | 34 | 0 0 1000 0 sakila.film_category | ||
2213 | 35 | 0 0 1000 0 sakila.film_text | ||
2214 | 36 | 0 0 4581 0 sakila.inventory | ||
2215 | 37 | 0 0 6 0 sakila.language | ||
2216 | 38 | 0 0 16049 0 sakila.payment | ||
2217 | 39 | 0 0 16044 0 sakila.rental | ||
2218 | 40 | 0 0 2 0 sakila.staff | ||
2219 | 41 | 0 0 2 0 sakila.store | ||
2220 | 0 | 42 | ||
2221 | === added file 't/pt-table-checksum/samples/repl-table-myisam.sql' | |||
2222 | --- t/pt-table-checksum/samples/repl-table-myisam.sql 1970-01-01 00:00:00 +0000 | |||
2223 | +++ t/pt-table-checksum/samples/repl-table-myisam.sql 2012-12-20 23:20:29 +0000 | |||
2224 | @@ -0,0 +1,19 @@ | |||
2225 | 1 | DROP DATABASE IF EXISTS percona; | ||
2226 | 2 | CREATE DATABASE percona; | ||
2227 | 3 | USE percona; | ||
2228 | 4 | CREATE TABLE checksums ( | ||
2229 | 5 | db char(64) NOT NULL, | ||
2230 | 6 | tbl char(64) NOT NULL, | ||
2231 | 7 | chunk int NOT NULL, | ||
2232 | 8 | chunk_time float NULL, | ||
2233 | 9 | chunk_index varchar(200) NULL, | ||
2234 | 10 | lower_boundary text NULL, | ||
2235 | 11 | upper_boundary text NULL, | ||
2236 | 12 | this_crc char(40) NOT NULL, | ||
2237 | 13 | this_cnt int NOT NULL, | ||
2238 | 14 | master_crc char(40) NULL, | ||
2239 | 15 | master_cnt int NULL, | ||
2240 | 16 | ts timestamp NOT NULL, | ||
2241 | 17 | PRIMARY KEY (db, tbl, chunk), | ||
2242 | 18 | INDEX ts_db_tbl (ts, db, tbl) | ||
2243 | 19 | ) ENGINE=MyISAM; | ||
2244 | 0 | 20 | ||
2245 | === added file 't/pt-table-checksum/samples/static-chunk-size-results-5.6.txt' | |||
2246 | --- t/pt-table-checksum/samples/static-chunk-size-results-5.6.txt 1970-01-01 00:00:00 +0000 | |||
2247 | +++ t/pt-table-checksum/samples/static-chunk-size-results-5.6.txt 2012-12-20 23:20:29 +0000 | |||
2248 | @@ -0,0 +1,41 @@ | |||
2249 | 1 | ERRORS DIFFS ROWS CHUNKS SKIPPED TABLE | ||
2250 | 2 | 0 0 0 1 0 mysql.columns_priv | ||
2251 | 3 | 0 0 2 1 0 mysql.db | ||
2252 | 4 | 0 0 0 1 0 mysql.event | ||
2253 | 5 | 0 0 0 1 0 mysql.func | ||
2254 | 6 | 0 0 39 1 0 mysql.help_category | ||
2255 | 7 | 0 0 461 1 0 mysql.help_keyword | ||
2256 | 8 | 0 0 1045 1 0 mysql.help_relation | ||
2257 | 9 | 0 0 324 1 0 mysql.help_topic | ||
2258 | 10 | 0 0 0 1 0 mysql.ndb_binlog_index | ||
2259 | 11 | 0 0 0 1 0 mysql.plugin | ||
2260 | 12 | 0 0 0 1 0 mysql.proc | ||
2261 | 13 | 0 0 0 1 0 mysql.procs_priv | ||
2262 | 14 | 0 0 2 1 0 mysql.proxies_priv | ||
2263 | 15 | 0 0 0 1 0 mysql.servers | ||
2264 | 16 | 0 0 0 1 0 mysql.tables_priv | ||
2265 | 17 | 0 0 0 1 0 mysql.time_zone | ||
2266 | 18 | 0 0 0 1 0 mysql.time_zone_leap_second | ||
2267 | 19 | 0 0 0 1 0 mysql.time_zone_name | ||
2268 | 20 | 0 0 0 1 0 mysql.time_zone_transition | ||
2269 | 21 | 0 0 0 1 0 mysql.time_zone_transition_type | ||
2270 | 22 | 0 0 2 1 0 mysql.user | ||
2271 | 23 | 0 0 42 1 0 percona_test.checksums | ||
2272 | 24 | 0 0 1 1 0 percona_test.load_data | ||
2273 | 25 | 0 0 1 1 0 percona_test.sentinel | ||
2274 | 26 | 0 0 200 1 0 sakila.actor | ||
2275 | 27 | 0 0 603 1 0 sakila.address | ||
2276 | 28 | 0 0 16 1 0 sakila.category | ||
2277 | 29 | 0 0 600 1 0 sakila.city | ||
2278 | 30 | 0 0 109 1 0 sakila.country | ||
2279 | 31 | 0 0 599 1 0 sakila.customer | ||
2280 | 32 | 0 0 1000 1 0 sakila.film | ||
2281 | 33 | 0 0 5462 8 0 sakila.film_actor | ||
2282 | 34 | 0 0 1000 1 0 sakila.film_category | ||
2283 | 35 | 0 0 1000 1 0 sakila.film_text | ||
2284 | 36 | 0 0 4581 7 0 sakila.inventory | ||
2285 | 37 | 0 0 6 1 0 sakila.language | ||
2286 | 38 | 0 0 16049 19 0 sakila.payment | ||
2287 | 39 | 0 0 16044 19 0 sakila.rental | ||
2288 | 40 | 0 0 2 1 0 sakila.staff | ||
2289 | 41 | 0 0 2 1 0 sakila.store | ||
2290 | 0 | 42 | ||
2291 | === modified file 't/pt-table-checksum/skip_innodb.t' | |||
2292 | --- t/pt-table-checksum/skip_innodb.t 2012-11-21 16:58:40 +0000 | |||
2293 | +++ t/pt-table-checksum/skip_innodb.t 2012-12-20 23:20:29 +0000 | |||
2294 | @@ -15,11 +15,12 @@ | |||
2295 | 15 | use Sandbox; | 15 | use Sandbox; |
2296 | 16 | require "$trunk/bin/pt-table-checksum"; | 16 | require "$trunk/bin/pt-table-checksum"; |
2297 | 17 | 17 | ||
2300 | 18 | diag("Stopping/reconfiguring/restarting sandboxes 12348 and 12349"); | 18 | if ( $sandbox_version eq '5.6' ) { |
2301 | 19 | diag(`$trunk/sandbox/stop-sandbox 12348 >/dev/null`); | 19 | plan skip_all => 'http://bugs.mysql.com/67798'; |
2302 | 20 | } | ||
2303 | 21 | |||
2304 | 22 | diag(`$trunk/sandbox/stop-sandbox 12348 12349 >/dev/null`); | ||
2305 | 20 | diag(`SKIP_INNODB=1 $trunk/sandbox/start-sandbox master 12348 >/dev/null`); | 23 | diag(`SKIP_INNODB=1 $trunk/sandbox/start-sandbox master 12348 >/dev/null`); |
2306 | 21 | |||
2307 | 22 | diag(`$trunk/sandbox/stop-sandbox 12349 >/dev/null`); | ||
2308 | 23 | diag(`SKIP_INNODB=1 $trunk/sandbox/start-sandbox slave 12349 12348 >/dev/null`); | 24 | diag(`SKIP_INNODB=1 $trunk/sandbox/start-sandbox slave 12349 12348 >/dev/null`); |
2309 | 24 | 25 | ||
2310 | 25 | my $dp = new DSNParser(opts=>$dsn_opts); | 26 | my $dp = new DSNParser(opts=>$dsn_opts); |
2311 | @@ -33,9 +34,6 @@ | |||
2312 | 33 | elsif ( !$slave_dbh ) { | 34 | elsif ( !$slave_dbh ) { |
2313 | 34 | plan skip_all => 'Cannot connect to sandbox slave 12349'; | 35 | plan skip_all => 'Cannot connect to sandbox slave 12349'; |
2314 | 35 | } | 36 | } |
2315 | 36 | else { | ||
2316 | 37 | plan tests => 3; | ||
2317 | 38 | } | ||
2318 | 39 | 37 | ||
2319 | 40 | # The sandbox servers run with lock_wait_timeout=3 and it's not dynamic | 38 | # The sandbox servers run with lock_wait_timeout=3 and it's not dynamic |
2320 | 41 | # so we need to specify --lock-wait-timeout=3 else the tool will die. | 39 | # so we need to specify --lock-wait-timeout=3 else the tool will die. |
2321 | @@ -45,6 +43,26 @@ | |||
2322 | 45 | my $output; | 43 | my $output; |
2323 | 46 | my $retval; | 44 | my $retval; |
2324 | 47 | 45 | ||
2325 | 46 | if ( $sandbox_version ge '5.6' ) { | ||
2326 | 47 | # Before MySQL 5.6, even with the InnoDB engine off, creating an InnoDB | ||
2327 | 48 | # table would simply result in: | ||
2328 | 49 | # | ||
2329 | 50 | # mysql> create table t (i int) engine=innodb; | ||
2330 | 51 | # Query OK, 0 rows affected, 2 warnings (0.01 sec) | ||
2331 | 52 | # | ||
2332 | 53 | # mysql> show warnings; | ||
2333 | 54 | # +---------+------+-------------------------------------------+ | ||
2334 | 55 | # | Level | Code | Message | | ||
2335 | 56 | # +---------+------+-------------------------------------------+ | ||
2336 | 57 | # | Warning | 1286 | Unknown table engine 'innodb' | | ||
2337 | 58 | # | Warning | 1266 | Using storage engine MyISAM for table 't' | | ||
2338 | 59 | # +---------+------+-------------------------------------------+ | ||
2339 | 60 | # | ||
2340 | 61 | # But 5.6 throws an error. So we have to create the table manually. | ||
2341 | 62 | $sb->load_file('master1', "t/pt-table-checksum/samples/repl-table-myisam.sql"); | ||
2342 | 63 | $sb->wait_for_slaves(master => 'master1', slave => 'master2'); | ||
2343 | 64 | } | ||
2344 | 65 | |||
2345 | 48 | $output = output( | 66 | $output = output( |
2346 | 49 | sub { $retval = pt_table_checksum::main(@args) }, | 67 | sub { $retval = pt_table_checksum::main(@args) }, |
2347 | 50 | stderr => 1, | 68 | stderr => 1, |
2348 | @@ -60,13 +78,12 @@ | |||
2349 | 60 | $retval, | 78 | $retval, |
2350 | 61 | 0, | 79 | 0, |
2351 | 62 | "0 exit status (bug 996110)" | 80 | "0 exit status (bug 996110)" |
2353 | 63 | ); | 81 | ) or diag($output); |
2354 | 64 | 82 | ||
2355 | 65 | # ############################################################################# | 83 | # ############################################################################# |
2356 | 66 | # Done. | 84 | # Done. |
2357 | 67 | # ############################################################################# | 85 | # ############################################################################# |
2361 | 68 | diag('Shutting down sandboxes'); | 86 | $sb->wipe_clean($master_dbh); |
2362 | 69 | diag(`$trunk/sandbox/stop-sandbox 12349 >/dev/null`); | 87 | diag(`$trunk/sandbox/stop-sandbox 12349 12348 >/dev/null`); |
2360 | 70 | diag(`$trunk/sandbox/stop-sandbox 12348 >/dev/null`); | ||
2363 | 71 | ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); | 88 | ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); |
2365 | 72 | exit; | 89 | done_testing; |
2366 | 73 | 90 | ||
2367 | === modified file 't/pt-table-sync/basics.t' | |||
2368 | --- t/pt-table-sync/basics.t 2012-06-07 14:25:44 +0000 | |||
2369 | +++ t/pt-table-sync/basics.t 2012-12-20 23:20:29 +0000 | |||
2370 | @@ -188,7 +188,7 @@ | |||
2371 | 188 | 188 | ||
2372 | 189 | like( | 189 | like( |
2373 | 190 | $output, | 190 | $output, |
2375 | 191 | qr/^REPLACE INTO `sakila`.`actor`\(`actor_id`, `first_name`, `last_name`, `last_update`\) VALUES \('30', 'SANDRA', 'PECK', '2006-02-15 04:34:33'\)/, | 191 | qr/^REPLACE INTO `sakila`.`actor`\(`actor_id`, `first_name`, `last_name`, `last_update`\) VALUES \('30', 'SANDRA', 'PECK', '2006-02-15 11:34:33'\)/, |
2376 | 192 | "--replicate with char index col (bug 911996)" | 192 | "--replicate with char index col (bug 911996)" |
2377 | 193 | ); | 193 | ); |
2378 | 194 | 194 | ||
2379 | 195 | 195 | ||
2380 | === modified file 't/pt-upgrade/warnings.t' | |||
2381 | --- t/pt-upgrade/warnings.t 2012-10-17 22:19:44 +0000 | |||
2382 | +++ t/pt-upgrade/warnings.t 2012-12-20 23:20:29 +0000 | |||
2383 | @@ -15,38 +15,36 @@ | |||
2384 | 15 | use Sandbox; | 15 | use Sandbox; |
2385 | 16 | require "$trunk/bin/pt-upgrade"; | 16 | require "$trunk/bin/pt-upgrade"; |
2386 | 17 | 17 | ||
2389 | 18 | # This runs immediately if the server is already running, else it starts it. | 18 | diag(`$trunk/sandbox/stop-sandbox master 12349 >/dev/null`); |
2390 | 19 | diag(`$trunk/sandbox/start-sandbox master 12348 >/dev/null`); | 19 | diag(`QUERY_CACHE_SIZE=1048576 $trunk/sandbox/start-sandbox master 12349 >/dev/null`); |
2391 | 20 | 20 | ||
2392 | 21 | my $dp = new DSNParser(opts=>$dsn_opts); | 21 | my $dp = new DSNParser(opts=>$dsn_opts); |
2393 | 22 | my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); | 22 | my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); |
2394 | 23 | my $dbh1 = $sb->get_dbh_for('master'); | 23 | my $dbh1 = $sb->get_dbh_for('master'); |
2396 | 24 | my $dbh2 = $sb->get_dbh_for('master1'); | 24 | my $dbh2 = $sb->get_dbh_for('master2'); |
2397 | 25 | 25 | ||
2398 | 26 | if ( !$dbh1 ) { | 26 | if ( !$dbh1 ) { |
2399 | 27 | diag(`$trunk/sandbox/stop-sandbox master 12348 >/dev/null`); | ||
2400 | 28 | plan skip_all => 'Cannot connect to sandbox master'; | 27 | plan skip_all => 'Cannot connect to sandbox master'; |
2401 | 29 | } | 28 | } |
2402 | 30 | elsif ( !$dbh2 ) { | 29 | elsif ( !$dbh2 ) { |
2404 | 31 | diag(`$trunk/sandbox/stop-sandbox master 12348 >/dev/null`); | 30 | diag(`$trunk/sandbox/stop-sandbox master 12349 >/dev/null`); |
2405 | 32 | plan skip_all => 'Cannot connect to second sandbox master'; | 31 | plan skip_all => 'Cannot connect to second sandbox master'; |
2406 | 33 | } | 32 | } |
2407 | 34 | 33 | ||
2408 | 35 | $sb->load_file('master', 't/pt-upgrade/samples/001/tables.sql'); | 34 | $sb->load_file('master', 't/pt-upgrade/samples/001/tables.sql'); |
2410 | 36 | $sb->load_file('master1', 't/pt-upgrade/samples/001/tables.sql'); | 35 | $sb->load_file('master2', 't/pt-upgrade/samples/001/tables.sql'); |
2411 | 37 | 36 | ||
2412 | 38 | my $output; | 37 | my $output; |
2414 | 39 | my $cmd = "$trunk/bin/pt-upgrade h=127.1,P=12345,u=msandbox,p=msandbox,L=1 P=12348 --compare results,warnings --zero-query-times --compare-results-method rows --limit 10"; | 38 | my $cmd = "$trunk/bin/pt-upgrade h=127.1,P=12345,u=msandbox,p=msandbox,L=1 P=12349 --compare results,warnings --zero-query-times --compare-results-method rows --limit 10"; |
2415 | 40 | 39 | ||
2416 | 41 | # This test really deals with, | 40 | # This test really deals with, |
2417 | 42 | # http://code.google.com/p/maatkit/issues/detail?id=754 | 41 | # http://code.google.com/p/maatkit/issues/detail?id=754 |
2418 | 43 | # http://bugs.mysql.com/bug.php?id=49634 | 42 | # http://bugs.mysql.com/bug.php?id=49634 |
2419 | 44 | 43 | ||
2420 | 45 | $dbh2->do('set global query_cache_size=1000000'); | ||
2421 | 46 | |||
2422 | 47 | my $qc = $dbh2->selectrow_arrayref("show variables like 'query_cache_size'")->[1]; | 44 | my $qc = $dbh2->selectrow_arrayref("show variables like 'query_cache_size'")->[1]; |
2425 | 48 | ok( | 45 | is( |
2426 | 49 | $qc > 999000, | 46 | $qc, |
2427 | 47 | 1048576, | ||
2428 | 50 | 'Query size' | 48 | 'Query size' |
2429 | 51 | ); | 49 | ); |
2430 | 52 | 50 | ||
2431 | @@ -62,7 +60,7 @@ | |||
2432 | 62 | $output = `$cmd $trunk/t/pt-upgrade/samples/001/one-error.log`; | 60 | $output = `$cmd $trunk/t/pt-upgrade/samples/001/one-error.log`; |
2433 | 63 | like( | 61 | like( |
2434 | 64 | $output, | 62 | $output, |
2436 | 65 | qr/# 3B323396273BC4C7-1 127.1:12348 Failed to execute query.+Unknown column 'borked' in 'field list' \[for Statement "select borked"\] at .+?\n\n/, | 63 | qr/# 3B323396273BC4C7-1 127.1:12349 Failed to execute query.+Unknown column 'borked' in 'field list' \[for Statement "select borked"\] at .+?\n\n/, |
2437 | 66 | '--clear-warnings', | 64 | '--clear-warnings', |
2438 | 67 | ); | 65 | ); |
2439 | 68 | 66 | ||
2440 | @@ -78,22 +76,15 @@ | |||
2441 | 78 | $output = `$cmd --no-clear-warnings $trunk/t/pt-upgrade/samples/001/one-error.log`; | 76 | $output = `$cmd --no-clear-warnings $trunk/t/pt-upgrade/samples/001/one-error.log`; |
2442 | 79 | like( | 77 | like( |
2443 | 80 | $output, | 78 | $output, |
2445 | 81 | qr/# 3B323396273BC4C7-1 127.1:12348 Failed to execute query.+Unknown column 'borked' in 'field list' \[for Statement "select borked"\] at .+?\n\n/, | 79 | qr/# 3B323396273BC4C7-1 127.1:12349 Failed to execute query.+Unknown column 'borked' in 'field list' \[for Statement "select borked"\] at .+?\n\n/, |
2446 | 82 | '--no-clear-warnings' | 80 | '--no-clear-warnings' |
2447 | 83 | ); | 81 | ); |
2448 | 84 | 82 | ||
2449 | 85 | $dbh2->do('set global query_cache_size=0'); | ||
2450 | 86 | $qc = $dbh2->selectrow_arrayref("show variables like 'query_cache_size'")->[1]; | ||
2451 | 87 | ok( | ||
2452 | 88 | $qc == 0, | ||
2453 | 89 | 'Query size' | ||
2454 | 90 | ); | ||
2455 | 91 | |||
2456 | 92 | # ############################################################################# | 83 | # ############################################################################# |
2457 | 93 | # Done. | 84 | # Done. |
2458 | 94 | # ############################################################################# | 85 | # ############################################################################# |
2459 | 86 | diag(`$trunk/sandbox/stop-sandbox 12349 >/dev/null`); | ||
2460 | 95 | $sb->wipe_clean($dbh1); | 87 | $sb->wipe_clean($dbh1); |
2461 | 96 | diag(`$trunk/sandbox/stop-sandbox master 12348 >/dev/null`); | ||
2462 | 97 | ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); | 88 | ok($sb->ok(), "Sandbox servers") or BAIL_OUT(__FILE__ . " broke the sandbox"); |
2463 | 98 | done_testing; | 89 | done_testing; |
2464 | 99 | exit; | 90 | exit; |