mariadb/client
Andrei Elkin feac078f15 MDEV-16372 ER_BASE64_DECODE_ERROR upon replaying binary log via mysqlbinlog --verbose
(This commit is exclusively for 10.1 branch, do not merge it to upper ones)

In case of a pattern of non-STMT_END-marked Rows-log-event (A) followed by
a STMT_END marked one (B) mysqlbinlog mixes up the base64 encoded rows events
with their pseudo sql representation produced by the verbose option:
      BINLOG '
        base64 encoded data for A
        ### verbose section for A
        base64 encoded data for B
        ### verbose section for B
      '/*!*/;
In effect the produced BINLOG '...' query is not valid and is rejected with the error.
Examples of this way malformed BINLOG could have been found in binlog_row_annotate.result
that gets corrected with the patch.

The issue is fixed with introduction an auxiliary IO_CACHE to hold on the verbose
comments until the terminal STMT_END event is found. The new cache is emptied
out after two pre-existing ones are done at that time.
The correctly produced output now for the above case is as the following:
      BINLOG '
        base64 encoded data for A
        base64 encoded data for B
      '/*!*/;
        ### verbose section for A
        ### verbose section for B

Thanks to Alexey Midenkov for the problem recognition and attempt to tackle,
Venkatesh Duggirala who produced a patch for the upstream whose
idea is exploited here, as well as to MDEV-23077 reporter LukeXwang who
also contributed a piece of a patch aiming at this issue.

Extra: mysqlbinlog_row_minimal refined to not produce mutable numeric values into the result file.
2020-08-31 18:45:14 +03:00
..
async_example.c MWL#192: non-blocking client API, after-review fixes. 2012-01-06 12:43:18 +01:00
client_priv.h MDEV-22037: Add ability to skip content of some tables (work around for MDEV-20939) 2020-03-25 16:03:22 +01:00
CMakeLists.txt Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
completion_hash.cc Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
completion_hash.h Update FSF Address 2019-05-11 21:29:06 +03:00
echo.c Update FSF Address 2019-05-11 21:29:06 +03:00
get_password.c Update FSF Address 2019-05-11 21:29:06 +03:00
my_readline.h Update FSF Address 2019-05-11 21:29:06 +03:00
mysql.cc Client spelling mistakes 2020-06-08 11:58:44 +02:00
mysql_plugin.c Client spelling mistakes 2020-06-08 11:58:44 +02:00
mysql_upgrade.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
mysqladmin.cc Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
mysqlbinlog.cc MDEV-16372 ER_BASE64_DECODE_ERROR upon replaying binary log via mysqlbinlog --verbose 2020-08-31 18:45:14 +03:00
mysqlcheck.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
mysqldump.c Client spelling mistakes 2020-06-08 11:58:44 +02:00
mysqlimport.c Client spelling mistakes 2020-06-08 11:58:44 +02:00
mysqlshow.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
mysqlslap.c Client spelling mistakes 2020-06-08 11:58:44 +02:00
mysqltest.cc Client spelling mistakes 2020-06-08 11:58:44 +02:00
readline.cc Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
sql_string.cc.dontuse Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
sql_string.h.dontuse Update FSF Address 2019-05-11 21:29:06 +03:00