mariadb/client
Andrei Elkin 5d48ea7d07 MDEV-10963 Fragmented BINLOG query
The problem was originally stated in
  http://bugs.mysql.com/bug.php?id=82212
The size of an base64-encoded Rows_log_event exceeds its
vanilla byte representation in 4/3 times.
When a binlogged event size is about 1GB mysqlbinlog generates
a BINLOG query that can't be send out due to its size.

It is fixed with fragmenting the BINLOG argument C-string into
(approximate) halves when the base64 encoded event is over 1GB size.
The mysqlbinlog in such case puts out

    SET @binlog_fragment_0='base64-encoded-fragment_0';
    SET @binlog_fragment_1='base64-encoded-fragment_1';
    BINLOG @binlog_fragment_0, @binlog_fragment_1;

to represent a big BINLOG.
For prompt memory release BINLOG handler is made to reset the BINLOG argument
user variables in the middle of processing, as if @binlog_fragment_{0,1} = NULL
is assigned.

Notice the 2 fragments are enough, though the client and server still may
need to tweak their @@max_allowed_packet to satisfy to the fragment
size (which they would have to do anyway with greater number of
fragments, should that be desired).

On the lower level the following changes are made:

Log_event::print_base64()
  remains to call encoder and store the encoded data into a cache but
  now *without* doing any formatting. The latter is left for time
  when the cache is copied to an output file (e.g mysqlbinlog output).
  No formatting behavior is also reflected by the change in the meaning
  of the last argument which specifies whether to cache the encoded data.

Rows_log_event::print_helper()
  is made to invoke a specialized fragmented cache-to-file copying function
  which is

copy_cache_to_file_wrapped()
  that takes care of fragmenting also optionally wraps encoded
  strings (fragments) into SQL stanzas.

my_b_copy_to_file()
  is refactored to into my_b_copy_all_to_file(). The former function
  is generalized
  to accepts more a limit argument to constraint the copying and does
  not reinitialize anymore the cache into reading mode.
  The limit does not do any effect on the fully read cache.
2019-01-24 20:44:50 +02:00
..
async_example.c MWL#192: non-blocking client API, after-review fixes. 2012-01-06 12:43:18 +01:00
client_priv.h Merge branch '10.0' 10.1 2017-04-28 20:19:32 +02:00
CMakeLists.txt MDEV-17868 mysqltest fails to link with system PCRE libraries 2019-01-24 10:34:05 +01:00
completion_hash.cc Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER 2013-03-19 13:29:12 +01:00
completion_hash.h Fix for Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER 2013-03-19 15:53:48 +01:00
echo.c Fix for Bug 16395495 - OLD FSF ADDRESS IN GPL HEADER 2013-03-19 15:53:48 +01:00
get_password.c mysql-5.5.32 merge 2013-07-16 19:09:54 +02:00
my_readline.h MDEV-4297 mysql --binary-mode 2013-06-10 21:45:30 +02:00
mysql.cc Merge branch '10.0' into 10.1 2018-10-30 15:10:01 +01:00
mysql_plugin.c spelling fixes 2017-03-07 13:38:06 +04:00
mysql_upgrade.c MDEV-14265 - RPMLint warning: shared-lib-calls-exit 2018-03-16 13:26:52 +04:00
mysqladmin.cc MDEV-14265 - RPMLint warning: shared-lib-calls-exit 2018-03-16 13:26:52 +04:00
mysqlbinlog.cc MDEV-10963 Fragmented BINLOG query 2019-01-24 20:44:50 +02:00
mysqlcheck.c MDEV-14265 - RPMLint warning: shared-lib-calls-exit 2018-03-16 13:26:52 +04:00
mysqldump.c Merge branch '10.0' into 10.1 2018-06-12 18:55:27 +03:00
mysqlimport.c MDEV-14265 - RPMLint warning: shared-lib-calls-exit 2018-03-16 13:26:52 +04:00
mysqlshow.c MDEV-14265 - RPMLint warning: shared-lib-calls-exit 2018-03-16 13:26:52 +04:00
mysqlslap.c Merge branch '10.0' into 10.1 2018-06-12 18:55:27 +03:00
mysqltest.cc Merge 10.0 into 10.1 2018-12-13 13:37:21 +02:00
readline.cc MDEV-6650 - LINT_INIT emits code in non-debug builds 2015-03-16 14:48:22 +04:00
sql_string.cc.dontuse spelling fixes 2017-03-07 13:38:06 +04:00
sql_string.h.dontuse mysql-5.5.32 merge 2013-07-16 19:09:54 +02:00