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
=== modified file 'sql/log_event.cc'
--- sql/log_event.cc 2013-01-31 08:48:19 +0000
+++ sql/log_event.cc 2013-03-23 21:10:29 +0000
@@ -1808,6 +1808,7 @@
1808/**1808/**
1809 Prints a quoted string to io cache.1809 Prints a quoted string to io cache.
1810 Control characters are displayed as hex sequence, e.g. \x001810 Control characters are displayed as hex sequence, e.g. \x00
1811 Single-quote and backslash characters are escaped with a \
1811 1812
1812 @param[in] file IO cache1813 @param[in] file IO cache
1813 @param[in] prt Pointer to string1814 @param[in] prt Pointer to string
@@ -1821,7 +1822,11 @@
1821 my_b_printf(file, "'");1822 my_b_printf(file, "'");
1822 for (s= ptr; length > 0 ; s++, length--)1823 for (s= ptr; length > 0 ; s++, length--)
1823 {1824 {
1824 if (*s > 0x1F)1825 if (*s == 0x27)
1826 my_b_write(file, "\\'", 2);
1827 else if (*s == 0x5C)
1828 my_b_write(file, "\\\\", 2);
1829 else if (*s > 0x1F)
1825 my_b_write(file, s, 1);1830 my_b_write(file, s, 1);
1826 else1831 else
1827 {1832 {

Subscribers

People subscribed via source and target branches