Merge lp:~percona-toolkit-dev/percona-toolkit/pt-upgrade-fails-on-SELECT-INTO-queries-1421781 into lp:~percona-toolkit-dev/percona-toolkit/release-2.2.14
Proposed by
Frank Cizmich
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Daniel Nichter | ||||
Approved revision: | 615 | ||||
Merged at revision: | 616 | ||||
Proposed branch: | lp:~percona-toolkit-dev/percona-toolkit/pt-upgrade-fails-on-SELECT-INTO-queries-1421781 | ||||
Merge into: | lp:~percona-toolkit-dev/percona-toolkit/release-2.2.14 | ||||
Diff against target: |
136 lines (+84/-4) 4 files modified
bin/pt-upgrade (+11/-3) lib/ResultWriter.pm (+3/-1) t/pt-upgrade/issue_1421781.t (+66/-0) t/pt-upgrade/samples/select_into.log (+4/-0) |
||||
To merge this branch: | bzr merge lp:~percona-toolkit-dev/percona-toolkit/pt-upgrade-fails-on-SELECT-INTO-queries-1421781 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel Nichter | Approve | ||
Review via email: mp+254640@code.launchpad.net |
Description of the change
Proplem:
pt-upgrade fails when log contains queries of the form:
SELECT...INTO
This is because the tool treats it as a regular select that returns rows, so it performs first the execute(), which works fine, but then fails when attempting to fetch() since DBI considers the operation already over.
Solution:
Filter these out via regex. (excludes the three forms , OUTFILE, DUMPFILE and @variable)
Notes:
- changes made in 2 place: module ResultWriter and tool's main()
- also created test case
To post a comment you must log in.
Would be good to document that these queries are skipped/ignored.