Merge lp:~icgood/maria/maria-fix-bug4319 into lp:maria

Proposed by Ian Good
Status: Merged
Merge reported by: Michael Widenius
Merged at revision: not available
Proposed branch: lp:~icgood/maria/maria-fix-bug4319
Merge into: lp:maria
Diff against target: 24 lines (+6/-1)
1 file modified
sql/log_event.cc (+6/-1)
To merge this branch: bzr merge lp:~icgood/maria/maria-fix-bug4319
Reviewer Review Type Date Requested Status
Michael Widenius Approve
Review via email: mp+155115@code.launchpad.net

Description of the change

This change fixes JIRA bug MDEV-4319 (https://mariadb.atlassian.net/browse/MDEV-4319), a bug that I also submitted.

The output of mysqlbinlog (with "-v --base64-output=DECODE-ROWS" flags) can not always be read or parsed correctly when string columns contain single-quotes or backslash characters. See the linked bug report for very specific reproducible incidents.

The fix for this bug is to escape single-quote and backslash characters on output, so that the result is both more readable and more easily parse-able. Four additional lines of code and one additional line of comments were added by this fix.

To post a comment you must log in.
lp:~icgood/maria/maria-fix-bug4319 updated
3505. By Ian Good

fixed ordering of ifs

Revision history for this message
Ian Good (icgood) wrote :

This patch and all fixes to it are provided to the MariaDB Foundation under the MCA (https://kb.askmonty.org/en/mca/).

Revision history for this message
Michael Widenius (monty) wrote :

Hi!

>>>>> "Ian" == Ian Good <email address hidden> writes:

Ian> This patch and all fixes to it are provided to the MariaDB Foundation under the MCA (https://kb.askmonty.org/en/mca/).

Great, thanks!

Regards,
Monty

Revision history for this message
Michael Widenius (monty) wrote :

I have now merged and pushed this into 5.5

Note that the patch only affects comment and not how replication is executed.

I also changed the hex number to characters to make the code easier to read.

review: Approve
Revision history for this message
Michael Widenius (monty) wrote :

Hi!

>>>>> "Ian" == Ian Good <email address hidden> writes:

Ian> Ian Good has proposed merging lp:~icgood/maria/maria-fix-bug4319 into lp:maria.
Ian> Requested reviews:
Ian> Maria-captains (maria-captains)

Ian> For more details, see:
Ian> https://code.launchpad.net/~icgood/maria/maria-fix-bug4319/+merge/155115

Ian> This change fixes JIRA bug MDEV-4319 (https://mariadb.atlassian.net/browse/MDEV-4319), a bug that I also submitted.

Ian> The output of mysqlbinlog (with "-v --base64-output=DECODE-ROWS" flags) can not always be read or parsed correctly when string columns contain single-quotes or backslash characters. See the linked bug report for very specific reproducible incidents.

Ian> The fix for this bug is to escape single-quote and backslash characters on output, so that the result is both more readable and more easily parse-able. Four additional lines of code and one additional line of comments were added by this fix.
Ian> --
Ian> https://code.launchpad.net/~icgood/maria/maria-fix-bug4319/+merge/155115
Ian> Your team Maria-captains is requested to review the proposed merge of lp:~icgood/maria/maria-fix-bug4319 into lp:maria.

I have now merged and pushed this into 5.5

Thanks for the bug fix!

Regards,
Monty

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sql/log_event.cc'
2--- sql/log_event.cc 2013-01-31 08:48:19 +0000
3+++ sql/log_event.cc 2013-03-23 21:10:29 +0000
4@@ -1808,6 +1808,7 @@
5 /**
6 Prints a quoted string to io cache.
7 Control characters are displayed as hex sequence, e.g. \x00
8+ Single-quote and backslash characters are escaped with a \
9
10 @param[in] file IO cache
11 @param[in] prt Pointer to string
12@@ -1821,7 +1822,11 @@
13 my_b_printf(file, "'");
14 for (s= ptr; length > 0 ; s++, length--)
15 {
16- if (*s > 0x1F)
17+ if (*s == 0x27)
18+ my_b_write(file, "\\'", 2);
19+ else if (*s == 0x5C)
20+ my_b_write(file, "\\\\", 2);
21+ else if (*s > 0x1F)
22 my_b_write(file, s, 1);
23 else
24 {

Subscribers

People subscribed via source and target branches