summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--appveyor.yml17
-rw-r--r--client/client_priv.h1
-rw-r--r--client/mysql.cc8
-rw-r--r--client/mysqladmin.cc8
-rw-r--r--client/mysqlbinlog.cc234
-rw-r--r--client/mysqlcheck.c8
-rw-r--r--client/mysqldump.c8
-rw-r--r--client/mysqlimport.c8
-rw-r--r--client/mysqlshow.c8
-rw-r--r--client/mysqlslap.c8
-rw-r--r--client/mysqltest.cc11
-rw-r--r--cmake/install_layout.cmake6
-rw-r--r--cmake/make_dist.cmake.in3
-rw-r--r--cmake/plugin.cmake2
-rwxr-xr-xdebian/autobake-deb.sh4
-rw-r--r--debian/control27
-rwxr-xr-xdebian/rules19
-rw-r--r--extra/mariabackup/xtrabackup.cc8
-rw-r--r--include/m_string.h9
-rw-r--r--include/my_sys.h13
-rw-r--r--include/mysql.h.pp2
-rw-r--r--include/typelib.h2
m---------libmariadb0
-rw-r--r--libmysqld/libmysqld.c3
-rw-r--r--man/mysqladmin.1186
-rw-r--r--mysql-test/include/truncate_file.inc11
-rw-r--r--mysql-test/r/create_drop_binlog.result1
-rw-r--r--mysql-test/r/create_or_replace.result20
-rw-r--r--mysql-test/r/cte_nonrecursive.result118
-rw-r--r--mysql-test/r/explain_json.result60
-rw-r--r--mysql-test/r/func_json.result5
-rw-r--r--mysql-test/r/func_misc.result15
-rw-r--r--mysql-test/r/func_set.result24
-rw-r--r--mysql-test/r/group_by.result25
-rw-r--r--mysql-test/r/having.result15
-rw-r--r--mysql-test/r/join_outer.result13
-rw-r--r--mysql-test/r/join_outer_jcl6.result13
-rw-r--r--mysql-test/r/mysqlbinlog.result2
-rw-r--r--mysql-test/r/mysqlbinlog_row_compressed.result8
-rw-r--r--mysql-test/r/mysqlbinlog_row_minimal.result8
-rw-r--r--mysql-test/r/openssl_1.result6
-rw-r--r--mysql-test/r/partition_windows.result4
-rw-r--r--mysql-test/r/ps.result47
-rw-r--r--mysql-test/r/view.result14
-rw-r--r--mysql-test/r/win.result2
-rw-r--r--mysql-test/suite/binlog/r/binlog_base64_flag.result14
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result256
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result20
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result20
-rw-r--r--mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result12
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_annotate.result26
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result8
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result14
-rw-r--r--mysql-test/suite/binlog/r/flashback.result10
-rw-r--r--mysql-test/suite/binlog/t/binlog_base64_flag.test9
-rw-r--r--mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test7
-rw-r--r--mysql-test/suite/binlog_encryption/binlog_row_annotate.result13
-rw-r--r--mysql-test/suite/galera/r/galera_gtid_slave.result36
-rw-r--r--mysql-test/suite/galera/r/galera_gtid_slave_sst_rsync.result130
-rw-r--r--mysql-test/suite/galera/r/query_cache.result130
-rw-r--r--mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt2
-rw-r--r--mysql-test/suite/galera/t/galera_gtid_slave.cnf18
-rw-r--r--mysql-test/suite/galera/t/galera_gtid_slave.test78
-rw-r--r--mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.cnf18
-rw-r--r--mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.test207
-rw-r--r--mysql-test/suite/galera/t/query_cache.test89
-rw-r--r--mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf122
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_gtid_2_cluster.result231
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.cnf28
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.test292
-rw-r--r--mysql-test/suite/gcol/disabled.def1
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result11
-rw-r--r--mysql-test/suite/gcol/r/innodb_virtual_index.result4
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test7
-rw-r--r--mysql-test/suite/gcol/t/innodb_virtual_index.test6
-rw-r--r--mysql-test/suite/innodb/r/innodb-autoinc.result6
-rw-r--r--mysql-test/suite/innodb/r/innodb-index-debug.result29
-rw-r--r--mysql-test/suite/innodb/r/innodb.result80
-rw-r--r--mysql-test/suite/innodb/r/purge_secondary.result148
-rw-r--r--mysql-test/suite/innodb/t/innodb-autoinc.test5
-rw-r--r--mysql-test/suite/innodb/t/innodb-index-debug.test39
-rw-r--r--mysql-test/suite/innodb/t/innodb.test70
-rw-r--r--mysql-test/suite/innodb/t/purge_secondary.opt1
-rw-r--r--mysql-test/suite/innodb/t/purge_secondary.test131
-rw-r--r--mysql-test/suite/mariabackup/apply-log-only-incr.result7
-rw-r--r--mysql-test/suite/mariabackup/apply-log-only-incr.test7
-rw-r--r--mysql-test/suite/parts/inc/part_alter_values.inc37
-rw-r--r--mysql-test/suite/parts/r/partition_alter_innodb.result44
-rw-r--r--mysql-test/suite/parts/r/partition_alter_maria.result44
-rw-r--r--mysql-test/suite/parts/r/partition_alter_myisam.result57
-rw-r--r--mysql-test/suite/parts/t/partition_alter_innodb.test4
-rw-r--r--mysql-test/suite/parts/t/partition_alter_maria.test3
-rw-r--r--mysql-test/suite/parts/t/partition_alter_myisam.test35
-rw-r--r--mysql-test/suite/plugins/r/binlog-simple_plugin_check.result19
-rw-r--r--mysql-test/suite/plugins/t/binlog-simple_plugin_check.test31
-rw-r--r--mysql-test/suite/roles/flush_roles-12366.result543
-rw-r--r--mysql-test/suite/roles/flush_roles-12366.test379
-rw-r--r--mysql-test/suite/roles/set_role-13655.result52
-rw-r--r--mysql-test/suite/roles/set_role-13655.test49
-rw-r--r--mysql-test/suite/rpl/r/rpl_ctype_latin1.result34
-rw-r--r--mysql-test/suite/rpl/t/rpl_ctype_latin1.test44
-rw-r--r--mysql-test/suite/rpl/t/rpl_manual_change_index_file.test2
-rw-r--r--mysql-test/suite/vcol/r/range.result4
-rw-r--r--mysql-test/t/create_drop_binlog.test2
-rw-r--r--mysql-test/t/create_or_replace.test24
-rw-r--r--mysql-test/t/cte_nonrecursive.test63
-rw-r--r--mysql-test/t/explain_json.test11
-rw-r--r--mysql-test/t/func_json.test8
-rw-r--r--mysql-test/t/func_misc.test21
-rw-r--r--mysql-test/t/func_set.test18
-rw-r--r--mysql-test/t/group_by.test26
-rw-r--r--mysql-test/t/having.test17
-rw-r--r--mysql-test/t/join_outer.test14
-rw-r--r--mysql-test/t/mysqlbinlog_row_big.test1
-rw-r--r--mysql-test/t/openssl_1.test3
-rw-r--r--mysql-test/t/ps.test48
-rw-r--r--mysql-test/t/view.test12
-rw-r--r--mysql-test/t/xml.test2
-rw-r--r--mysys/mf_iocache.c11
-rw-r--r--mysys/mf_iocache2.c27
-rw-r--r--mysys/my_default.c6
-rw-r--r--mysys/my_malloc.c2
-rw-r--r--mysys/my_read.c40
-rw-r--r--mysys/typelib.c12
-rw-r--r--scripts/mysqld_safe.sh4
-rw-r--r--scripts/wsrep_sst_xtrabackup-v2.sh2
-rw-r--r--sql-common/client.c7
-rw-r--r--sql/events.cc2
-rw-r--r--sql/filesort.cc26
-rw-r--r--sql/filesort_utils.cc2
-rw-r--r--sql/ha_partition.cc69
-rw-r--r--sql/item.cc9
-rw-r--r--sql/item_cmpfunc.cc13
-rw-r--r--sql/item_cmpfunc.h1
-rw-r--r--sql/item_jsonfunc.cc6
-rw-r--r--sql/item_sum.cc2
-rw-r--r--sql/log.cc177
-rw-r--r--sql/log.h9
-rw-r--r--sql/log_event.cc1620
-rw-r--r--sql/log_event.h215
-rw-r--r--sql/log_event_old.cc36
-rw-r--r--sql/log_event_old.h10
-rw-r--r--sql/mysqld.cc23
-rw-r--r--sql/opt_range.cc9
-rw-r--r--sql/partition_info.cc20
-rw-r--r--sql/partition_info.h1
-rw-r--r--sql/rpl_gtid.cc5
-rw-r--r--sql/share/errmsg-utf8.txt48
-rw-r--r--sql/signal_handler.cc4
-rw-r--r--sql/slave.h2
-rw-r--r--sql/sp.cc4
-rw-r--r--sql/sql_acl.cc61
-rw-r--r--sql/sql_cache.cc2
-rw-r--r--sql/sql_class.cc9
-rw-r--r--sql/sql_connect.cc49
-rw-r--r--sql/sql_cte.cc2
-rw-r--r--sql/sql_derived.cc52
-rw-r--r--sql/sql_explain.cc8
-rw-r--r--sql/sql_explain.h1
-rw-r--r--sql/sql_lex.cc4
-rw-r--r--sql/sql_partition.cc21
-rw-r--r--sql/sql_prepare.cc12
-rw-r--r--sql/sql_select.cc16
-rw-r--r--sql/sql_string.cc2
-rw-r--r--sql/sql_table.cc2
-rw-r--r--sql/sql_trigger.cc2
-rw-r--r--sql/sql_view.cc3
-rw-r--r--sql/sql_window.cc9
-rw-r--r--sql/sql_yacc.yy8
-rw-r--r--sql/table.cc20
-rw-r--r--sql/table.h6
-rw-r--r--sql/wsrep_mysqld.cc10
-rw-r--r--storage/innobase/include/trx0rec.h5
-rw-r--r--storage/innobase/include/trx0sys.ic2
-rw-r--r--storage/innobase/row/row0log.cc33
-rw-r--r--storage/innobase/row/row0purge.cc4
-rw-r--r--storage/innobase/row/row0row.cc6
-rw-r--r--storage/innobase/trx/trx0rec.cc91
-rw-r--r--storage/innobase/trx/trx0sys.cc2
-rw-r--r--storage/maria/ma_open.c2
-rw-r--r--storage/maria/ma_search.c14
-rw-r--r--storage/myisam/ha_myisam.cc47
-rw-r--r--storage/myisam/mi_search.c14
-rw-r--r--storage/rocksdb/CMakeLists.txt15
-rw-r--r--storage/rocksdb/build_rocksdb.cmake1
-rw-r--r--storage/rocksdb/ha_rocksdb.cc8
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/r/rocksdb.result1
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/t/disabled.def11
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/t/rocksdb.test2
-rw-r--r--storage/rocksdb/mysql-test/rocksdb_rpl/my.cnf1
-rw-r--r--storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_binlog_xid_count.result204
-rw-r--r--storage/rocksdb/mysql-test/rocksdb_rpl/r/singledelete_idempotent_table.result10
-rw-r--r--storage/rocksdb/mysql-test/rocksdb_rpl/t/disabled.def30
-rw-r--r--storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_binlog_xid_count-master.opt3
-rw-r--r--storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_binlog_xid_count.test20
-rw-r--r--storage/rocksdb/mysql-test/rocksdb_rpl/t/singledelete_idempotent_table.cnf10
-rw-r--r--storage/rocksdb/mysql-test/rocksdb_rpl/t/singledelete_idempotent_table.test2
-rw-r--r--storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_git_hash_basic.test6
-rw-r--r--storage/rocksdb/rdb_datadic.cc3
-rw-r--r--storage/rocksdb/rdb_source_revision.h.in1
-rw-r--r--strings/CMakeLists.txt2
-rw-r--r--strings/ctype-tis620.c8
-rw-r--r--strings/my_vsnprintf.c6
-rw-r--r--strings/str_alloc.c41
-rw-r--r--strings/xml.c9
-rw-r--r--support-files/CMakeLists.txt15
-rw-r--r--support-files/sysusers.conf.in1
-rw-r--r--support-files/tmpfiles.conf.in1
209 files changed, 6854 insertions, 1508 deletions
diff --git a/.gitignore b/.gitignore
index f2445b06196..718befa962d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -193,6 +193,7 @@ storage/myisam/sp_test
storage/rocksdb/ldb
storage/rocksdb/mysql_ldb
storage/rocksdb/sst_dump
+storage/rocksdb/rdb_source_revision.h
storage/tokudb/PerconaFT/buildheader/db.h
storage/tokudb/PerconaFT/buildheader/make_tdb
storage/tokudb/PerconaFT/buildheader/runcat.sh
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 00000000000..a005fc5a93f
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,17 @@
+version: 10.2-{build}
+before_build:
+- md %APPVEYOR_BUILD_FOLDER%\win_build
+- cd %APPVEYOR_BUILD_FOLDER%\win_build
+- cmake .. -G "Visual Studio 15 2017" -DBISON_EXECUTABLE=C:\cygwin\bin\bison
+- dir
+build:
+ project: win_build\MySQL.sln
+ parallel: true
+ verbosity: minimal
+configuration:
+ - Debug
+test:
+test_script:
+- cd %APPVEYOR_BUILD_FOLDER%\win_build\mysql-test
+- perl mysql-test-run.pl --force --max-test-fail=20 --parallel=6 --testcase-timeout=4 --skip-test-list=unstable-tests --suite=main,innodb,plugins,mariabackup
+image: Visual Studio 2017
diff --git a/client/client_priv.h b/client/client_priv.h
index ba1a1fddfae..1d584efeea7 100644
--- a/client/client_priv.h
+++ b/client/client_priv.h
@@ -98,6 +98,7 @@ enum options_client
OPT_REPORT_PROGRESS,
OPT_SKIP_ANNOTATE_ROWS_EVENTS,
OPT_SSL_CRL, OPT_SSL_CRLPATH,
+ OPT_PRINT_ROW_COUNT, OPT_PRINT_ROW_EVENT_POSITIONS,
OPT_MAX_CLIENT_OPTION /* should be always the last */
};
diff --git a/client/mysql.cc b/client/mysql.cc
index fa824d598e6..394d4dca3d0 100644
--- a/client/mysql.cc
+++ b/client/mysql.cc
@@ -1795,8 +1795,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
case OPT_MYSQL_PROTOCOL:
#ifndef EMBEDDED_LIBRARY
- opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
- opt->name);
+ if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
+ opt->name)) <= 0)
+ {
+ sf_leaking_memory= 1; /* no memory leak reports here */
+ exit(1);
+ }
#endif
break;
case OPT_SERVER_ARG:
diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc
index 7e824cadf40..bd80dd01a1e 100644
--- a/client/mysqladmin.cc
+++ b/client/mysqladmin.cc
@@ -299,8 +299,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
#endif
break;
case OPT_MYSQL_PROTOCOL:
- opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
- opt->name);
+ if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
+ opt->name)) <= 0)
+ {
+ sf_leaking_memory= 1; /* no memory leak reports here */
+ exit(1);
+ }
break;
}
return 0;
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index d7ffadb1dc6..f025a618a70 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -89,7 +89,8 @@ static char *result_file_name= 0;
static const char *output_prefix= "";
#ifndef DBUG_OFF
-static const char* default_dbug_option = "d:t:o,/tmp/mysqlbinlog.trace";
+static const char *default_dbug_option = "d:t:o,/tmp/mysqlbinlog.trace";
+const char *current_dbug_option= default_dbug_option;
#endif
static const char *load_groups[]=
{ "mysqlbinlog", "client", "client-server", "client-mariadb", 0 };
@@ -109,6 +110,8 @@ static char *opt_base64_output_mode_str= NullS;
static char* database= 0;
static char* table= 0;
static my_bool force_opt= 0, short_form= 0, remote_opt= 0;
+static my_bool print_row_count= 0, print_row_event_positions= 0;
+static my_bool print_row_count_used= 0, print_row_event_positions_used= 0;
static my_bool debug_info_flag, debug_check_flag;
static my_bool force_if_open_opt= 1;
static my_bool opt_raw_mode= 0, opt_stop_never= 0;
@@ -224,14 +227,16 @@ void keep_annotate_event(Annotate_rows_log_event* event)
annotate_event= event;
}
-void print_annotate_event(PRINT_EVENT_INFO *print_event_info)
+bool print_annotate_event(PRINT_EVENT_INFO *print_event_info)
{
+ bool error= 0;
if (annotate_event)
{
- annotate_event->print(result_file, print_event_info);
+ error= annotate_event->print(result_file, print_event_info);
delete annotate_event; // the event should not be printed more than once
annotate_event= 0;
}
+ return error;
}
static Exit_status dump_local_log_entries(PRINT_EVENT_INFO *, const char*);
@@ -795,7 +800,7 @@ print_use_stmt(PRINT_EVENT_INFO* pinfo, const Query_log_event *ev)
static void
print_skip_replication_statement(PRINT_EVENT_INFO *pinfo, const Log_event *ev)
{
- int cur_val;
+ bool cur_val;
cur_val= (ev->flags & LOG_EVENT_SKIP_REPLICATION_F) != 0;
if (cur_val == pinfo->skip_replication)
@@ -847,8 +852,9 @@ write_event_header_and_base64(Log_event *ev, FILE *result_file,
DBUG_ENTER("write_event_header_and_base64");
/* Write header and base64 output to cache */
- ev->print_header(head, print_event_info, FALSE);
- ev->print_base64(body, print_event_info, FALSE);
+ if (ev->print_header(head, print_event_info, FALSE) ||
+ ev->print_base64(body, print_event_info, FALSE))
+ DBUG_RETURN(ERROR_STOP);
/* Read data from cache and write to result file */
if (copy_event_cache_to_file_and_reinit(head, result_file) ||
@@ -870,24 +876,20 @@ static bool print_base64(PRINT_EVENT_INFO *print_event_info, Log_event *ev)
passed --short-form, because --short-form disables printing
row events.
*/
+
if (!print_event_info->printed_fd_event && !short_form &&
- opt_base64_output_mode != BASE64_OUTPUT_DECODE_ROWS)
+ opt_base64_output_mode != BASE64_OUTPUT_DECODE_ROWS &&
+ opt_base64_output_mode != BASE64_OUTPUT_NEVER)
{
const char* type_str= ev->get_type_str();
- if (opt_base64_output_mode == BASE64_OUTPUT_NEVER)
- error("--base64-output=never specified, but binlog contains a "
- "%s event which must be printed in base64.",
- type_str);
- else
- error("malformed binlog: it does not contain any "
- "Format_description_log_event. I now found a %s event, which "
+ error("malformed binlog: it does not contain any "
+ "Format_description_log_event. Found a %s event, which "
"is not safe to process without a "
"Format_description_log_event.",
type_str);
return 1;
}
- ev->print(result_file, print_event_info);
- return print_event_info->head_cache.error == -1;
+ return ev->print(result_file, print_event_info);
}
@@ -897,6 +899,8 @@ static bool print_row_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
Table_map_log_event *ignored_map=
print_event_info->m_table_map_ignored.get_table(table_id);
bool skip_event= (ignored_map != NULL);
+ char ll_buff[21];
+ bool result= 0;
if (opt_flashback)
{
@@ -969,19 +973,18 @@ static bool print_row_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
return 0;
if (!opt_flashback)
- return print_base64(print_event_info, ev);
+ result= print_base64(print_event_info, ev);
else
{
if (is_stmt_end)
{
- bool res= false;
Log_event *e= NULL;
// Print the row_event from the last one to the first one
for (uint i= events_in_stmt.elements; i > 0; --i)
{
e= *(dynamic_element(&events_in_stmt, i - 1, Log_event**));
- res= res || print_base64(print_event_info, e);
+ result= result || print_base64(print_event_info, e);
}
// Copy all output into the Log_event
ev->output_buf.copy(e->output_buf);
@@ -992,12 +995,17 @@ static bool print_row_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
delete e;
}
reset_dynamic(&events_in_stmt);
-
- return res;
}
}
- return 0;
+ if (is_stmt_end && !result)
+ {
+ if (print_event_info->print_row_count)
+ fprintf(result_file, "# Number of rows: %s\n",
+ llstr(print_event_info->row_events, ll_buff));
+ print_event_info->row_events= 0;
+ }
+ return result;
}
@@ -1028,7 +1036,6 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
Log_event_type ev_type= ev->get_type_code();
my_bool destroy_evt= TRUE;
DBUG_ENTER("process_event");
- print_event_info->short_form= short_form;
Exit_status retval= OK_CONTINUE;
IO_CACHE *const head= &print_event_info->head_cache;
@@ -1074,7 +1081,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
retval= OK_STOP;
goto end;
}
- if (!short_form && !opt_flashback)
+ if (print_row_event_positions)
fprintf(result_file, "# at %s\n",llstr(pos,ll_buff));
if (!opt_hexdump)
@@ -1115,7 +1122,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
else
{
print_skip_replication_statement(print_event_info, ev);
- ev->print(result_file, print_event_info);
+ if (ev->print(result_file, print_event_info))
+ goto err;
}
if (head->error == -1)
goto err;
@@ -1150,8 +1158,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
else
{
print_skip_replication_statement(print_event_info, ev);
- ce->print(result_file, print_event_info, TRUE);
- if (head->error == -1)
+ if (ce->print(result_file, print_event_info, TRUE))
goto err;
}
// If this binlog is not 3.23 ; why this test??
@@ -1174,8 +1181,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
the subsequent call load_processor.process fails, because the
output of Append_block_log_event::print is only a comment.
*/
- ev->print(result_file, print_event_info);
- if (head->error == -1)
+ if (ev->print(result_file, print_event_info))
goto err;
if ((retval= load_processor.process((Append_block_log_event*) ev)) !=
OK_CONTINUE)
@@ -1184,8 +1190,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
case EXEC_LOAD_EVENT:
{
- ev->print(result_file, print_event_info);
- if (head->error == -1)
+ if (ev->print(result_file, print_event_info))
goto err;
Execute_load_log_event *exv= (Execute_load_log_event*)ev;
Create_file_log_event *ce= load_processor.grab_event(exv->file_id);
@@ -1196,15 +1201,16 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
*/
if (ce)
{
+ bool error;
/*
We must not convert earlier, since the file is used by
my_open() in Load_log_processor::append().
*/
convert_path_to_forward_slashes((char*) ce->fname);
- ce->print(result_file, print_event_info, TRUE);
+ error= ce->print(result_file, print_event_info, TRUE);
my_free((void*)ce->fname);
delete ce;
- if (head->error == -1)
+ if (error)
goto err;
}
else
@@ -1215,10 +1221,10 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
case FORMAT_DESCRIPTION_EVENT:
delete glob_description_event;
glob_description_event= (Format_description_log_event*) ev;
+ destroy_evt= 0;
print_event_info->common_header_len=
glob_description_event->common_header_len;
- ev->print(result_file, print_event_info);
- if (head->error == -1)
+ if (ev->print(result_file, print_event_info))
goto err;
if (!remote_opt)
{
@@ -1248,8 +1254,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
}
break;
case BEGIN_LOAD_QUERY_EVENT:
- ev->print(result_file, print_event_info);
- if (head->error == -1)
+ if (ev->print(result_file, print_event_info))
goto err;
if ((retval= load_processor.process((Begin_load_query_log_event*) ev)) !=
OK_CONTINUE)
@@ -1267,11 +1272,9 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
{
convert_path_to_forward_slashes(fname);
print_skip_replication_statement(print_event_info, ev);
- exlq->print(result_file, print_event_info, fname);
- if (head->error == -1)
+ if (exlq->print(result_file, print_event_info, fname))
{
- if (fname)
- my_free(fname);
+ my_free(fname);
goto err;
}
}
@@ -1279,9 +1282,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
warning("Ignoring Execute_load_query since there is no "
"Begin_load_query event for file_id: %u", exlq->file_id);
}
-
- if (fname)
- my_free(fname);
+ my_free(fname);
break;
}
case ANNOTATE_ROWS_EVENT:
@@ -1427,7 +1428,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
print the kept Annotate event (if there is any).
print_annotate_event() also deletes the kept Annotate event.
*/
- print_annotate_event(print_event_info);
+ if (print_annotate_event(print_event_info))
+ goto err;
size_t len_to= 0;
const char* db_to= binlog_filter->get_rewrite_db(map->get_db_name(), &len_to);
@@ -1457,10 +1459,18 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
{
Rows_log_event *e= (Rows_log_event*) ev;
bool is_stmt_end= e->get_flags(Rows_log_event::STMT_END_F);
+ if (!print_event_info->found_row_event)
+ {
+ print_event_info->found_row_event= 1;
+ print_event_info->row_events= 0;
+ }
if (print_row_event(print_event_info, ev, e->get_table_id(),
e->get_flags(Rows_log_event::STMT_END_F)))
goto err;
- if (!is_stmt_end)
+ DBUG_PRINT("info", ("is_stmt_end: %d", (int) is_stmt_end));
+ if (is_stmt_end)
+ print_event_info->found_row_event= 0;
+ else if (opt_flashback)
destroy_evt= FALSE;
break;
}
@@ -1473,7 +1483,8 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
if (print_row_event(print_event_info, ev, e->get_table_id(),
e->get_flags(Old_rows_log_event::STMT_END_F)))
goto err;
- if (!is_stmt_end)
+ DBUG_PRINT("info", ("is_stmt_end: %d", (int) is_stmt_end));
+ if (!is_stmt_end && opt_flashback)
destroy_evt= FALSE;
break;
}
@@ -1482,8 +1493,7 @@ Exit_status process_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
/* fall through */
default:
print_skip_replication_statement(print_event_info, ev);
- ev->print(result_file, print_event_info);
- if (head->error == -1)
+ if (ev->print(result_file, print_event_info))
goto err;
}
}
@@ -1494,7 +1504,8 @@ err:
retval= ERROR_STOP;
end:
rec_count++;
-
+
+ DBUG_PRINT("info", ("end event processing"));
/*
Destroy the log_event object.
MariaDB MWL#36: mainline does this:
@@ -1539,6 +1550,7 @@ end:
if (destroy_evt) /* destroy it later if not set (ignored table map) */
delete ev;
}
+ DBUG_PRINT("exit",("return: %d", retval));
DBUG_RETURN(retval);
}
@@ -1550,14 +1562,15 @@ static struct my_option my_options[] =
{"base64-output", OPT_BASE64_OUTPUT_MODE,
/* 'unspec' is not mentioned because it is just a placeholder. */
"Determine when the output statements should be base64-encoded BINLOG "
- "statements: 'never' disables it and works only for binlogs without "
- "row-based events; 'decode-rows' decodes row events into commented SQL "
- "statements if the --verbose option is also given; 'auto' prints base64 "
- "only when necessary (i.e., for row-based events and format description "
- "events); 'always' prints base64 whenever possible. 'always' is "
- "deprecated, will be removed in a future version, and should not be used "
- "in a production system. --base64-output with no 'name' argument is "
- "equivalent to --base64-output=always and is also deprecated. If no "
+ "statements: 'never' doesn't print binlog row events and should not be "
+ "used when directing output to a MariaDB master; "
+ "'decode-rows' decodes row events into commented SQL statements if the "
+ "--verbose option is also given; "
+ "'auto' prints base64 only when necessary (i.e., for row-based events and "
+ "format description events); "
+ "'always' prints base64 whenever possible. "
+ "--base64-output with no 'name' argument is equivalent to "
+ "--base64-output=always and is also deprecated. If no "
"--base64-output[=name] option is given at all, the default is 'auto'.",
&opt_base64_output_mode_str, &opt_base64_output_mode_str,
0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
@@ -1574,8 +1587,8 @@ static struct my_option my_options[] =
&database, &database, 0, GET_STR_ALLOC, REQUIRED_ARG,
0, 0, 0, 0, 0, 0},
#ifndef DBUG_OFF
- {"debug", '#', "Output debug log.", &default_dbug_option,
- &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
+ {"debug", '#', "Output debug log.", &current_dbug_option,
+ &current_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif
{"debug-check", OPT_DEBUG_CHECK, "Check memory and open file usage at exit .",
&debug_check_flag, &debug_check_flag, 0,
@@ -1657,6 +1670,14 @@ static struct my_option my_options[] =
&flashback_review_tablename, &flashback_review_tablename,
0, GET_STR_ALLOC, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
+ {"print-row-count", OPT_PRINT_ROW_COUNT,
+ "Print row counts for each row events",
+ &print_row_count, &print_row_count, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0,
+ 0, 0},
+ {"print-row-event-positions", OPT_PRINT_ROW_EVENT_POSITIONS,
+ "Print row event positions",
+ &print_row_event_positions, &print_row_event_positions, 0, GET_BOOL,
+ NO_ARG, 1, 0, 0, 0, 0, 0},
{"server-id", 0,
"Extract only binlog entries created by the server having the given id.",
&server_id, &server_id, 0, GET_ULONG,
@@ -1670,10 +1691,11 @@ static struct my_option my_options[] =
&shared_memory_base_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
#endif
- {"short-form", 's', "Just show regular queries: no extra info and no "
- "row-based events. This is for testing only, and should not be used in "
- "production systems. If you want to suppress base64-output, consider "
- "using --base64-output=never instead.",
+ {"short-form", 's', "Just show regular queries: no extra info, no "
+ "row-based events and no row counts. This is mainly for testing only, "
+ "and should not be used to feed to the MariaDB server. "
+ "If you want to just suppress base64-output, you can instead "
+ "use --base64-output=never",
&short_form, &short_form, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
{"socket", 'S', "The socket file to use for connection.",
@@ -1775,9 +1797,12 @@ Example: rewrite-db='from->to'.",
*/
static void error_or_warning(const char *format, va_list args, const char *msg)
{
+ if (result_file)
+ fflush(result_file);
fprintf(stderr, "%s: ", msg);
vfprintf(stderr, format, args);
fprintf(stderr, "\n");
+ fflush(stderr);
}
/**
@@ -1830,6 +1855,7 @@ static void warning(const char *format,...)
*/
static void cleanup()
{
+ DBUG_ENTER("cleanup");
my_free(pass);
my_free(database);
my_free(table);
@@ -1843,12 +1869,13 @@ static void cleanup()
delete glob_description_event;
if (mysql)
mysql_close(mysql);
+ DBUG_VOID_RETURN;
}
static void print_version()
{
- printf("%s Ver 3.3 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE);
+ printf("%s Ver 3.4 for %s at %s\n", my_progname, SYSTEM_TYPE, MACHINE_TYPE);
}
@@ -1899,7 +1926,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
switch (optid) {
#ifndef DBUG_OFF
case '#':
- DBUG_PUSH(argument ? argument : default_dbug_option);
+ if (!argument)
+ argument= (char*) default_dbug_option;
+ current_dbug_option= argument;
+ DBUG_PUSH(argument);
break;
#endif
#include <sslopt-case.h>
@@ -1931,8 +1961,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
one_table= 1;
break;
case OPT_MYSQL_PROTOCOL:
- opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
- opt->name);
+ if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
+ opt->name)) <= 0)
+ {
+ sf_leaking_memory= 1; /* no memory leak reports here */
+ exit(1);
+ }
break;
#ifdef WHEN_FLASHBACK_REVIEW_READY
case opt_flashback_review:
@@ -1950,8 +1984,15 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
opt_base64_output_mode= BASE64_OUTPUT_ALWAYS;
else
{
- opt_base64_output_mode= (enum_base64_output_mode)
- (find_type_or_exit(argument, &base64_output_mode_typelib, opt->name)-1);
+ int val;
+
+ if ((val= find_type_with_warning(argument, &base64_output_mode_typelib,
+ opt->name)) <= 0)
+ {
+ sf_leaking_memory= 1; /* no memory leak reports here */
+ exit(1);
+ }
+ opt_base64_output_mode= (enum_base64_output_mode) (val - 1);
}
break;
case OPT_REWRITE_DB: // db_from->db_to
@@ -2001,6 +2042,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
binlog_filter->add_db_rewrite(key, val);
break;
}
+ case OPT_PRINT_ROW_COUNT:
+ print_row_count_used= 1;
+ break;
+ case OPT_PRINT_ROW_EVENT_POSITIONS:
+ print_row_event_positions_used= 1;
+ break;
case 'v':
if (argument == disabled_my_option)
verbose= 0;
@@ -2133,11 +2180,30 @@ static Exit_status dump_log_entries(const char* logname)
fprintf(result_file, "DELIMITER /*!*/;\n");
strmov(print_event_info.delimiter, "/*!*/;");
- print_event_info.verbose= short_form ? 0 : verbose;
+ if (short_form)
+ {
+ if (!print_row_event_positions_used)
+ print_row_event_positions= 0;
+ if (!print_row_count_used)
+ print_row_count = 0;
+ }
+ if (opt_flashback)
+ {
+ if (!print_row_event_positions_used)
+ print_row_event_positions= 0;
+ }
+ print_event_info.verbose= short_form ? 0 : verbose;
+ print_event_info.short_form= short_form;
+ print_event_info.print_row_count= print_row_count;
+ print_event_info.file= result_file;
+ fflush(result_file);
rc= (remote_opt ? dump_remote_log_entries(&print_event_info, logname) :
dump_local_log_entries(&print_event_info, logname));
+ if (rc == ERROR_STOP)
+ return rc;
+
/* Set delimiter back to semicolon */
if (!opt_raw_mode && !opt_flashback)
fprintf(result_file, "DELIMITER ;\n");
@@ -2208,6 +2274,8 @@ static Exit_status check_master_version()
}
delete glob_description_event;
+ glob_description_event= NULL;
+
switch (version) {
case 3:
glob_description_event= new Format_description_log_event(1);
@@ -2226,7 +2294,6 @@ static Exit_status check_master_version()
glob_description_event= new Format_description_log_event(3);
break;
default:
- glob_description_event= NULL;
error("Could not find server version: "
"Master reported unrecognized MySQL version '%s'.", row[0]);
goto err;
@@ -2467,6 +2534,7 @@ static Exit_status handle_event_raw_mode(PRINT_EVENT_INFO *print_event_info,
error("Could not write into log file '%s'", out_file_name);
DBUG_RETURN(ERROR_STOP);
}
+ print_event_info->file= result_file;
delete glob_description_event;
glob_description_event= (Format_description_log_event*) ev;
@@ -2965,13 +3033,6 @@ int main(int argc, char** argv)
if (opt_base64_output_mode == BASE64_OUTPUT_UNSPEC)
opt_base64_output_mode= BASE64_OUTPUT_AUTO;
- if (opt_base64_output_mode == BASE64_OUTPUT_ALWAYS)
- warning("The --base64-output=always flag and the --base64-output flag "
- "(with '=MODE' omitted), are deprecated. "
- "The output generated when these flags are used cannot be "
- "parsed by mysql 5.6.0 and later. "
- "The flags will be removed in a future version. "
- "Please use --base64-output=auto instead.");
my_set_max_open_files(open_files_limit);
@@ -3084,7 +3145,7 @@ int main(int argc, char** argv)
If enable flashback, need to print the events from the end to the
beginning
*/
- if (opt_flashback)
+ if (opt_flashback && retval != ERROR_STOP)
{
for (uint i= binlog_events.elements; i > 0; --i)
{
@@ -3099,12 +3160,15 @@ int main(int argc, char** argv)
}
/* Set delimiter back to semicolon */
- if (!stop_event_string.is_empty())
- fprintf(result_file, "%s", stop_event_string.ptr());
- if (!opt_raw_mode && opt_flashback)
- fprintf(result_file, "DELIMITER ;\n");
+ if (retval != ERROR_STOP)
+ {
+ if (!stop_event_string.is_empty())
+ fprintf(result_file, "%s", stop_event_string.ptr());
+ if (!opt_raw_mode && opt_flashback)
+ fprintf(result_file, "DELIMITER ;\n");
+ }
- if (!opt_raw_mode)
+ if (retval != ERROR_STOP && !opt_raw_mode)
{
/*
Issue a ROLLBACK in case the last printed binlog was crashed and had half
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index d5938776452..61210d4022e 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -367,8 +367,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
print_version(); exit(0);
break;
case OPT_MYSQL_PROTOCOL:
- opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
- opt->name);
+ if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
+ opt->name)) <= 0)
+ {
+ sf_leaking_memory= 1; /* no memory leak reports here */
+ exit(1);
+ }
break;
}
diff --git a/client/mysqldump.c b/client/mysqldump.c
index 72e86db6e43..6d734cf9472 100644
--- a/client/mysqldump.c
+++ b/client/mysqldump.c
@@ -961,8 +961,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
}
case (int) OPT_MYSQL_PROTOCOL:
- opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
- opt->name);
+ if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
+ opt->name)) <= 0)
+ {
+ sf_leaking_memory= 1; /* no memory leak reports here */
+ exit(1);
+ }
break;
}
return 0;
diff --git a/client/mysqlimport.c b/client/mysqlimport.c
index 38b2eb5f672..6da14aa1520 100644
--- a/client/mysqlimport.c
+++ b/client/mysqlimport.c
@@ -249,8 +249,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break;
#endif
case OPT_MYSQL_PROTOCOL:
- opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
- opt->name);
+ if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
+ opt->name)) <= 0)
+ {
+ sf_leaking_memory= 1; /* no memory leak reports here */
+ exit(1);
+ }
break;
case '#':
DBUG_PUSH(argument ? argument : "d:t:o");
diff --git a/client/mysqlshow.c b/client/mysqlshow.c
index 46494311f7d..0a761edff4c 100644
--- a/client/mysqlshow.c
+++ b/client/mysqlshow.c
@@ -330,8 +330,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
#endif
break;
case OPT_MYSQL_PROTOCOL:
- opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
- opt->name);
+ if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
+ opt->name)) <= 0)
+ {
+ sf_leaking_memory= 1; /* no memory leak reports here */
+ exit(1);
+ }
break;
case '#':
DBUG_PUSH(argument ? argument : "d:t:o");
diff --git a/client/mysqlslap.c b/client/mysqlslap.c
index 60e0939491c..f0ad2f40abc 100644
--- a/client/mysqlslap.c
+++ b/client/mysqlslap.c
@@ -779,8 +779,12 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
#endif
break;
case OPT_MYSQL_PROTOCOL:
- opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
- opt->name);
+ if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
+ opt->name)) <= 0)
+ {
+ sf_leaking_memory= 1; /* no memory leak reports here */
+ exit(1);
+ }
break;
case '#':
DBUG_PUSH(argument ? argument : default_dbug_option);
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 914c0ac8621..5dadbecc3d1 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -701,6 +701,8 @@ public:
void write(DYNAMIC_STRING* ds)
{
DBUG_ENTER("LogFile::write");
+ DBUG_PRINT("enter", ("length: %u", (uint) ds->length));
+
DBUG_ASSERT(m_file);
if (ds->length == 0)
@@ -6959,6 +6961,7 @@ int read_command(struct st_command** command_ptr)
if (parser.current_line < parser.read_lines)
{
get_dynamic(&q_lines, command_ptr, parser.current_line) ;
+ DBUG_PRINT("info", ("query: %s", (*command_ptr)->query));
DBUG_RETURN(0);
}
if (!(*command_ptr= command=
@@ -7320,8 +7323,12 @@ get_one_option(int optid, const struct my_option *opt, char *argument)
exit(0);
case OPT_MYSQL_PROTOCOL:
#ifndef EMBEDDED_LIBRARY
- opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
- opt->name);
+ if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
+ opt->name)) <= 0)
+ {
+ sf_leaking_memory= 1; /* no memory leak reports here */
+ exit(1);
+ }
#endif
break;
case '?':
diff --git a/cmake/install_layout.cmake b/cmake/install_layout.cmake
index d1a261f8cef..5484691e94a 100644
--- a/cmake/install_layout.cmake
+++ b/cmake/install_layout.cmake
@@ -162,6 +162,8 @@ SET(INSTALL_MYSQLDATADIR_RPM "/var/lib/mysql")
SET(INSTALL_UNIX_ADDRDIR_RPM "${INSTALL_MYSQLDATADIR_RPM}/mysql.sock")
SET(INSTALL_SYSTEMD_UNITDIR_RPM "/usr/lib/systemd/system")
+SET(INSTALL_SYSTEMD_SYSUSERSDIR_RPM "/usr/lib/sysusers.d")
+SET(INSTALL_SYSTEMD_TMPFILESDIR_RPM "/usr/lib/tmpfiles.d")
#
# DEB layout
@@ -191,6 +193,8 @@ SET(INSTALL_MYSQLDATADIR_DEB "/var/lib/mysql")
SET(INSTALL_UNIX_ADDRDIR_DEB "/var/run/mysqld/mysqld.sock")
SET(INSTALL_SYSTEMD_UNITDIR_DEB "/lib/systemd/system")
+SET(INSTALL_SYSTEMD_SYSUSERSDIR_DEB "/usr/lib/sysusers.d")
+SET(INSTALL_SYSTEMD_TMPFILESDIR_DEB "/usr/lib/tmpfiles.d")
#
# SVR4 layout
@@ -232,7 +236,7 @@ SET(OLD_INSTALL_LAYOUT ${INSTALL_LAYOUT} CACHE INTERNAL "")
# layout is chosen)
FOREACH(var BIN SBIN LIB MYSQLSHARE SHARE PLUGIN INCLUDE SCRIPT DOC MAN SYSCONF SYSCONF2
INFO MYSQLTEST SQLBENCH DOCREADME SUPPORTFILES MYSQLDATA UNIX_ADDR
- SYSTEMD_UNIT)
+ SYSTEMD_UNIT SYSTEMD_SYSUSERS SYSTEMD_TMPFILES)
SET(INSTALL_${var}DIR ${INSTALL_${var}DIR_${INSTALL_LAYOUT}}
CACHE STRING "${var} installation directory" ${FORCE})
MARK_AS_ADVANCED(INSTALL_${var}DIR)
diff --git a/cmake/make_dist.cmake.in b/cmake/make_dist.cmake.in
index 6bd71cc7653..885cfa2a706 100644
--- a/cmake/make_dist.cmake.in
+++ b/cmake/make_dist.cmake.in
@@ -55,6 +55,9 @@ ENDIF()
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/include/source_revision.h
${PACKAGE_DIR}/include/source_revision.h COPYONLY)
+CONFIGURE_FILE(${CMAKE_BINARY_DIR}/storage/rocksdb/rdb_source_revision.h
+ ${PACKAGE_DIR}/storage/rocksdb/rdb_source_revision.h COPYONLY)
+
IF(NOT GIT_EXECUTABLE)
MESSAGE(STATUS "git not found or source dir is not a repo, use CPack")
diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index 1c4394d11d2..31291d263f9 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -230,7 +230,7 @@ MACRO(MYSQL_ADD_PLUGIN)
SET(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} PARENT_SCOPE)
IF (NOT ARG_CLIENT)
- SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB${ver}" PARENT_SCOPE)
+ SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_REQUIRES "MariaDB-server${ver}" PARENT_SCOPE)
ENDIF()
# workarounds for cmake issues #13248 and #12864:
SET(CPACK_RPM_${ARG_COMPONENT}_PACKAGE_PROVIDES "cmake_bug_13248" PARENT_SCOPE)
diff --git a/debian/autobake-deb.sh b/debian/autobake-deb.sh
index b8cf3ee8951..cc5b04188f4 100755
--- a/debian/autobake-deb.sh
+++ b/debian/autobake-deb.sh
@@ -80,11 +80,11 @@ GCCVERSION=$(gcc -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]
# x86 32 bit.
if [[ $GCCVERSION -lt 40800 ]] || [[ $(arch) =~ i[346]86 ]] || [[ $TRAVIS ]]
then
- sed '/Package: mariadb-plugin-rocksdb/,+11d' -i debian/control
+ sed '/Package: mariadb-plugin-rocksdb/,+13d' -i debian/control
fi
if [[ $GCCVERSION -lt 40800 ]] || [[ $TRAVIS ]]
then
- sed '/Package: mariadb-plugin-aws-key-management-10.2/,+13d' -i debian/control
+ sed '/Package: mariadb-plugin-aws-key-management-10.3/,+15d' -i debian/control
fi
diff --git a/debian/control b/debian/control
index 5f41323bb63..fe9a10a2cb8 100644
--- a/debian/control
+++ b/debian/control
@@ -452,7 +452,7 @@ Description: MariaDB database client (metapackage depending on the latest versio
Package: mariadb-plugin-connect
Architecture: any
Depends: libxml2,
- mariadb-server-10.3,
+ mariadb-server-10.3 (= ${binary:Version}),
unixodbc,
${misc:Depends},
${shlibs:Depends}
@@ -470,7 +470,9 @@ Description: Connect storage engine for MariaDB
Package: mariadb-plugin-rocksdb
Architecture: any
-Depends: mariadb-server-10.3, ${misc:Depends}, ${shlibs:Depends}
+Depends: mariadb-server-10.3 (= ${binary:Version}),
+ ${misc:Depends},
+ ${shlibs:Depends}
Breaks: mariadb-rocksdb-engine-10.2,
mariadb-rocksdb-engine-10.3
Replaces: mariadb-rocksdb-engine-10.2,
@@ -482,7 +484,10 @@ Description: RocksDB storage engine for MariaDB
Package: mariadb-plugin-oqgraph
Architecture: any
-Depends: libjudydebian1, mariadb-server-10.3, ${misc:Depends}, ${shlibs:Depends}
+Depends: libjudydebian1,
+ mariadb-server-10.3 (= ${binary:Version}),
+ ${misc:Depends},
+ ${shlibs:Depends}
Breaks: mariadb-oqgraph-engine-10.1,
mariadb-oqgraph-engine-10.2,
mariadb-oqgraph-engine-10.3
@@ -496,7 +501,9 @@ Description: OQGraph storage engine for MariaDB
Package: mariadb-plugin-tokudb
Architecture: any
-Depends: mariadb-server-10.3, ${misc:Depends}, ${shlibs:Depends}
+Depends: mariadb-server-10.3 (= ${binary:Version}),
+ ${misc:Depends},
+ ${shlibs:Depends}
Breaks: mariadb-server-10.0,
mariadb-server-10.1,
mariadb-server-10.2,
@@ -513,7 +520,9 @@ Description: TokuDB storage engine for MariaDB
Package: mariadb-plugin-mroonga
Architecture: any
-Depends: mariadb-server-10.3, ${misc:Depends}, ${shlibs:Depends}
+Depends: mariadb-server-10.3 (= ${binary:Version}),
+ ${misc:Depends},
+ ${shlibs:Depends}
Breaks: mariadb-server-10.0,
mariadb-server-10.1,
mariadb-server-10.2,
@@ -529,7 +538,9 @@ Description: Mroonga storage engine for MariaDB
Package: mariadb-plugin-spider
Architecture: any
-Depends: mariadb-server-10.3, ${misc:Depends}, ${shlibs:Depends}
+Depends: mariadb-server-10.3 (= ${binary:Version}),
+ ${misc:Depends},
+ ${shlibs:Depends}
Breaks: mariadb-server-10.0,
mariadb-server-10.1,
mariadb-server-10.2,
@@ -546,7 +557,9 @@ Description: Spider storage engine for MariaDB
Package: mariadb-plugin-cassandra
Architecture: any
-Depends: mariadb-server-10.3, ${misc:Depends}, ${shlibs:Depends}
+Depends: mariadb-server-10.3 (= ${binary:Version}),
+ ${misc:Depends},
+ ${shlibs:Depends}
Breaks: mariadb-server-10.0,
mariadb-server-10.1,
mariadb-server-10.2,
diff --git a/debian/rules b/debian/rules
index 212e2764521..76433d47576 100755
--- a/debian/rules
+++ b/debian/rules
@@ -45,11 +45,6 @@ else
TESTSUITE_FAIL_CMD:=exit 1
endif
-# Skip TokuDB if arch is not amd64
-ifneq ($(ARCH), amd64)
- CMAKEFLAGS += -DWITHOUT_TOKUDB=true
-endif
-
# Add support for verbose builds
MAKEFLAGS += VERBOSE=1
@@ -119,19 +114,15 @@ override_dh_auto_install:
dh_testdir
dh_testroot
- # If TokuDB plugin was not built skip the package
- [ -f $(BUILDDIR)/storage/tokudb/ha_tokudb.so ] || sed -i -e "/Package: mariadb-plugin-tokudb/,+16d" debian/control
-
- # If Mroonga plugin was not built skip the package
- [ -f $(BUILDDIR)/storage/mroonga/ha_mroonga.so ] || sed -i -e "/Package: mariadb-plugin-mroonga/,+15d" debian/control
+# Skip TokuDB if arch is not amd64
+ifneq ($(ARCH), amd64)
+ sed -i -e "/Package: mariadb-plugin-tokudb/,+18d" debian/control
+endif
# If libthrift-dev was available (manually installed, as it is
# not in Debian) and ha_cassandra.so was thus built, create package,
# otherwise skip it.
- [ -f $(BUILDDIR)/storage/cassandra/ha_cassandra.so ] || sed -i -e "/Package: mariadb-plugin-cassandra/,+18d" debian/control
-
- # If Spider plugin was not built skip the package
- [ -f $(BUILDDIR)/storage/spider/ha_spider.so ] || sed -i -e "/Package: mariadb-plugin-spider/,+16d" debian/control
+ [ -f $(BUILDDIR)/storage/cassandra/ha_cassandra.so ] || sed -i -e "/Package: mariadb-plugin-cassandra/,+20d" debian/control
# Copy systemd files to a location available for dh_installinit
cp $(BUILDDIR)/support-files/mariadb.service debian/mariadb-server-10.3.mariadb.service
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index a84e1ec8412..20919cf3a81 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -1422,8 +1422,12 @@ xb_get_one_option(int optid,
case OPT_PROTOCOL:
if (argument)
{
- opt_protocol= find_type_or_exit(argument, &sql_protocol_typelib,
- opt->name);
+ if ((opt_protocol= find_type_with_warning(argument, &sql_protocol_typelib,
+ opt->name)) <= 0)
+ {
+ sf_leaking_memory= 1; /* no memory leak reports here */
+ exit(1);
+ }
}
break;
#include "sslopt-case.h"
diff --git a/include/m_string.h b/include/m_string.h
index c50d37a361b..5cd0b0d2a92 100644
--- a/include/m_string.h
+++ b/include/m_string.h
@@ -64,15 +64,6 @@
extern "C" {
#endif
-/*
- my_str_malloc(), my_str_realloc() and my_str_free() are assigned to
- implementations in strings/alloc.c, but can be overridden in
- the calling program.
- */
-extern void *(*my_str_malloc)(size_t);
-extern void *(*my_str_realloc)(void *, size_t);
-extern void (*my_str_free)(void *);
-
#ifdef DBUG_OFF
#if defined(HAVE_STPCPY) && MY_GNUC_PREREQ(3, 4) && !defined(__INTEL_COMPILER)
#define strmov(A,B) __builtin_stpcpy((A),(B))
diff --git a/include/my_sys.h b/include/my_sys.h
index 58d87eae72c..fd14890b636 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -551,12 +551,13 @@ static inline int my_b_get(IO_CACHE *info)
return _my_b_get(info);
}
-/* my_b_write_byte dosn't have any err-check */
-static inline void my_b_write_byte(IO_CACHE *info, uchar chr)
+static inline my_bool my_b_write_byte(IO_CACHE *info, uchar chr)
{
if (info->write_pos >= info->write_end)
- my_b_flush_io_cache(info, 1);
+ if (my_b_flush_io_cache(info, 1))
+ return 1;
*info->write_pos++= chr;
+ return 0;
}
/**
@@ -824,9 +825,9 @@ extern int end_io_cache(IO_CACHE *info);
extern void my_b_seek(IO_CACHE *info,my_off_t pos);
extern size_t my_b_gets(IO_CACHE *info, char *to, size_t max_length);
extern my_off_t my_b_filelength(IO_CACHE *info);
-extern size_t my_b_write_backtick_quote(IO_CACHE *info, const char *str,
- size_t len);
-extern size_t my_b_printf(IO_CACHE *info, const char* fmt, ...);
+extern my_bool my_b_write_backtick_quote(IO_CACHE *info, const char *str,
+ size_t len);
+extern my_bool my_b_printf(IO_CACHE *info, const char* fmt, ...);
extern size_t my_b_vprintf(IO_CACHE *info, const char* fmt, va_list ap);
extern my_bool open_cached_file(IO_CACHE *cache,const char *dir,
const char *prefix, size_t cache_size,
diff --git a/include/mysql.h.pp b/include/mysql.h.pp
index b87316946a4..4ec9b0a1780 100644
--- a/include/mysql.h.pp
+++ b/include/mysql.h.pp
@@ -252,8 +252,6 @@ typedef struct st_typelib {
extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_position);
extern int find_type_with_warning(const char *x, TYPELIB *typelib,
const char *option);
-extern int find_type_or_exit(const char *x, TYPELIB *typelib,
- const char *option);
extern int find_type(const char *x, const TYPELIB *typelib, unsigned int flags);
extern void make_type(char *to,unsigned int nr,TYPELIB *typelib);
extern const char *get_type(TYPELIB *typelib,unsigned int nr);
diff --git a/include/typelib.h b/include/typelib.h
index eba32167c4e..0d633e57e5a 100644
--- a/include/typelib.h
+++ b/include/typelib.h
@@ -30,8 +30,6 @@ typedef struct st_typelib { /* Different types saved here */
extern my_ulonglong find_typeset(char *x, TYPELIB *typelib,int *error_position);
extern int find_type_with_warning(const char *x, TYPELIB *typelib,
const char *option);
-extern int find_type_or_exit(const char *x, TYPELIB *typelib,
- const char *option);
#define FIND_TYPE_BASIC 0
/** makes @c find_type() require the whole name, no prefix */
#define FIND_TYPE_NO_PREFIX (1U << 0)
diff --git a/libmariadb b/libmariadb
-Subproject 63f841f78f520d7f3bcff1fe8cecec9d8c47829
+Subproject fe129ed39f33ba2b430aac91473baee84de88b1
diff --git a/libmysqld/libmysqld.c b/libmysqld/libmysqld.c
index d1771a09578..e5b6f6b8397 100644
--- a/libmysqld/libmysqld.c
+++ b/libmysqld/libmysqld.c
@@ -121,6 +121,9 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
my_free(mysql->options.my_cnf_file);
my_free(mysql->options.my_cnf_group);
mysql->options.my_cnf_file=mysql->options.my_cnf_group=0;
+
+ if (mysql->options.protocol == UINT_MAX32)
+ goto error;
}
if (!db || !db[0])
diff --git a/man/mysqladmin.1 b/man/mysqladmin.1
index 82c31901e4b..321964e20d6 100644
--- a/man/mysqladmin.1
+++ b/man/mysqladmin.1
@@ -1,6 +1,6 @@
'\" t
.\"
-.TH "\FBMYSQLADMIN\FR" "1" "9 May 2017" "MariaDB 10\&.3" "MariaDB Database System"
+.TH "\FBMYSQLADMIN\FR" "1" "28 December 2017" "MariaDB 10\&.3" "MariaDB Database System"
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
@@ -106,6 +106,97 @@ Display the server status variables and their values\&.
.sp -1
.IP \(bu 2.3
.\}
+flush\-all\-statistics
+.sp
+Flush all statistics tables\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+flush\-all\-status
+.sp
+Flush all status and statistics\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+flush\-binary\-log
+.sp
+Flush the binary log\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+flush\-client\-statistics
+.sp
+Flush client statistics\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+flush\-engine\-log
+.sp
+Flush engine log\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+flush\-error\-log
+.sp
+Flush error log\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+flush\-general\-log
+.sp
+Flush general query log\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
flush\-hosts
.sp
Flush all information in the host cache\&.
@@ -119,6 +210,19 @@ Flush all information in the host cache\&.
.sp -1
.IP \(bu 2.3
.\}
+flush\-index\-statistics
+.sp
+Flush index statistics\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
flush\-logs
.sp
Flush all logs\&.
@@ -146,6 +250,32 @@ reload)\&.
.sp -1
.IP \(bu 2.3
.\}
+flush\-relay\-log
+.sp
+Flush relay log\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+flush\-slow\-log
+.sp
+Flush slow query log\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
flush\-status
.sp
Clear status variables\&.
@@ -159,6 +289,19 @@ Clear status variables\&.
.sp -1
.IP \(bu 2.3
.\}
+flush\-table\-statistics
+.sp
+Flush table statistics\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
flush\-tables
.sp
Flush all tables\&.
@@ -185,6 +328,19 @@ Flush the thread cache\&.
.sp -1
.IP \(bu 2.3
.\}
+flush\-user\-resources
+.sp
+Flush user resources\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
kill \fIid\fR,\fIid\fR,\&.\&.\&.
.sp
Kill server threads\&. If multiple thread ID values are given, there must be no spaces in the list\&.
@@ -344,6 +500,19 @@ Stop the server\&.
.sp -1
.IP \(bu 2.3
.\}
+start\-all\-slaves
+.sp
+Start all slaves\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
start\-slave
.sp
Start replication on a slave server\&.
@@ -370,6 +539,19 @@ Display a short server status message\&.
.sp -1
.IP \(bu 2.3
.\}
+stop\-all\-slaves
+.sp
+Stop all slaves\&.
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
stop\-slave
.sp
Stop replication on a slave server\&.
@@ -821,7 +1003,7 @@ Connect to the MariaDB server on the given host\&.
\fB\-\-local\fR,
\fB\-l\fR
.sp
-Suppress the SQL command(s) from being written to the binary log by enabling sql_log_bin=0 for the session\&.
+Suppress the SQL command(s) from being written to the binary log by using FLUSH LOCAL or enabling sql_log_bin=0 for the session\&.
.RE
.sp
.RS 4
diff --git a/mysql-test/include/truncate_file.inc b/mysql-test/include/truncate_file.inc
index 2326d6c0b94..fe88cb05bd9 100644
--- a/mysql-test/include/truncate_file.inc
+++ b/mysql-test/include/truncate_file.inc
@@ -1,16 +1,11 @@
# truncate a giving file, all contents of the file are be cleared
-if (!$file)
+if (!$TRUNCATE_FILE)
{
- --echo Please assign a file name to $file!!
- exit;
+ die TRUNCATE_FILE is not set;
}
-let TRUNCATE_FILE= $file;
-
perl;
-use Env;
-Env::import('TRUNCATE_FILE');
-open FILE, '>', $TRUNCATE_FILE || die "Can not open file $file";
+open FILE, '>', $ENV{TRUNCATE_FILE} or die "open(>$ENV{TRUNCATE_FILE}): $!";
close FILE;
EOF
diff --git a/mysql-test/r/create_drop_binlog.result b/mysql-test/r/create_drop_binlog.result
index 9dd5d43125b..be40fcc140a 100644
--- a/mysql-test/r/create_drop_binlog.result
+++ b/mysql-test/r/create_drop_binlog.result
@@ -1,3 +1,4 @@
+reset master;
CREATE OR REPLACE DATABASE d1;
CREATE OR REPLACE DATABASE d1;
DROP DATABASE d1;
diff --git a/mysql-test/r/create_or_replace.result b/mysql-test/r/create_or_replace.result
index 3d9b29ffe27..e26884f1cbf 100644
--- a/mysql-test/r/create_or_replace.result
+++ b/mysql-test/r/create_or_replace.result
@@ -458,3 +458,23 @@ CREATE OR REPLACE TABLE t1 AS SELECT f1();
UNLOCK TABLES;
DROP FUNCTION f1;
DROP TABLE t1;
+#
+# MDEV-11071 - Assertion `thd->transaction.stmt.is_empty()' failed in
+# Locked_tables_list::unlock_locked_tables
+#
+CREATE TEMPORARY TABLE t1(a INT) ENGINE=InnoDB;
+CREATE TEMPORARY TABLE t2(a INT);
+CREATE TABLE t3(a INT);
+LOCK TABLE t2 WRITE;
+SELECT * FROM t2;
+a
+CREATE OR REPLACE TEMPORARY TABLE t1(a INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
+ERROR HY000: CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+SELECT * FROM t3;
+ERROR HY000: Table 't3' was not locked with LOCK TABLES
+CREATE OR REPLACE TEMPORARY TABLE t2(a INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
+ERROR HY000: CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
+SELECT * FROM t3;
+ERROR HY000: Table 't3' was not locked with LOCK TABLES
+UNLOCK TABLES;
+DROP TABLE t3;
diff --git a/mysql-test/r/cte_nonrecursive.result b/mysql-test/r/cte_nonrecursive.result
index d0e42cf4042..a473f96bb57 100644
--- a/mysql-test/r/cte_nonrecursive.result
+++ b/mysql-test/r/cte_nonrecursive.result
@@ -1147,3 +1147,121 @@ SELECT * FROM cte_test;
a
1
DROP VIEW cte_test;
+#
+# mdev-14755 : PS for query using CTE in select with subquery
+#
+create table t1 (a int);
+insert into t1 values
+(7), (2), (8), (1), (3), (2), (7), (5), (4), (7), (9), (8);
+with cte as
+(select a from t1 where a between 4 and 7 group by a)
+(select a from cte where exists( select a from t1 where cte.a=t1.a ))
+union
+(select a from t1 where a < 2);
+a
+7
+5
+4
+1
+prepare stmt from "with cte as
+(select a from t1 where a between 4 and 7 group by a)
+(select a from cte where exists( select a from t1 where cte.a=t1.a ))
+union
+(select a from t1 where a < 2)";
+execute stmt;
+a
+7
+5
+4
+1
+execute stmt;
+a
+7
+5
+4
+1
+deallocate prepare stmt;
+with cte as
+(select a from t1 where a between 4 and 7 group by a)
+(select a from t1 where a < 2)
+union
+(select a from cte where exists( select a from t1 where cte.a=t1.a ));
+a
+1
+7
+5
+4
+prepare stmt from "with cte as
+(select a from t1 where a between 4 and 7 group by a)
+(select a from t1 where a < 2)
+union
+(select a from cte where exists( select a from t1 where cte.a=t1.a ))";
+execute stmt;
+a
+1
+7
+5
+4
+execute stmt;
+a
+1
+7
+5
+4
+deallocate prepare stmt;
+with cte as
+(select a from t1 where a between 4 and 7)
+(select a from t1 where a < 2)
+union
+(select a from cte where exists( select a from t1 where cte.a=t1.a ));
+a
+1
+7
+5
+4
+prepare stmt from "with cte as
+(select a from t1 where a between 4 and 7)
+(select a from t1 where a < 2)
+union
+(select a from cte where exists( select a from t1 where cte.a=t1.a ))";
+execute stmt;
+a
+1
+7
+5
+4
+execute stmt;
+a
+1
+7
+5
+4
+deallocate prepare stmt;
+with cte as
+(select a from t1 where a between 4 and 7)
+(select a from cte
+where exists( select a from t1 where t1.a < 2 and cte.a=t1.a ))
+union
+(select a from cte where exists( select a from t1 where cte.a=t1.a ));
+a
+7
+5
+4
+prepare stmt from "with cte as
+(select a from t1 where a between 4 and 7)
+(select a from cte
+where exists( select a from t1 where t1.a < 2 and cte.a=t1.a ))
+union
+(select a from cte where exists( select a from t1 where cte.a=t1.a ))";
+execute stmt;
+a
+7
+5
+4
+execute stmt;
+a
+7
+5
+4
+deallocate prepare stmt;
+drop table t1;
diff --git a/mysql-test/r/explain_json.result b/mysql-test/r/explain_json.result
index fd342606b3f..ef6b70aff71 100644
--- a/mysql-test/r/explain_json.result
+++ b/mysql-test/r/explain_json.result
@@ -1584,3 +1584,63 @@ EXPLAIN
}
}
drop table t0,t1;
+#
+# MDEV-10844: EXPLAIN FORMAT=JSON doesn't show order direction for filesort
+#
+create table t1 (a int, b int);
+insert into t1 values (1,2),(3,4),(2,3);
+explain format=json select * from t1 order by a, b desc;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "read_sorted_file": {
+ "filesort": {
+ "sort_key": "t1.a, t1.b desc",
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 3,
+ "filtered": 100
+ }
+ }
+ }
+ }
+}
+explain format=json select * from t1 order by a desc, b desc;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "read_sorted_file": {
+ "filesort": {
+ "sort_key": "t1.a desc, t1.b desc",
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 3,
+ "filtered": 100
+ }
+ }
+ }
+ }
+}
+explain format=json select * from t1 order by a desc, b ;
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "read_sorted_file": {
+ "filesort": {
+ "sort_key": "t1.a desc, t1.b",
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 3,
+ "filtered": 100
+ }
+ }
+ }
+ }
+}
+drop table t1;
diff --git a/mysql-test/r/func_json.result b/mysql-test/r/func_json.result
index 25d47574b59..cb4ba0836d7 100644
--- a/mysql-test/r/func_json.result
+++ b/mysql-test/r/func_json.result
@@ -731,6 +731,11 @@ Warning 4042 Syntax error in JSON path in argument 3 to function 'json_contains_
select JSON_VALID(0x36f0c8dccd83c5eac156da);
JSON_VALID(0x36f0c8dccd83c5eac156da)
0
+create table t1(a double not null);
+insert into t1 values (2),(1);
+select 1 from t1 where json_extract(a,'$','$[81]');
+1
+drop table t1;
#
# Start of 10.3 tests
#
diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result
index 982856e980a..804a563f401 100644
--- a/mysql-test/r/func_misc.result
+++ b/mysql-test/r/func_misc.result
@@ -1523,6 +1523,21 @@ str str1 b c
::10.0.5.9 ::10.0.5.9 1 0
DROP TABLE t1;
#
+# MDEV-14613: Assertion `fixed == 0' failed in Item_func::fix_fields
+#
+CREATE TABLE `t1` (
+`numgtfmt` char(10) COLLATE utf8_bin NOT NULL
+) DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+create view v1(numgtfmt)
+as
+select 'x' from t1
+union
+select 'x' from t1 ;
+SELECT * FROM v1 WHERE numgtfmt = NAME_CONST('wnumgtfmt',_utf8'QEDITIONS' COLLATE 'utf8_bin');
+numgtfmt
+DROP VIEW v1;
+DROP TABLE t1;
+#
# End of 10.2 tests
#
#
diff --git a/mysql-test/r/func_set.result b/mysql-test/r/func_set.result
index 46be54ca6a4..73e121f5f2b 100644
--- a/mysql-test/r/func_set.result
+++ b/mysql-test/r/func_set.result
@@ -221,21 +221,11 @@ NULL
DROP TABLE t1;
#
-# Start of 5.3 tests
-#
-#
-# MDEV-4512 Valgrind warnings in my_long10_to_str_8bit on INTERVAL and DATE_ADD with incorrect types
-#
-CREATE TABLE t1 (pk INT PRIMARY KEY);
-INSERT INTO t1 VALUES (10),(11);
-SELECT INTERVAL( 9, 1, DATE_ADD( pk, INTERVAL pk MINUTE_SECOND ), 9, 8, 3, 5, 2, 1 ) FROM t1;
-INTERVAL( 9, 1, DATE_ADD( pk, INTERVAL pk MINUTE_SECOND ), 9, 8, 3, 5, 2, 1 )
-8
-8
-Warnings:
-Warning 1292 Incorrect datetime value: '10' for column 'pk' at row 1
-Warning 1292 Incorrect datetime value: '11' for column 'pk' at row 2
-DROP TABLE t1;
-#
-# End of 5.3 tests
+# MDEV-14596 Crash in INTERVAL(ROW(..),ROW(..))
#
+SELECT INTERVAL(ROW(1,1),ROW(1,2));
+ERROR 21000: Operand should contain 1 column(s)
+SELECT INTERVAL(1,ROW(1,2));
+ERROR 21000: Operand should contain 1 column(s)
+SELECT INTERVAL(ROW(1,2),1);
+ERROR 21000: Operand should contain 1 column(s)
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index e025082177a..62c659dd933 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -2667,6 +2667,31 @@ create table t2 (c1 int, c2 int);
select t1.c1 as c1, t2.c2 as c1 from t1, t2 where t1.c1 < 20 and t2.c2 > 5 group by t1.c1, t2.c2 having t1.c1 < 3;
c1 c1
drop table t1, t2;
+SET @old_sort_buff_size = @@sort_buffer_size;
+SET @@sort_buffer_size=256*1024;
+CREATE TABLE t1 (c INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES
+(2011),(1977),(1982),(2027),(2023),(NULL),(NULL),(2004),(1974),(2032),
+(1993),(NULL),(1995),(2034),(NULL),(2009),(1900),(NULL),(2025),(1900),
+(2033),(1900),(2012),(NULL),(2009),(1992),(1974),(1974),(2012),(2028),
+(2007),(2012),(1900),(1983),(1900),(2010),(1987),(1994),(1981),(2032),
+(2010),(1989),(2014),(1900),(1900),(1976),(1978),(2007),(2030),(NULL),
+(2002),(1997),(1900),(NULL),(2000),(2027),(1975),(2026),(1975),(2026),
+(2029),(1977),(1900),(1900),(2031),(1993),(1986),(2012),(1979),(2013),
+(1994),(2014),(2025),(2006),(1971),(1974),(2021),(2011),(NULL),(1991),
+(2001),(1977),(2023),(2012),(1900),(1978),(1998),(NULL),(1988),(1999),
+(2017),(2008),(1976),(1900),(2005),(2030),(2023),(1900),(1978),(1990),
+(1978),(1987),(2030),(1900),(2034),(2006),(2015),(2001),(2019),(2024),
+(2030),(1989),(1997),(2007),(2023),(1994),(1971),(2011),(2011),(2015),
+(1984),(1978),(1979),(1989),(2008),(2030);
+SELECT ExtractValue('<a></a>','/a') AS f1, SPACE(c) AS f2 FROM t1 GROUP BY f1, f2 WITH ROLLUP;
+f1 f2
+ NULL
+
+ NULL
+NULL NULL
+SET @@sort_buffer_size = @old_sort_buff_size;
+DROP TABLE t1;
#
# Bug #58782
# Missing rows with SELECT .. WHERE .. IN subquery
diff --git a/mysql-test/r/having.result b/mysql-test/r/having.result
index 8a8d6e7b2aa..fe36ef9d442 100644
--- a/mysql-test/r/having.result
+++ b/mysql-test/r/having.result
@@ -696,6 +696,21 @@ id column_1
expected -- 1 row(s) returned not ER_BAD_FIELD_ERROR
drop table t1;
#
+# mdev-14368: grouping query with alias for aggregate function in HAVING
+# when sql_mode = 'ONLY_FULL_GROUP_BY'
+set @save_sql_mode= @@sql_mode;
+set sql_mode = 'ONLY_FULL_GROUP_BY';
+create table t1(a int);
+insert t1 values (4),(1),(2),(1), (3),(4);
+SELECT a, COUNT(a) as ct FROM t1 GROUP BY a HAVING ct>0;
+a ct
+1 2
+2 1
+3 1
+4 2
+set sql_mode=@save_sql_mode;
+drop table t1;
+#
# Bug mdev-5160: two-way join with HAVING over the second table
#
CREATE TABLE t1 (c1 varchar(6)) ENGINE=MyISAM;
diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result
index 46e542910a1..d27a136a6c4 100644
--- a/mysql-test/r/join_outer.result
+++ b/mysql-test/r/join_outer.result
@@ -2431,5 +2431,18 @@ Warnings:
Note 1003 select `test`.`t1`.`col1` AS `col1`,`test`.`t2`.`col1` AS `col1`,`test`.`t2`.`col3` AS `col3` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`col2` = `test`.`t1`.`col1`) where `f1`(`test`.`t2`.`col3`,0) = 0
DROP FUNCTION f1;
DROP TABLE t1,t2;
+#
+# MDEV-10397: Server crashes in key_copy with join_cache_level > 2 and join on BIT fields
+#
+CREATE TABLE t1 (b1 BIT NOT NULL);
+INSERT INTO t1 VALUES (0),(1);
+CREATE TABLE t2 (b2 BIT NOT NULL);
+INSERT INTO t2 VALUES (0),(1);
+SET SESSION JOIN_CACHE_LEVEL = 3;
+SELECT t1.b1+'0' , t2.b2 + '0' FROM t1 LEFT JOIN t2 ON b1 = b2;
+t1.b1+'0' t2.b2 + '0'
+0 0
+1 1
+DROP TABLE t1, t2;
# end of 5.5 tests
SET optimizer_switch=@save_optimizer_switch;
diff --git a/mysql-test/r/join_outer_jcl6.result b/mysql-test/r/join_outer_jcl6.result
index 65e2dde409e..72527040301 100644
--- a/mysql-test/r/join_outer_jcl6.result
+++ b/mysql-test/r/join_outer_jcl6.result
@@ -2442,6 +2442,19 @@ Warnings:
Note 1003 select `test`.`t1`.`col1` AS `col1`,`test`.`t2`.`col1` AS `col1`,`test`.`t2`.`col3` AS `col3` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`col2` = `test`.`t1`.`col1`) where `f1`(`test`.`t2`.`col3`,0) = 0
DROP FUNCTION f1;
DROP TABLE t1,t2;
+#
+# MDEV-10397: Server crashes in key_copy with join_cache_level > 2 and join on BIT fields
+#
+CREATE TABLE t1 (b1 BIT NOT NULL);
+INSERT INTO t1 VALUES (0),(1);
+CREATE TABLE t2 (b2 BIT NOT NULL);
+INSERT INTO t2 VALUES (0),(1);
+SET SESSION JOIN_CACHE_LEVEL = 3;
+SELECT t1.b1+'0' , t2.b2 + '0' FROM t1 LEFT JOIN t2 ON b1 = b2;
+t1.b1+'0' t2.b2 + '0'
+0 0
+1 1
+DROP TABLE t1, t2;
# end of 5.5 tests
SET optimizer_switch=@save_optimizer_switch;
set join_cache_level=default;
diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result
index bac33753d4c..668952d20d7 100644
--- a/mysql-test/r/mysqlbinlog.result
+++ b/mysql-test/r/mysqlbinlog.result
@@ -879,9 +879,7 @@ ROLLBACK /* added by mysqlbinlog */;
End of 5.0 tests
End of 5.1 tests
# Expect deprecation warning.
-WARNING: The --base64-output=always flag and the --base64-output flag (with '=MODE' omitted), are deprecated. The output generated when these flags are used cannot be parsed by mysql 5.6.0 and later. The flags will be removed in a future version. Please use --base64-output=auto instead.
# Expect deprecation warning again.
-WARNING: The --base64-output=always flag and the --base64-output flag (with '=MODE' omitted), are deprecated. The output generated when these flags are used cannot be parsed by mysql 5.6.0 and later. The flags will be removed in a future version. Please use --base64-output=auto instead.
RESET MASTER;
CREATE DATABASE test1;
USE test1;
diff --git a/mysql-test/r/mysqlbinlog_row_compressed.result b/mysql-test/r/mysqlbinlog_row_compressed.result
index 24fff723ec8..705683322f8 100644
--- a/mysql-test/r/mysqlbinlog_row_compressed.result
+++ b/mysql-test/r/mysqlbinlog_row_compressed.result
@@ -73,6 +73,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9='' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at 967
#<date> server id 1 end_log_pos 1040 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@@ -101,6 +102,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+# Number of rows: 1
# at 1281
#<date> server id 1 end_log_pos 1354 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@@ -129,6 +131,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at 1596
#<date> server id 1 end_log_pos 1669 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@@ -157,6 +160,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at 1909
#<date> server id 1 end_log_pos 1982 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@@ -218,6 +222,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 4
# at 2225
#<date> server id 1 end_log_pos 2298 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@@ -298,6 +303,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 3
# at 2561
#<date> server id 1 end_log_pos 2634 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@@ -359,6 +365,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 4
# at 2861
#<date> server id 1 end_log_pos 2934 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@@ -420,6 +427,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 4
# at 3154
#<date> server id 1 end_log_pos 3227 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
diff --git a/mysql-test/r/mysqlbinlog_row_minimal.result b/mysql-test/r/mysqlbinlog_row_minimal.result
index ca8e43bfb33..a030f202f45 100644
--- a/mysql-test/r/mysqlbinlog_row_minimal.result
+++ b/mysql-test/r/mysqlbinlog_row_minimal.result
@@ -71,6 +71,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9='' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at 1015
#<date> server id 1 end_log_pos 1088 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@@ -99,6 +100,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9=NULL /* STRING(1) meta=65025 nullable=1 is_null=1 */
+# Number of rows: 1
# at 1330
#<date> server id 1 end_log_pos 1403 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@@ -127,6 +129,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at 1646
#<date> server id 1 end_log_pos 1719 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@@ -155,6 +158,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at 1962
#<date> server id 1 end_log_pos 2035 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@@ -216,6 +220,7 @@ BEGIN
### @7=6 /* INT meta=0 nullable=1 is_null=0 */
### @8=7 /* INT meta=0 nullable=1 is_null=0 */
### @9='A' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 4
# at 2354
#<date> server id 1 end_log_pos 2427 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@@ -251,6 +256,7 @@ BEGIN
### @5=NULL /* INT meta=0 nullable=1 is_null=1 */
### SET
### @5=5 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at 2665
#<date> server id 1 end_log_pos 2738 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@@ -280,6 +286,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=13 /* INT meta=0 nullable=0 is_null=0 */
+# Number of rows: 4
# at 2927
#<date> server id 1 end_log_pos 3000 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
@@ -309,6 +316,7 @@ BEGIN
### DELETE FROM `test`.`t2`
### WHERE
### @1=13 /* INT meta=0 nullable=0 is_null=0 */
+# Number of rows: 4
# at 3189
#<date> server id 1 end_log_pos 3262 CRC32 XXX Query thread_id=5 exec_time=x error_code=0
SET TIMESTAMP=X/*!*/;
diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result
index 5495f8ffd34..ca8d71895e2 100644
--- a/mysql-test/r/openssl_1.result
+++ b/mysql-test/r/openssl_1.result
@@ -228,8 +228,4 @@ End of 5.1 tests
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
-DELIMITER ;
-# End of log file
-ROLLBACK /* added by mysqlbinlog */;
-/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
-/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
+ERROR: Failed on connect: SSL connection error \ No newline at end of file
diff --git a/mysql-test/r/partition_windows.result b/mysql-test/r/partition_windows.result
index dabcedcb3f9..756690925f8 100644
--- a/mysql-test/r/partition_windows.result
+++ b/mysql-test/r/partition_windows.result
@@ -26,9 +26,5 @@ ALTER TABLE t1 ADD PARTITION (PARTITION p3 DATA DIRECTORY = 'G:/mysqltest/p3Data
Warnings:
Warning 1618 <DATA DIRECTORY> option ignored
Warning 1618 <INDEX DIRECTORY> option ignored
-Warning 1618 <DATA DIRECTORY> option ignored
-Warning 1618 <INDEX DIRECTORY> option ignored
-Warning 1618 <DATA DIRECTORY> option ignored
-Warning 1618 <INDEX DIRECTORY> option ignored
INSERT INTO t1 VALUES (NULL, "last", 4);
DROP TABLE t1;
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index e10a859cbf9..51cdbb90df3 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -4345,6 +4345,24 @@ set join_cache_level=@join_cache_level_save;
deallocate prepare stmt;
drop view v1,v2,v3;
drop table t1,t2,t3;
+#
+# MDEV-10657: incorrect result returned with binary protocol
+# (prepared statements)
+#
+create table t1 (code varchar(10) primary key);
+INSERT INTO t1(code) VALUES ('LINE1'), ('LINE2'), ('LINE3');
+SELECT X.*
+FROM
+(SELECT CODE, RN
+FROM
+(SELECT A.CODE, @cnt := @cnt + 1 AS RN
+FROM t1 A, (SELECT @cnt := 0) C) T
+) X;
+CODE RN
+LINE1 1
+LINE2 2
+LINE3 3
+drop table t1;
# End of 5.5 tests
#
# Start of 10.2 tests
@@ -5075,6 +5093,35 @@ t1 CREATE TABLE `t1` (
DROP TABLE t1;
DROP PROCEDURE p1;
#
+# MDEV-14426 Assertion in Diagnostics_area::set_error_status when using a bad datetime with PS and SP
+#
+CREATE PROCEDURE p1(OUT a VARCHAR(20))
+BEGIN
+SET a=10;
+END;
+$$
+BEGIN NOT ATOMIC
+DECLARE a DATETIME;
+CALL p1(a);
+END;
+$$
+ERROR 22007: Incorrect datetime value: '10' for column 'a' at row 1
+BEGIN NOT ATOMIC
+DECLARE a DATETIME;
+EXECUTE IMMEDIATE 'CALL p1(?)' USING a;
+END;
+$$
+ERROR 22007: Incorrect datetime value: '10' for column 'a' at row 1
+BEGIN NOT ATOMIC
+DECLARE a DATETIME;
+PREPARE stmt FROM 'CALL p1(?)';
+EXECUTE stmt USING a;
+DEALLOCATE PREPARE stmt;
+END;
+$$
+ERROR 22007: Incorrect datetime value: '10' for column 'a' at row 1
+DROP PROCEDURE p1;
+#
# MDEV-14454 Binary protocol returns wrong collation ID for SP OUT parameters
#
CREATE PROCEDURE p1(OUT v CHAR(32) CHARACTER SET utf8) SET v='aaa';
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 7133047f8af..db1c8020653 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -5621,6 +5621,20 @@ PREPARE stmt FROM 'REPLACE INTO v2 SELECT a FROM t3';
ERROR HY000: Can not insert into join view 'test.v2' without fields list
drop view v1,v2;
drop table t3;
+#
+# MDEV-14619: VIEW and GROUP_CONCAT
+#
+CREATE TABLE t1 (str text);
+INSERT INTO t1 VALUES ("My"),("SQL");
+CREATE VIEW v1 AS SELECT GROUP_CONCAT(str SEPARATOR '\\') FROM t1;
+SELECT * FROM v1;
+GROUP_CONCAT(str SEPARATOR '\\')
+My\SQL
+SHOW CREATE VIEW v1;
+View Create View character_set_client collation_connection
+v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select group_concat(`t1`.`str` separator '\\') AS `GROUP_CONCAT(str SEPARATOR '\\')` from `t1` latin1 latin1_swedish_ci
+drop view v1;
+drop table t1;
# -----------------------------------------------------------------
# -- End of 5.5 tests.
# -----------------------------------------------------------------
diff --git a/mysql-test/r/win.result b/mysql-test/r/win.result
index 6309ab090b5..ae0bc1fe8b1 100644
--- a/mysql-test/r/win.result
+++ b/mysql-test/r/win.result
@@ -1779,7 +1779,7 @@ EXPLAIN
"query_block": {
"select_id": 1,
"filesort": {
- "sort_key": "row_number() over ( order by t1.s1,t1.s2)",
+ "sort_key": "row_number() over ( order by t1.s1,t1.s2) desc",
"window_functions_computation": {
"sorts": {
"filesort": {
diff --git a/mysql-test/suite/binlog/r/binlog_base64_flag.result b/mysql-test/suite/binlog/r/binlog_base64_flag.result
index 735a27919ea..db7b175d6bd 100644
--- a/mysql-test/suite/binlog/r/binlog_base64_flag.result
+++ b/mysql-test/suite/binlog/r/binlog_base64_flag.result
@@ -33,10 +33,10 @@ a
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
-# at 4
-<#>ROLLBACK/*!*/;
-# at 102
-<#>use `test`/*!*/;
+<#>
+ROLLBACK/*!*/;
+<#>
+use `test`/*!*/;
SET TIMESTAMP=1196959712/*!*/;
<#>SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=1, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=0/*!*/;
SET @@session.sql_mode=0/*!*/;
@@ -47,7 +47,11 @@ SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1 (a int) engine= myisam
/*!*/;
-# at 203
+<#>
+<#>
+<#>
+<#>
+<#>
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
index 47069b81a15..4422a00335b 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row.result
@@ -327,6 +327,7 @@ INSERT INTO t2 SET a=1;
INSERT INTO t2 SET b=1;
UPDATE t1, t2 SET t1.a=10, t2.a=20;
DROP TABLE t1,t2;
+flush logs;
INSERT INTO t1dec102 VALUES (-999.99);
INSERT INTO t1dec102 VALUES (0);
INSERT INTO t1dec102 VALUES (999.99);
@@ -386,6 +387,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'0' /* BIT(1) meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -406,6 +408,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'1' /* BIT(1) meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -442,6 +445,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'0000001' /* BIT(7) meta=7 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -462,6 +466,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'0000010' /* BIT(7) meta=7 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -482,6 +487,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'0000100' /* BIT(7) meta=7 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -502,6 +508,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'0001000' /* BIT(7) meta=7 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -522,6 +529,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'0010000' /* BIT(7) meta=7 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -542,6 +550,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'0100000' /* BIT(7) meta=7 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -562,6 +571,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'1000000' /* BIT(7) meta=7 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -582,6 +592,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'1111111' /* BIT(7) meta=7 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -602,6 +613,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=b'1111111' /* BIT(7) meta=7 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -624,6 +636,7 @@ BEGIN
### @1=b'0010000' /* BIT(7) meta=7 nullable=1 is_null=0 */
### SET
### @1=b'0001111' /* BIT(7) meta=7 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -661,6 +674,7 @@ BEGIN
### SET
### @1=b'00010010010010001001' /* BIT(20) meta=516 nullable=1 is_null=0 */
### @2='ab' /* STRING(2) meta=65026 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -697,6 +711,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'0000000000000000000000000000000000000000000000000000000000000001' /* BIT(64) meta=2048 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -717,6 +732,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'0000000000000000000000000000000000000000000000000000000000000010' /* BIT(64) meta=2048 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -737,6 +753,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'0000000000000000000000000000000000000000000000000000000010000000' /* BIT(64) meta=2048 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -757,6 +774,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'1111111111111111111111111111111111111111111111111111111111111111' /* BIT(64) meta=2048 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -799,6 +817,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=3 /* TINYINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -819,6 +838,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -841,6 +861,7 @@ BEGIN
### @1=1 /* TINYINT meta=0 nullable=1 is_null=0 */
### SET
### @1=2 /* TINYINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -861,6 +882,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=-128 (128) /* TINYINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -900,6 +922,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -920,6 +943,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=-1 (255) /* TINYINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -956,6 +980,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=1 /* TINYINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -976,6 +1001,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=1 /* TINYINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1012,6 +1038,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=1234 /* SHORTINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1032,6 +1059,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=1234 /* SHORTINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1071,6 +1099,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=-1 (65535) /* SHORTINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1093,6 +1122,7 @@ BEGIN
### @1=-32768 (32768) /* SHORTINT meta=0 nullable=1 is_null=0 */
### SET
### @1=2 /* SHORTINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1113,6 +1143,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=-1 (65535) /* SHORTINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1149,6 +1180,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=12345 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1169,6 +1201,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=12345 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1208,6 +1241,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=-1 (16777215) /* MEDIUMINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1230,6 +1264,7 @@ BEGIN
### @1=-8388608 (8388608) /* MEDIUMINT meta=0 nullable=1 is_null=0 */
### SET
### @1=2 /* MEDIUMINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1250,6 +1285,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=-1 (16777215) /* MEDIUMINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1286,6 +1322,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=123456 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1306,6 +1343,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=123456 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1345,6 +1383,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=-1 (4294967295) /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1367,6 +1406,7 @@ BEGIN
### @1=-2147483648 (2147483648) /* INT meta=0 nullable=1 is_null=0 */
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1387,6 +1427,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=-1 (4294967295) /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1423,6 +1464,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=1234567890 /* LONGINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1443,6 +1485,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=1234567890 /* LONGINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1482,6 +1525,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=-1 (18446744073709551615) /* LONGINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1504,6 +1548,7 @@ BEGIN
### @1=-9223372036854775808 (9223372036854775808) /* LONGINT meta=0 nullable=1 is_null=0 */
### SET
### @1=2 /* LONGINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1524,6 +1569,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=-1 (18446744073709551615) /* LONGINT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1560,6 +1606,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=123.223... /* FLOAT meta=4 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1580,6 +1627,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=123.223... /* FLOAT meta=4 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1616,6 +1664,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=123434.223... /* DOUBLE meta=8 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1636,6 +1685,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=123434.223... /* DOUBLE meta=8 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1672,6 +1722,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=124.45000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1692,6 +1743,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=-543.21000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1712,6 +1764,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=124.45000 /* DECIMAL(10,5) meta=2565 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1748,6 +1801,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='2001:02:03' /* DATE meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1768,6 +1822,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='2001:02:03' /* DATE meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1804,6 +1859,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='2001-02-03 10:20:30' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1824,6 +1880,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='2001-02-03 10:20:30' /* DATETIME(0) meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1860,6 +1917,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=981184830 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1881,6 +1939,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=981184830 /* TIMESTAMP(0) meta=0 nullable=0 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1917,6 +1976,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='11:22:33' /* TIME(0) meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1937,6 +1997,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='11:22:33' /* TIME(0) meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1973,6 +2034,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=2001 /* YEAR meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1993,6 +2055,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=2001 /* YEAR meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2029,6 +2092,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2049,6 +2113,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2085,6 +2150,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2105,6 +2171,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2141,6 +2208,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='b' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2161,6 +2229,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='b' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2197,6 +2266,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' /* STRING(255) meta=65279 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2217,6 +2287,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc' /* STRING(255) meta=65279 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2253,6 +2324,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='a' /* STRING(3) meta=65027 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2273,6 +2345,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='a' /* STRING(3) meta=65027 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2309,6 +2382,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2329,6 +2403,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2365,6 +2440,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='a' /* STRING(3) meta=65027 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2385,6 +2461,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='a' /* STRING(3) meta=65027 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2421,6 +2498,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* STRING(765) meta=57085 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2441,6 +2519,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß' /* STRING(765) meta=57085 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2464,6 +2543,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß' /* STRING(765) meta=57085 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2500,6 +2580,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00a' /* STRING(2) meta=65026 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2520,6 +2601,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00a' /* STRING(2) meta=65026 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2556,6 +2638,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2576,6 +2659,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2612,6 +2696,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00a' /* STRING(2) meta=65026 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2632,6 +2717,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00a' /* STRING(2) meta=65026 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2668,6 +2754,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a' /* STRING(510) meta=61182 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2688,6 +2775,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß' /* STRING(510) meta=61182 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2711,6 +2799,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß\x00ß' /* STRING(510) meta=61182 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2747,6 +2836,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2767,6 +2857,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2803,6 +2894,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='a' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2823,6 +2915,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='a' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2859,6 +2952,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2879,6 +2973,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2915,6 +3010,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2935,6 +3031,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* VARSTRING(261) meta=261 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2971,6 +3068,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2991,6 +3089,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3027,6 +3126,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='a' /* VARSTRING(3) meta=3 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3047,6 +3147,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='a' /* VARSTRING(3) meta=3 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3083,6 +3184,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* VARSTRING(765) meta=765 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3103,6 +3205,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß' /* VARSTRING(765) meta=765 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3126,6 +3229,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß' /* VARSTRING(765) meta=765 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3162,6 +3266,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* VARSTRING(783) meta=783 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3182,6 +3287,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß' /* VARSTRING(783) meta=783 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3205,6 +3311,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß' /* VARSTRING(783) meta=783 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3241,6 +3348,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3261,6 +3369,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3297,6 +3406,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00a' /* VARSTRING(2) meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3317,6 +3427,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00a' /* VARSTRING(2) meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3353,6 +3464,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b' /* VARSTRING(510) meta=510 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3373,6 +3485,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b' /* VARSTRING(510) meta=510 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3409,6 +3522,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b' /* VARSTRING(522) meta=522 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3429,6 +3543,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b\x00a\x00b' /* VARSTRING(522) meta=522 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3465,6 +3580,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3485,6 +3601,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x02' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3505,6 +3622,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3525,6 +3643,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3561,6 +3680,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3581,6 +3701,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* STRING(0) meta=65024 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3617,6 +3738,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3637,6 +3759,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x02' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3657,6 +3780,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3677,6 +3801,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='a' /* STRING(1) meta=65025 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3713,6 +3838,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='' /* STRING(255) meta=65279 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3733,6 +3859,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x02' /* STRING(255) meta=65279 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3753,6 +3880,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a' /* STRING(255) meta=65279 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3773,6 +3901,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* STRING(255) meta=65279 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3809,6 +3938,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3829,6 +3959,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='' /* VARSTRING(0) meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3865,6 +3996,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3885,6 +4017,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x02' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3905,6 +4038,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='a' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3925,6 +4059,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='\x02' /* VARSTRING(1) meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3961,6 +4096,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3981,6 +4117,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4001,6 +4138,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00a\x00' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4021,6 +4159,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='\x02' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4057,6 +4196,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='tinyblob1' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4077,6 +4217,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='tinyblob1' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4113,6 +4254,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='blob1' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4133,6 +4275,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='blob1' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4169,6 +4312,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='mediumblob1' /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4189,6 +4333,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='mediumblob1' /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4225,6 +4370,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='longblob1' /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4245,6 +4391,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='longblob1' /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4281,6 +4428,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='tinytext1' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4301,6 +4449,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='tinytext1' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4337,6 +4486,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='text1' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4357,6 +4507,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='text1' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4393,6 +4544,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='mediumtext1' /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4413,6 +4565,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='mediumtext1' /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4449,6 +4602,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='longtext1' /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4469,6 +4623,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='longtext1' /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4505,6 +4660,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00t\x00i\x00n\x00y\x00t\x00e\x00x\x00t\x001' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4525,6 +4681,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00t\x00i\x00n\x00y\x00t\x00e\x00x\x00t\x001' /* TINYBLOB/TINYTEXT meta=1 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4561,6 +4718,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00t\x00e\x00x\x00t\x001' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4581,6 +4739,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00t\x00e\x00x\x00t\x001' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4617,6 +4776,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00m\x00e\x00d\x00i\x00u\x00m\x00t\x00e\x00x\x00t\x001' /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4637,6 +4797,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00m\x00e\x00d\x00i\x00u\x00m\x00t\x00e\x00x\x00t\x001' /* MEDIUMBLOB/MEDIUMTEXT meta=3 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4673,6 +4834,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='\x00l\x00o\x00n\x00g\x00t\x00e\x00x\x00t\x001' /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4693,6 +4855,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1='\x00l\x00o\x00n\x00g\x00t\x00e\x00x\x00t\x001' /* LONGBLOB/LONGTEXT meta=4 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4729,6 +4892,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=2 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4749,6 +4913,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=2 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4785,6 +4950,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'00000011' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4805,6 +4971,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'00000101' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4825,6 +4992,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4845,6 +5013,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4865,6 +5034,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'00001111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4885,6 +5055,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'00011111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4905,6 +5076,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1=b'00111111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4925,6 +5097,7 @@ BEGIN
### DELETE FROM `test`.`t1`
### WHERE
### @1=b'00000011' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4970,6 +5143,7 @@ BEGIN
### SET
### @1=1 /* INT meta=0 nullable=0 is_null=0 */
### @2=0 /* INT meta=0 nullable=0 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4991,6 +5165,7 @@ BEGIN
### SET
### @1=0 /* INT meta=0 nullable=0 is_null=0 */
### @2=1 /* INT meta=0 nullable=0 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -5012,6 +5187,7 @@ BEGIN
### SET
### @1=1 /* INT meta=0 nullable=0 is_null=0 */
### @2=0 /* INT meta=0 nullable=0 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -5033,6 +5209,7 @@ BEGIN
### SET
### @1=0 /* INT meta=0 nullable=0 is_null=0 */
### @2=1 /* INT meta=0 nullable=0 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -5082,6 +5259,7 @@ BEGIN
### SET
### @1=20 /* INT meta=0 nullable=0 is_null=0 */
### @2=1 /* INT meta=0 nullable=0 is_null=0 */
+# Number of rows: 4
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -5096,74 +5274,40 @@ SET TIMESTAMP=1000000000/*!*/;
DROP TABLE `t1`,`t2` /* generated by server */
/*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-317
-/*!100001 SET @@session.gtid_seq_no=317*//*!*/;
-BEGIN
-/*!*/;
-# at #
-# at #
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
-#Q> INSERT INTO t1dec102 VALUES (-999.99)
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1dec102` mapped to number #
-# at #
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
-### INSERT INTO `test`.`t1dec102`
-### SET
-### @1=!! Old DECIMAL (mysql-4.1 or earlier). Not enough metadata to display the value. # at #
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
-SET TIMESTAMP=1000000000/*!*/;
-COMMIT
-/*!*/;
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Rotate to master-bin.000002 pos: 4
+DELIMITER ;
+# End of log file
+ROLLBACK /* added by mysqlbinlog */;
+/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
+/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
+/*!40019 SET @@session.max_insert_delayed_threads=0*/;
+/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
+DELIMITER /*!*/;
# at #
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-318
-/*!100001 SET @@session.gtid_seq_no=318*//*!*/;
-BEGIN
-/*!*/;
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Start: binlog v 4, server v #.##.## created 010909 4:46:40
# at #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Gtid list [0-1-316]
# at #
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
-#Q> INSERT INTO t1dec102 VALUES (0)
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1dec102` mapped to number #
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Binlog checkpoint master-bin.000001
# at #
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
-### INSERT INTO `test`.`t1dec102`
-### SET
-### @1=!! Old DECIMAL (mysql-4.1 or earlier). Not enough metadata to display the value. # at #
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
-SET TIMESTAMP=1000000000/*!*/;
-COMMIT
-/*!*/;
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Binlog checkpoint master-bin.000002
# at #
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-319
-/*!100001 SET @@session.gtid_seq_no=319*//*!*/;
+#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-317
+/*!100101 SET @@session.skip_parallel_replication=0*//*!*/;
+/*!100001 SET @@session.gtid_domain_id=0*//*!*/;
+/*!100001 SET @@session.server_id=1*//*!*/;
+/*!100001 SET @@session.gtid_seq_no=317*//*!*/;
BEGIN
/*!*/;
# at #
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
-#Q> INSERT INTO t1dec102 VALUES (999.99)
+#Q> INSERT INTO t1dec102 VALUES (-999.99)
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1dec102` mapped to number #
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Write_rows: table id # flags: STMT_END_F
### INSERT INTO `test`.`t1dec102`
### SET
-### @1=!! Old DECIMAL (mysql-4.1 or earlier). Not enough metadata to display the value. # at #
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
-SET TIMESTAMP=1000000000/*!*/;
-COMMIT
-/*!*/;
-# at #
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX GTID 0-1-320 ddl
-/*!100001 SET @@session.gtid_seq_no=320*//*!*/;
-# at #
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
-SET TIMESTAMP=1000000000/*!*/;
-DROP TABLE `t1dec102` /* generated by server */
-/*!*/;
-# at #
-#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Rotate to master-bin.000002 pos: 4
-DELIMITER ;
-# End of log file
-ROLLBACK /* added by mysqlbinlog */;
-/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
-/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
+### @1=
+Error: Found Old DECIMAL (mysql-4.1 or earlier). Not enough metadata to display the value.
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
index 365fcff2a72..3dcaad61897 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_innodb.result
@@ -2543,6 +2543,7 @@ BEGIN
### @77=1 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000000' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -2724,6 +2725,7 @@ BEGIN
### @77=3 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -3071,6 +3073,7 @@ BEGIN
### @77=2 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=4 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -3410,6 +3413,7 @@ BEGIN
### @77=3 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -3754,6 +3758,7 @@ BEGIN
### @77=1 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000000' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -4096,6 +4101,7 @@ BEGIN
### @77=2 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -4441,6 +4447,7 @@ BEGIN
### @77=NULL /* ENUM(1 byte) meta=63233 nullable=1 is_null=1 */
### @78=NULL /* SET(1 bytes) meta=63489 nullable=1 is_null=1 */
### @79=4 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -4620,6 +4627,7 @@ BEGIN
### @77=3 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -4796,6 +4804,7 @@ BEGIN
### @77=1 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000000' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -4975,6 +4984,7 @@ BEGIN
### @77=2 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -5152,6 +5162,7 @@ BEGIN
### @77=NULL /* ENUM(1 byte) meta=63233 nullable=1 is_null=1 */
### @78=NULL /* SET(1 bytes) meta=63489 nullable=1 is_null=1 */
### @79=4 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -5345,6 +5356,7 @@ BEGIN
### @1='2008:08:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-09' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=9 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 9
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -5423,6 +5435,7 @@ BEGIN
### @1='2008:08:17' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-07' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 7
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -5473,6 +5486,7 @@ BEGIN
### @1='2008:08:17' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-07' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 7
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -5766,6 +5780,7 @@ BEGIN
### @1='2008:01:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-09' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=19 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 9
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -5835,6 +5850,7 @@ BEGIN
### @1='2008:02:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-09' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=29 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 9
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -5904,6 +5920,7 @@ BEGIN
### @1='2008:03:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-09' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=39 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 9
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -6093,6 +6110,7 @@ BEGIN
### @1='2038:03:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 18
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -6207,6 +6225,7 @@ BEGIN
### @1='2038:03:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 18
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -6338,6 +6357,7 @@ BEGIN
### @1=5 /* INT meta=0 nullable=1 is_null=0 */
### @2=6 /* INT meta=0 nullable=1 is_null=0 */
### @3='Wow' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
index 7c6c21625f2..a4d929148e8 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_myisam.result
@@ -2543,6 +2543,7 @@ BEGIN
### @77=1 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000000' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -2727,6 +2728,7 @@ BEGIN
### @77=3 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3076,6 +3078,7 @@ BEGIN
### @77=2 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=4 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3417,6 +3420,7 @@ BEGIN
### @77=3 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -3763,6 +3767,7 @@ BEGIN
### @77=1 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000000' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4107,6 +4112,7 @@ BEGIN
### @77=2 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4454,6 +4460,7 @@ BEGIN
### @77=NULL /* ENUM(1 byte) meta=63233 nullable=1 is_null=1 */
### @78=NULL /* SET(1 bytes) meta=63489 nullable=1 is_null=1 */
### @79=4 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4635,6 +4642,7 @@ BEGIN
### @77=3 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000111' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4813,6 +4821,7 @@ BEGIN
### @77=1 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000000' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -4994,6 +5003,7 @@ BEGIN
### @77=2 /* ENUM(1 byte) meta=63233 nullable=1 is_null=0 */
### @78=b'00000110' /* SET(1 bytes) meta=63489 nullable=1 is_null=0 */
### @79=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -5173,6 +5183,7 @@ BEGIN
### @77=NULL /* ENUM(1 byte) meta=63233 nullable=1 is_null=1 */
### @78=NULL /* SET(1 bytes) meta=63489 nullable=1 is_null=1 */
### @79=4 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -5368,6 +5379,7 @@ BEGIN
### @1='2008:08:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-09' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=9 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 9
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -5448,6 +5460,7 @@ BEGIN
### @1='2008:08:17' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-07' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 7
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -5500,6 +5513,7 @@ BEGIN
### @1='2008:08:17' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-07' /* VARSTRING(24) meta=24 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 7
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -5795,6 +5809,7 @@ BEGIN
### @1='2008:01:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-01-09' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=19 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 9
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -5866,6 +5881,7 @@ BEGIN
### @1='2008:02:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-02-09' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=29 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 9
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -5937,6 +5953,7 @@ BEGIN
### @1='2008:03:09' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-09' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=39 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 9
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -6128,6 +6145,7 @@ BEGIN
### @1='2038:03:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 18
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -6244,6 +6262,7 @@ BEGIN
### @1='2038:03:07' /* DATE meta=0 nullable=1 is_null=0 */
### @2='VARCHAR-03-07' /* VARSTRING(255) meta=255 nullable=1 is_null=0 */
### @3=7 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 18
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -6377,6 +6396,7 @@ BEGIN
### @1=5 /* INT meta=0 nullable=1 is_null=0 */
### @2=6 /* INT meta=0 nullable=1 is_null=0 */
### @3='Wow' /* VARSTRING(60) meta=60 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
index c6c7684f4c8..6a0c6b0532f 100644
--- a/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
+++ b/mysql-test/suite/binlog/r/binlog_mysqlbinlog_row_trans.result
@@ -193,6 +193,7 @@ BEGIN
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
@@ -221,6 +222,7 @@ BEGIN
### SET
### @1=13 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
@@ -232,6 +234,7 @@ BEGIN
### WHERE
### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -275,6 +278,7 @@ BEGIN
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -313,6 +317,7 @@ BEGIN
### SET
### @1=13 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -334,6 +339,7 @@ BEGIN
### WHERE
### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -363,6 +369,7 @@ BEGIN
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
@@ -391,6 +398,7 @@ BEGIN
### SET
### @1=13 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
@@ -402,6 +410,7 @@ BEGIN
### WHERE
### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -445,6 +454,7 @@ BEGIN
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -483,6 +493,7 @@ BEGIN
### SET
### @1=13 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-3' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -504,6 +515,7 @@ BEGIN
### WHERE
### @1=12 /* INT meta=0 nullable=1 is_null=0 */
### @2='varchar-2' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id 1 end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_row_annotate.result b/mysql-test/suite/binlog/r/binlog_row_annotate.result
index 8a37200a2e3..25a9b295301 100644
--- a/mysql-test/suite/binlog/r/binlog_row_annotate.result
+++ b/mysql-test/suite/binlog/r/binlog_row_annotate.result
@@ -162,6 +162,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -188,6 +189,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -214,6 +216,7 @@ BEGIN
### INSERT INTO `test3`.`t3`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -255,6 +258,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 6
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -281,6 +285,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -309,6 +314,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -386,6 +392,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -551,6 +558,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -575,6 +583,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -599,6 +608,7 @@ BEGIN
### INSERT INTO `test3`.`t3`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -636,6 +646,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 6
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -660,6 +671,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -684,6 +696,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -773,6 +786,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -799,6 +813,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -825,6 +840,7 @@ BEGIN
### INSERT INTO `test3`.`t3`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -866,6 +882,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 6
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -892,6 +909,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -920,6 +938,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -997,6 +1016,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1161,6 +1181,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1184,6 +1205,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1207,6 +1229,7 @@ BEGIN
### INSERT INTO `test3`.`t3`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1243,6 +1266,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 6
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1266,6 +1290,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -1289,6 +1314,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
index da51ec1e3b6..343b21160fd 100644
--- a/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
+++ b/mysql-test/suite/binlog/r/binlog_row_ctype_ucs.result
@@ -18,6 +18,8 @@ DELIMITER /*!*/;
ROLLBACK/*!*/;
BEGIN
/*!*/;
+# Annotate_rows:
+#Q> insert into t2 values (@v)
SET TIMESTAMP=10000/*!*/;
SET @@session.pseudo_thread_id=999999999/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1, @@session.check_constraint_checks=1/*!*/;
@@ -114,6 +116,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ä(i1)' /* VARSTRING(30) meta=30 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=XXX/*!*/;
@@ -134,6 +137,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ä(i2)' /* VARSTRING(30) meta=30 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=XXX/*!*/;
@@ -154,6 +158,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ä(i3)' /* VARSTRING(30) meta=30 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=XXX/*!*/;
@@ -174,6 +179,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ä(p1)' /* VARSTRING(30) meta=30 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=XXX/*!*/;
@@ -194,6 +200,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ä(p2)' /* VARSTRING(30) meta=30 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=XXX/*!*/;
@@ -214,6 +221,7 @@ BEGIN
### INSERT INTO `test`.`t1`
### SET
### @1='ä(p3)' /* VARSTRING(30) meta=30 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#YYMMDD HH:MM:SS server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=XXX/*!*/;
diff --git a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
index e48dd2c89b4..1114902bae1 100644
--- a/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
+++ b/mysql-test/suite/binlog/r/binlog_row_mysqlbinlog_options.result
@@ -79,6 +79,7 @@ BEGIN
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -111,6 +112,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -132,6 +134,7 @@ BEGIN
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -164,6 +167,7 @@ BEGIN
### INSERT INTO `new_test3`.`t3`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -185,6 +189,7 @@ BEGIN
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -223,6 +228,7 @@ BEGIN
### SET
### @1=6 /* INT meta=0 nullable=1 is_null=0 */
### @2=6 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 5
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -243,6 +249,7 @@ BEGIN
### DELETE FROM `new_test3`.`t3`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -313,6 +320,7 @@ BEGIN
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -345,6 +353,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -366,6 +375,7 @@ BEGIN
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -398,6 +408,7 @@ BEGIN
### INSERT INTO `new_test3`.`t3`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -419,6 +430,7 @@ BEGIN
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
### @2=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -457,6 +469,7 @@ BEGIN
### SET
### @1=6 /* INT meta=0 nullable=1 is_null=0 */
### @2=6 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 5
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -477,6 +490,7 @@ BEGIN
### DELETE FROM `new_test3`.`t3`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 4:46:40 server id # end_log_pos # CRC32 XXX Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
diff --git a/mysql-test/suite/binlog/r/flashback.result b/mysql-test/suite/binlog/r/flashback.result
index c96eaebe838..24c9b735fe5 100644
--- a/mysql-test/suite/binlog/r/flashback.result
+++ b/mysql-test/suite/binlog/r/flashback.result
@@ -100,6 +100,7 @@ BEGIN
### @6='' /* STRING(10) meta=65034 nullable=1 is_null=0 */
### @7='' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### @8='' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -125,6 +126,7 @@ BEGIN
### @6='abc' /* STRING(10) meta=65034 nullable=1 is_null=0 */
### @7='abcdefg' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### @8='abcedfghijklmnopqrstuvwxyz' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -150,6 +152,7 @@ BEGIN
### @6='aaaaaaaaaa' /* STRING(10) meta=65034 nullable=1 is_null=0 */
### @7='aaaaaaaaaaaaaaaaaaaa' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### @8='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 1
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -203,6 +206,7 @@ BEGIN
### @6='abc' /* STRING(10) meta=65034 nullable=1 is_null=0 */
### @7='abcdefg' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### @8='abcedfghijklmnopqrstuvwxyz' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 2
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -248,6 +252,7 @@ BEGIN
### @6='aaaaaaaaaa' /* STRING(10) meta=65034 nullable=1 is_null=0 */
### @7='aaaaaaaaaaaaaaaaaaaa' /* VARSTRING(20) meta=20 nullable=1 is_null=0 */
### @8='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' /* BLOB/TEXT meta=2 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
COMMIT/*!*/;
@@ -272,18 +277,23 @@ ROLLBACK/*!*/;
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
#Q> INSERT INTO t1 VALUES(0,0,0,0,0,'','','')
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
+# Number of rows: 1
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
#Q> INSERT INTO t1 VALUES(1,2,3,4,5, "abc", "abcdefg", "abcedfghijklmnopqrstuvwxyz")
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
+# Number of rows: 1
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
#Q> INSERT INTO t1 VALUES(127, 32767, 8388607, 2147483647, 9223372036854775807, repeat('a', 10), repeat('a', 20), repeat('a', 255))
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
+# Number of rows: 1
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
#Q> UPDATE t1 SET c01=100 WHERE c02=0 OR c03=3
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
+# Number of rows: 2
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Annotate_rows:
#Q> DELETE FROM t1
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Table_map: `test`.`t1` mapped to number #
+# Number of rows: 3
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Rotate to master-bin.000002 pos: 4
#010909 9:46:40 server id 1 end_log_pos # CRC32 XXX Xid = #
BEGIN/*!*/;
diff --git a/mysql-test/suite/binlog/t/binlog_base64_flag.test b/mysql-test/suite/binlog/t/binlog_base64_flag.test
index f8333315088..f17b51166e9 100644
--- a/mysql-test/suite/binlog/t/binlog_base64_flag.test
+++ b/mysql-test/suite/binlog/t/binlog_base64_flag.test
@@ -68,15 +68,12 @@ TFtYRxcBAAAAIgAAAKEBAAAQABAAAAAAAAEAAf/+AwAAAA==
select * from t1;
-# Test that mysqlbinlog stops with an error message when the
-# --base64-output=never flag is used on a binlog with base64 events.
+# New mysqlbinlog supports --base64-output=never
--echo ==== Test --base64-output=never on a binlog with row events ====
# mysqlbinlog should fail
---replace_regex /#[0-9][0-9][0-9][0-9][0-9][0-9] .*/<#>/ /SET \@\@session.pseudo_thread_id.*/<#>/
-error 1;
-exec $MYSQL_BINLOG --base64-output=never suite/binlog/std_data/bug32407.001;
-# the above line should output the query log event and then stop
+--replace_regex /#[0-9][0-9][0-9][0-9][0-9][0-9] \N*/<#>/ /SET \@\@session.pseudo_thread_id.*/<#>/
+exec $MYSQL_BINLOG --base64-output=never --print-row-count=0 --print-row-event-positions=0 suite/binlog/std_data/bug32407.001;
# Test that the following fails cleanly: "First, read a
diff --git a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test
index 750bf10901f..9cc8e3f22a7 100644
--- a/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test
+++ b/mysql-test/suite/binlog/t/binlog_mysqlbinlog_row.test
@@ -438,6 +438,8 @@ INSERT INTO t2 SET b=1;
UPDATE t1, t2 SET t1.a=10, t2.a=20;
DROP TABLE t1,t2;
+flush logs;
+
let $MYSQLD_DATADIR= `select @@datadir`;
--copy_file std_data/old_decimal/t1dec102.frm $MYSQLD_DATADIR/test/t1dec102.frm
@@ -455,3 +457,8 @@ flush logs;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9]*[.][0-9]{1,3})[0-9e+-]*[^ ]*(.*(FLOAT|DOUBLE).*[*].)/\1...\2/ /CRC32 0x[0-9a-f]*/CRC32 XXX/
--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000001
+
+--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
+--replace_regex /SQL_LOAD_MB-[0-9]-[0-9]/SQL_LOAD_MB-#-#/ /exec_time=[0-9]*/exec_time=#/ /end_log_pos [0-9]*/end_log_pos #/ /# at [0-9]*/# at #/ /thread_id=[0-9]*/thread_id=#/ /table id [0-9]*/table id #/ /mapped to number [0-9]*/mapped to number #/ /server v [^ ]*/server v #.##.##/ /(@[0-9]*=[0-9]*[.][0-9]{1,3})[0-9e+-]*[^ ]*(.*(FLOAT|DOUBLE).*[*].)/\1...\2/ /CRC32 0x[0-9a-f]*/CRC32 XXX/
+--error 1
+--exec $MYSQL_BINLOG --base64-output=decode-rows -v -v $MYSQLD_DATADIR/master-bin.000002 2>&1
diff --git a/mysql-test/suite/binlog_encryption/binlog_row_annotate.result b/mysql-test/suite/binlog_encryption/binlog_row_annotate.result
index e72fc9faa6e..790fe225d7a 100644
--- a/mysql-test/suite/binlog_encryption/binlog_row_annotate.result
+++ b/mysql-test/suite/binlog_encryption/binlog_row_annotate.result
@@ -163,6 +163,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -189,6 +190,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -215,6 +217,7 @@ BEGIN
### INSERT INTO `test3`.`t3`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -256,6 +259,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 6
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -282,6 +286,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -310,6 +315,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -387,6 +393,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -551,6 +558,7 @@ BEGIN
### INSERT INTO `test1`.`t1`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -574,6 +582,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -597,6 +606,7 @@ BEGIN
### INSERT INTO `test3`.`t3`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -633,6 +643,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 6
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -656,6 +667,7 @@ BEGIN
### INSERT INTO `test2`.`t2`
### SET
### @1=3 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
@@ -679,6 +691,7 @@ BEGIN
### DELETE FROM `test2`.`t2`
### WHERE
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
+# Number of rows: 3
# at #
#010909 4:46:40 server id # end_log_pos # Query thread_id=# exec_time=# error_code=0
SET TIMESTAMP=1000000000/*!*/;
diff --git a/mysql-test/suite/galera/r/galera_gtid_slave.result b/mysql-test/suite/galera/r/galera_gtid_slave.result
new file mode 100644
index 00000000000..0b6306bdc6a
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_gtid_slave.result
@@ -0,0 +1,36 @@
+connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
+connection node_2;
+START SLAVE;
+connection node_1;
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+begin;
+insert into t2 values(21);
+insert into t2 values(22);
+commit;
+SELECT @@global.gtid_binlog_state;
+@@global.gtid_binlog_state
+1-1-4
+connection node_2;
+INSERT INTO t1 VALUES(2);
+INSERT INTO t1 VALUES(3);
+SELECT @@global.gtid_binlog_state;
+@@global.gtid_binlog_state
+1-1-4,2-2-2
+connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3;
+INSERT INTO t1 VALUES(4);
+SELECT @@global.gtid_binlog_state;
+@@global.gtid_binlog_state
+1-1-4,2-2-2,2-3-3
+connection node_1;
+DROP TABLE t1,t2;
+reset master;
+connection node_2;
+connection node_3;
+connection node_2;
+STOP SLAVE;
+RESET SLAVE ALL;
+reset master;
+connection node_3;
+reset master;
diff --git a/mysql-test/suite/galera/r/galera_gtid_slave_sst_rsync.result b/mysql-test/suite/galera/r/galera_gtid_slave_sst_rsync.result
new file mode 100644
index 00000000000..81fae57d731
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_gtid_slave_sst_rsync.result
@@ -0,0 +1,130 @@
+#Connection 2
+START SLAVE;
+#Connection 1
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 int unique) ENGINE=InnoDB;
+INSERT INTO t2 VALUES(1,11);
+INSERT INTO t2 VALUES(2,22);
+INSERT INTO t2 VALUES(3,33);
+SELECT @@global.gtid_binlog_state;
+@@global.gtid_binlog_state
+1-1-4
+include/save_master_gtid.inc
+#Connection 2
+include/sync_with_master_gtid.inc
+SELECT @@global.gtid_binlog_state;
+@@global.gtid_binlog_state
+1-1-4
+INSERT INTO t2 VALUES(4,44);
+INSERT INTO t2 VALUES(5,55);
+INSERT INTO t2 VALUES(6,66);
+SELECT @@global.gtid_binlog_state;
+@@global.gtid_binlog_state
+1-1-4,2-2-3
+#Connection 3
+INSERT INTO t2 VALUES(7,77);
+INSERT INTO t2 VALUES(8,88);
+SELECT @@global.gtid_binlog_state;
+@@global.gtid_binlog_state
+1-1-4,2-2-3,2-3-5
+#Connection 1
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+include/save_master_gtid.inc
+#Connection 2
+include/sync_with_master_gtid.inc
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+#Connection 3
+Shutting down server ...
+#Connection 2
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+#Connection 3
+Starting server ...
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node3_committed_after');
+INSERT INTO t1 VALUES ('node3_committed_after');
+COMMIT;
+#Connection 2
+Select * from t1 order by f1;
+f1
+node1_committed_before
+node1_committed_before
+node1_committed_during
+node1_committed_during
+node2_committed_before
+node2_committed_before
+node3_committed_after
+node3_committed_after
+#Connection 3
+Select * from t1 order by f1;
+f1
+node1_committed_before
+node1_committed_before
+node1_committed_during
+node1_committed_during
+node2_committed_before
+node2_committed_before
+node3_committed_after
+node3_committed_after
+#Connection 2
+SELECT @@global.gtid_binlog_state;
+@@global.gtid_binlog_state
+1-1-6,2-2-7,2-3-8
+#Connection 3
+SELECT @@global.gtid_binlog_state;
+@@global.gtid_binlog_state
+1-1-6,2-2-7,2-3-8
+#Connection 1
+SET AUTOCOMMIT=ON;
+#Connection 2
+SET AUTOCOMMIT=ON;
+#Connection 3
+SET AUTOCOMMIT=ON;
+#Connection 2
+STOP slave;
+INSERT INTO t1 VALUES ('node2_slave_stoped');
+#Connection 1
+INSERT INTO t1 VALUES ('node1_normal_entry');
+include/save_master_gtid.inc
+#Connection 2
+INSERT INTO t1 VALUES ('node2_slave_stoped_inserted');
+start slave;
+include/sync_with_master_gtid.inc
+INSERT INTO t1 VALUES ('node2_slave_started');
+SELECT count(*) from t1;
+count(*)
+12
+SELECT @@global.gtid_binlog_state;
+@@global.gtid_binlog_state
+1-1-7,2-3-8,2-2-11
+#Connection 3
+SELECT count(*) from t1;
+count(*)
+12
+SELECT @@global.gtid_binlog_state;
+@@global.gtid_binlog_state
+1-1-7,2-3-8,2-2-11
+#Connection 1
+DROP TABLE t2,t1;
+#Connection 2
+#Connection 3
+#Connection 2
+STOP SLAVE;
+RESET SLAVE ALL;
+reset master;
+#Connection 3
+reset master;
+#Connection 1
+reset master;
diff --git a/mysql-test/suite/galera/r/query_cache.result b/mysql-test/suite/galera/r/query_cache.result
index 4aaae2997f3..d497fc87544 100644
--- a/mysql-test/suite/galera/r/query_cache.result
+++ b/mysql-test/suite/galera/r/query_cache.result
@@ -820,6 +820,9 @@ Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 9
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 21
insert delayed into t1 values (4);
select a from t1;
a
@@ -870,6 +873,9 @@ Qcache_queries_in_cache 0
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 9
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 22
# On node-2
connection node_2;
show global variables like "query_cache_min_res_unit";
@@ -916,12 +922,15 @@ a
1
2
3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
-show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
Variable_name Value
-Qcache_queries_in_cache 2
+Qcache_inserts 24
# On node-2
connection node_2;
select * from t1;
@@ -944,12 +953,12 @@ a
1
2
3
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 10
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 10
drop table t1;
select a from t2;
a
@@ -961,12 +970,15 @@ a
1
2
3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
-show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
Variable_name Value
-Qcache_queries_in_cache 2
+Qcache_inserts 18
set GLOBAL query_cache_min_res_unit=default;
show global variables like "query_cache_min_res_unit";
Variable_name Value
@@ -983,12 +995,15 @@ a
1
2
3
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
-show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
Variable_name Value
-Qcache_queries_in_cache 2
+Qcache_inserts 25
drop table t2;
set GLOBAL query_cache_min_res_unit=default;
show global variables like "query_cache_min_res_unit";
@@ -1010,6 +1025,9 @@ Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 27
# On node-2
connection node_2;
select "aaa" from t1;
@@ -1024,6 +1042,9 @@ Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 20
drop table t1;
# On node-1
connection node_1;
@@ -1322,6 +1343,9 @@ select count(*) from t1;
count(*)
140
drop table t1;
+#
+# INTO OUTFILE/DUMPFILE test
+#
# On node-1
connection node_1;
create table t1 (a int) engine=innodb;
@@ -1342,7 +1366,13 @@ Qcache_queries_in_cache 0
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 36
drop table t1;
+#
+# Test of SQL_SELECT_LIMIT
+#
# On node-1
connection node_1;
create table t1 (a int) engine=innodb;
@@ -1367,6 +1397,9 @@ Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 38
SET SQL_SELECT_LIMIT=DEFAULT;
# On node-2
connection node_2;
@@ -1392,6 +1425,9 @@ Variable_name Value
Qcache_hits 11
SET SQL_SELECT_LIMIT=DEFAULT;
drop table t1;
+#
+# WRITE LOCK & QC
+#
# On node-1
connection node_1;
create table t1 (a int not null) engine=innodb;
@@ -1408,6 +1444,9 @@ Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 40
lock table t1 write, t2 read;
show status like "Qcache_queries_in_cache";
Variable_name Value
@@ -1431,6 +1470,9 @@ Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 41
unlock table;
drop view v1;
set query_cache_wlock_invalidate=default;
@@ -1471,10 +1513,16 @@ Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
+show status like "Qcache_inserts";
+Variable_name Value
+Qcache_inserts 34
unlock table;
drop view v1;
set query_cache_wlock_invalidate=default;
drop table t1,t2;
+#
+# Hiding real table stored in query cache by temporary table
+#
# On node-1
connection node_1;
create table t1 (id int primary key) engine=innodb;
@@ -1498,92 +1546,119 @@ SELECT a,'Â','â'='Â' FROM t1;
a  'â'='Â'
à Â 0
à Â 0
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
-show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
Variable_name Value
-Qcache_queries_in_cache 1
+Qcache_inserts 43
set collation_connection=koi8r_bin;
SELECT a,'Â','â'='Â' FROM t1;
a  'â'='Â'
à Â 0
à Â 0
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
-show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
Variable_name Value
-Qcache_queries_in_cache 2
+Qcache_inserts 44
set character_set_client=cp1251;
SELECT a,'Â','â'='Â' FROM t1;
a ç? 'ç?'='ç?'
à ç? 1
à ç? 1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 3
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
-show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
Variable_name Value
-Qcache_queries_in_cache 3
+Qcache_inserts 45
set character_set_results=cp1251;
SELECT a,'Â','â'='Â' FROM t1;
a � 'â'='Â'
ö Ã? 1
ö Ã? 1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 4
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
-show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
Variable_name Value
-Qcache_queries_in_cache 4
+Qcache_inserts 46
SET NAMES default;
# On node-2
connection node_2;
+#
+# Run select
+#
SELECT a,'Â','â'='Â' FROM t1;
a  'â'='Â'
? Â 0
? Â 0
-show status like "Qcache_hits";
-Variable_name Value
-Qcache_hits 11
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
+show status like "Qcache_hits";
+Variable_name Value
+Qcache_hits 11
set collation_connection=koi8r_bin;
SELECT a,'Â','â'='Â' FROM t1;
a ?? 'â'='Â'
? ?? 1
? ?? 1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
-show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
Variable_name Value
-Qcache_queries_in_cache 2
+Qcache_inserts 36
set character_set_client=cp1251;
SELECT a,'Â','â'='Â' FROM t1;
a ?? '??'='?‚'
? ?? 1
? ?? 1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 3
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
-show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
Variable_name Value
-Qcache_queries_in_cache 3
+Qcache_inserts 37
set character_set_results=cp1251;
SELECT a,'Â','â'='Â' FROM t1;
a � 'â'='Â'
ö Ã? 1
ö Ã? 1
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 4
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
-show status like "Qcache_queries_in_cache";
+show status like "Qcache_inserts";
Variable_name Value
-Qcache_queries_in_cache 4
+Qcache_inserts 38
drop table t1;
+#
+# Comments before command
+#
# On node-1
connection node_1;
create table t1 (a int) engine=innodb;
@@ -1634,6 +1709,9 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
drop table t1;
+#
+# Information schema & query cache test
+#
# On node-1
connection node_1;
set session query_cache_type = 2;
diff --git a/mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt b/mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt
index a36d21315a6..576829cfef8 100644
--- a/mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt
+++ b/mysql-test/suite/galera/t/galera_binlog_event_max_size_max-master.opt
@@ -1 +1 @@
---binlog-row-event-max-size=4294967295
+--binlog-row-event-max-size=4294967040
diff --git a/mysql-test/suite/galera/t/galera_gtid_slave.cnf b/mysql-test/suite/galera/t/galera_gtid_slave.cnf
new file mode 100644
index 00000000000..409d0d1609a
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gtid_slave.cnf
@@ -0,0 +1,18 @@
+!include ../galera_2nodes_as_slave.cnf
+
+[mysqld]
+log-bin=mysqld-bin
+log-slave-updates
+binlog-format=ROW
+
+[mysqld.1]
+gtid-domain-id=1
+[mysqld.2]
+gtid-domain-id=2
+wsrep_gtid_mode=1
+wsrep_gtid_domain_id=2
+[mysqld.3]
+gtid-domain-id=2
+wsrep_gtid_mode=1
+wsrep_gtid_domain_id=2
+
diff --git a/mysql-test/suite/galera/t/galera_gtid_slave.test b/mysql-test/suite/galera/t/galera_gtid_slave.test
new file mode 100644
index 00000000000..8ef87452a5b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gtid_slave.test
@@ -0,0 +1,78 @@
+#
+# Test Galera as a slave to a MariaDB master using GTIDs
+#
+# suite/galera/galera_2nodes_as_slave.cnf describes the setup of the nodes
+# suite/galera/t/galera_as_slave_gtid.cnf has the GTID options
+#
+# In addition to performing DDL and DML, we check that the gtid of the master is preserved inside the cluster
+#
+
+--source include/have_innodb.inc
+
+# As node #1 is not a Galera node, we connect to node #2 in order to run include/galera_cluster.inc
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--source include/galera_cluster.inc
+
+--connection node_2
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_1;
+--enable_query_log
+START SLAVE;
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB;
+INSERT INTO t1 VALUES(1);
+
+#multi stmt trans
+begin;
+insert into t2 values(21);
+insert into t2 values(22);
+commit;
+
+SELECT @@global.gtid_binlog_state;
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
+--source include/wait_condition.inc
+--sleep 1
+INSERT INTO t1 VALUES(2);
+INSERT INTO t1 VALUES(3);
+SELECT @@global.gtid_binlog_state;
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--let $wait_condition = SELECT COUNT(*) = 3 FROM t1;
+--source include/wait_condition.inc
+
+INSERT INTO t1 VALUES(4);
+SELECT @@global.gtid_binlog_state;
+
+--connection node_1
+DROP TABLE t1,t2;
+reset master;
+#
+# Unfortunately without the sleep below the following statement fails with "query returned no rows", which
+# is difficult to understand given that it is an aggregate query. A "query execution was interrupted"
+# warning is also reported by MTR, which is also weird.
+#
+
+--sleep 1
+
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--connection node_2
+STOP SLAVE;
+RESET SLAVE ALL;
+reset master;
+
+--connection node_3
+reset master;
diff --git a/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.cnf b/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.cnf
new file mode 100644
index 00000000000..bb9c8e84f1b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.cnf
@@ -0,0 +1,18 @@
+!include ../galera_2nodes_as_slave.cnf
+
+[mysqld]
+log-bin=mysqld-bin
+log-slave-updates
+binlog-format=ROW
+wsrep_sst_method=rsync
+[mysqld.1]
+gtid-domain-id=1
+[mysqld.2]
+gtid-domain-id=2
+wsrep_gtid_mode=1
+wsrep_gtid_domain_id=2
+[mysqld.3]
+gtid-domain-id=2
+wsrep_gtid_mode=1
+wsrep_gtid_domain_id=2
+
diff --git a/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.test b/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.test
new file mode 100644
index 00000000000..3fe94ad16b7
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gtid_slave_sst_rsync.test
@@ -0,0 +1,207 @@
+#
+# Test Galera as a slave to a MariaDB master using GTIDs
+#
+# suite/galera/galera_2nodes_as_slave.cnf describes the setup of the nodes
+#
+# In addition to performing DDL and DML, we check that the gtid of the master is preserved inside the cluster
+#
+
+--source include/big_test.inc
+--source include/have_innodb.inc
+# As node #1 is not a Galera node, we connect to node #2 in order to run include/galera_cluster.inc
+--connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2
+--source include/galera_cluster.inc
+
+--echo #Connection 2
+--connection node_2
+--disable_query_log
+--eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_1,master_use_gtid=slave_pos;
+--enable_query_log
+START SLAVE;
+--sleep 1
+
+
+--echo #Connection 1
+--connection node_1
+CREATE TABLE t2 (f1 INTEGER PRIMARY KEY, f2 int unique) ENGINE=InnoDB;
+INSERT INTO t2 VALUES(1,11);
+INSERT INTO t2 VALUES(2,22);
+INSERT INTO t2 VALUES(3,33);
+
+SELECT @@global.gtid_binlog_state;
+--source include/save_master_gtid.inc
+
+--echo #Connection 2
+--connection node_2
+--source include/sync_with_master_gtid.inc
+SELECT @@global.gtid_binlog_state;
+
+INSERT INTO t2 VALUES(4,44);
+INSERT INTO t2 VALUES(5,55);
+INSERT INTO t2 VALUES(6,66);
+SELECT @@global.gtid_binlog_state;
+
+--echo #Connection 3
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME= 't2';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT COUNT(*) = 6 FROM t2;
+--source include/wait_condition.inc
+
+INSERT INTO t2 VALUES(7,77);
+INSERT INTO t2 VALUES(8,88);
+SELECT @@global.gtid_binlog_state;
+
+#Perform SST
+--echo #Connection 1
+--connection node_1
+CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_before');
+INSERT INTO t1 VALUES ('node1_committed_before');
+COMMIT;
+--source include/save_master_gtid.inc
+
+--echo #Connection 2
+--connection node_2
+--source include/sync_with_master_gtid.inc
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node2_committed_before');
+INSERT INTO t1 VALUES ('node2_committed_before');
+COMMIT;
+
+--echo #Connection 3
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME= 't1';
+--source include/wait_condition.inc
+--let $wait_condition = SELECT COUNT(*) = 4 FROM t1;
+--source include/wait_condition.inc
+--let $node_1= node_2
+--let $node_2= node_3
+--source include/auto_increment_offset_save.inc
+--echo Shutting down server ...
+--source include/shutdown_mysqld.inc
+
+
+--echo #Connection 2
+--connection node_2
+--let $wait_condition = SELECT VARIABLE_VALUE = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'
+--source include/wait_condition.inc
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node1_committed_during');
+INSERT INTO t1 VALUES ('node1_committed_during');
+COMMIT;
+
+--echo #Connection 3
+--connection node_3
+--echo Starting server ...
+--source include/start_mysqld.inc
+--source include/wait_until_ready.inc
+--source include/auto_increment_offset_restore.inc
+
+SET AUTOCOMMIT=OFF;
+START TRANSACTION;
+INSERT INTO t1 VALUES ('node3_committed_after');
+INSERT INTO t1 VALUES ('node3_committed_after');
+COMMIT;
+
+--echo #Connection 2
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 8 FROM t1;
+--source include/wait_condition.inc
+Select * from t1 order by f1;
+
+--echo #Connection 3
+--connection node_3
+Select * from t1 order by f1;
+
+#SST Done
+--sleep 1
+--echo #Connection 2
+--connection node_2
+SELECT @@global.gtid_binlog_state;
+
+--echo #Connection 3
+--connection node_3
+SELECT @@global.gtid_binlog_state;
+
+--echo #Connection 1
+--connection node_1
+SET AUTOCOMMIT=ON;
+#drop table t1;
+#CREATE TABLE t1 (f1 CHAR(255)) ENGINE=InnoDB;
+
+--echo #Connection 2
+--connection node_2
+SET AUTOCOMMIT=ON;
+--echo #Connection 3
+--connection node_3
+SET AUTOCOMMIT=ON;
+
+#
+#stop slave on node 2
+--echo #Connection 2
+--connection node_2
+STOP slave;
+--sleep 1
+INSERT INTO t1 VALUES ('node2_slave_stoped');
+
+--echo #Connection 1
+--connection node_1
+INSERT INTO t1 VALUES ('node1_normal_entry');
+--source include/save_master_gtid.inc
+
+#start slave
+--echo #Connection 2
+--connection node_2
+INSERT INTO t1 VALUES ('node2_slave_stoped_inserted');
+start slave;
+--source include/sync_with_master_gtid.inc
+INSERT INTO t1 VALUES ('node2_slave_started');
+SELECT count(*) from t1;
+SELECT @@global.gtid_binlog_state;
+
+--echo #Connection 3
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 12 FROM t1;
+--source include/wait_condition.inc
+SELECT count(*) from t1;
+SELECT @@global.gtid_binlog_state;
+
+--echo #Connection 1
+--connection node_1
+DROP TABLE t2,t1;
+
+# Unfortunately without the sleep below the following statement fails with "query returned no rows", which
+# is difficult to understand given that it is an aggregate query. A "query execution was interrupted"
+# warning is also reported by MTR, which is also weird.
+#
+
+--sleep 3
+
+--echo #Connection 2
+--connection node_2
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't2';
+--source include/wait_condition.inc
+
+--echo #Connection 3
+--connection node_3
+--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1';
+--source include/wait_condition.inc
+
+--echo #Connection 2
+--connection node_2
+STOP SLAVE;
+RESET SLAVE ALL;
+reset master;
+
+--echo #Connection 3
+--connection node_3
+reset master;
+
+--echo #Connection 1
+--connection node_1
+reset master;
diff --git a/mysql-test/suite/galera/t/query_cache.test b/mysql-test/suite/galera/t/query_cache.test
index e024b308fab..13b21eca6e7 100644
--- a/mysql-test/suite/galera/t/query_cache.test
+++ b/mysql-test/suite/galera/t/query_cache.test
@@ -448,6 +448,7 @@ select * from t1;
select * from t1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
+show status like "Qcache_inserts";
insert delayed into t1 values (4);
--sleep 5 # Wait for insert delayed to be executed.
select a from t1;
@@ -474,6 +475,7 @@ show status like "Qcache_hits";
--connection node_1
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
+show status like "Qcache_inserts";
#
# Test of min result data unit size changing
@@ -497,8 +499,9 @@ select * from t1;
select * from t1;
select * from t2;
select * from t2;
-show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+show status like "Qcache_inserts";
--echo # On node-2
--connection node_2
@@ -506,13 +509,14 @@ select * from t1;
select * from t1;
select * from t2;
select * from t2;
-show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
drop table t1;
select a from t2;
select a from t2;
-show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+show status like "Qcache_inserts";
set GLOBAL query_cache_min_res_unit=default;
show global variables like "query_cache_min_res_unit";
@@ -520,8 +524,9 @@ show global variables like "query_cache_min_res_unit";
--connection node_1
select a from t2;
select a from t2;
-show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+show status like "Qcache_inserts";
drop table t2;
set GLOBAL query_cache_min_res_unit=default;
show global variables like "query_cache_min_res_unit";
@@ -537,6 +542,7 @@ select "aaa" from t1;
select "AAA" from t1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
+show status like "Qcache_inserts";
--echo # On node-2
--connection node_2
@@ -544,6 +550,7 @@ select "aaa" from t1;
select "AAA" from t1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
+show status like "Qcache_inserts";
drop table t1;
#
@@ -728,9 +735,9 @@ select count(*) from t1;
drop table t1;
-#
-# INTO OUTFILE/DUMPFILE test
-#
+--echo #
+--echo # INTO OUTFILE/DUMPFILE test
+--echo #
--echo # On node-1
--connection node_1
create table t1 (a int) engine=innodb;
@@ -743,14 +750,15 @@ select * from t1 into outfile "query_cache.out.file";
select * from t1 limit 1 into dumpfile "query_cache.dump.file";
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
+show status like "Qcache_inserts";
drop table t1;
let $datadir=`select @@datadir`;
--remove_file $datadir/test/query_cache.dump.file
--remove_file $datadir/test/query_cache.out.file
-#
-# Test of SQL_SELECT_LIMIT
-#
+--echo #
+--echo # Test of SQL_SELECT_LIMIT
+--echo #
--echo # On node-1
--connection node_1
create table t1 (a int) engine=innodb;
@@ -762,6 +770,7 @@ SET SQL_SELECT_LIMIT=1;
select * from t1;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
+show status like "Qcache_inserts";
SET SQL_SELECT_LIMIT=DEFAULT;
--echo # On node-2
@@ -777,9 +786,9 @@ SET SQL_SELECT_LIMIT=DEFAULT;
drop table t1;
-#
-# WRITE LOCK & QC
-#
+--echo #
+--echo # WRITE LOCK & QC
+--echo #
--echo # On node-1
--connection node_1
create table t1 (a int not null) engine=innodb;
@@ -791,6 +800,7 @@ select * from t1;
select * from t2;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
+show status like "Qcache_inserts";
lock table t1 write, t2 read;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
@@ -802,6 +812,7 @@ show status like "Qcache_hits";
lock table v1 write;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
+show status like "Qcache_inserts";
unlock table;
drop view v1;
set query_cache_wlock_invalidate=default;
@@ -825,15 +836,16 @@ show status like "Qcache_hits";
lock table v1 write;
show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
+show status like "Qcache_inserts";
unlock table;
drop view v1;
set query_cache_wlock_invalidate=default;
drop table t1,t2;
-#
-# Hiding real table stored in query cache by temporary table
-#
+--echo #
+--echo # Hiding real table stored in query cache by temporary table
+--echo #
--echo # On node-1
--connection node_1
create table t1 (id int primary key) engine=innodb;
@@ -866,66 +878,76 @@ INSERT INTO t1 VALUES (_koi8r 0xc3),(_koi8r 0xc3);
# Run select
#
SELECT a,'Â','â'='Â' FROM t1;
-show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+show status like "Qcache_inserts";
#
# Change collation_connection and run the same query again
#
set collation_connection=koi8r_bin;
SELECT a,'Â','â'='Â' FROM t1;
-show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+show status like "Qcache_inserts";
#
# Now change character_set_client and run the same query again
#
set character_set_client=cp1251;
SELECT a,'Â','â'='Â' FROM t1;
-show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+show status like "Qcache_inserts";
#
# And finally change character_set_results and run the same query again
#
set character_set_results=cp1251;
SELECT a,'Â','â'='Â' FROM t1;
-show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+show status like "Qcache_inserts";
SET NAMES default;
--echo # On node-2
--connection node_2
-#
-# Run select
-#
+
+--echo #
+--echo # Run select
+--echo #
+
SELECT a,'Â','â'='Â' FROM t1;
-show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
#
# Change collation_connection and run the same query again
#
set collation_connection=koi8r_bin;
SELECT a,'Â','â'='Â' FROM t1;
-show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+show status like "Qcache_inserts";
#
# Now change character_set_client and run the same query again
#
set character_set_client=cp1251;
SELECT a,'Â','â'='Â' FROM t1;
-show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+show status like "Qcache_inserts";
#
# And finally change character_set_results and run the same query again
#
set character_set_results=cp1251;
SELECT a,'Â','â'='Â' FROM t1;
-show status like "Qcache_hits";
show status like "Qcache_queries_in_cache";
+show status like "Qcache_hits";
+show status like "Qcache_inserts";
drop table t1;
-#
-# Comments before command
-#
+--echo #
+--echo # Comments before command
+--echo #
+
--echo # On node-1
--connection node_1
create table t1 (a int) engine=innodb;
@@ -951,9 +973,10 @@ show status like "Qcache_hits";
drop table t1;
-#
-# Information schema & query cache test
-#
+--echo #
+--echo # Information schema & query cache test
+--echo #
+
--echo # On node-1
--connection node_1
set session query_cache_type = 2;
diff --git a/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf b/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf
new file mode 100644
index 00000000000..3f39b82f7b7
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/galera_2x3nodes.cnf
@@ -0,0 +1,122 @@
+# Use default setting for mysqld processes
+!include include/default_mysqld.cnf
+
+[mysqld]
+log-bin
+log-slave-updates
+binlog-format=row
+innodb-autoinc-lock-mode=2
+default-storage-engine=innodb
+wsrep_gtid_mode=1
+gtid_ignore_duplicates
+
+wsrep-on=1
+wsrep-provider=@ENV.WSREP_PROVIDER
+wsrep_node_address=127.0.0.1
+# enforce read-committed characteristics across the cluster
+# wsrep-causal-reads=ON
+# wsrep-sync-wait=15
+
+[mysqld.1]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep-cluster-address='gcomm://'
+wsrep_provider_options='base_port=@mysqld.1.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
+
+wsrep_sst_receive_address=127.0.0.2:@mysqld.1.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.1.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.1.#sst_port'
+
+[mysqld.2]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
+wsrep_provider_options='base_port=@mysqld.2.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
+
+wsrep_sst_receive_address=127.0.0.2:@mysqld.2.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.2.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.2.#sst_port'
+
+[mysqld.3]
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.1.#galera_port'
+wsrep_provider_options='base_port=@mysqld.3.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
+
+wsrep_sst_receive_address=127.0.0.2:@mysqld.3.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.3.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.3.#sst_port'
+
+
+[mysqld.4]
+wsrep_cluster_name=cluster2
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+
+wsrep-cluster-address='gcomm://'
+wsrep_provider_options='base_port=@mysqld.4.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
+
+wsrep_sst_receive_address=127.0.0.2:@mysqld.4.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.4.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.4.#sst_port'
+
+[mysqld.5]
+wsrep_cluster_name=cluster2
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.4.#galera_port'
+wsrep_provider_options='base_port=@mysqld.5.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
+
+wsrep_sst_receive_address=127.0.0.2:@mysqld.5.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.5.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.5.#sst_port'
+
+[mysqld.6]
+wsrep_cluster_name=cluster2
+#galera_port=@OPT.port
+#ist_port=@OPT.port
+#sst_port=@OPT.port
+wsrep_cluster_address='gcomm://127.0.0.1:@mysqld.4.#galera_port'
+wsrep_provider_options='base_port=@mysqld.6.#galera_port;evs.suspect_timeout=PT300S;evs.inactive_timeout=PT1000M;evs.install_timeout=PT155S;evs.keepalive_period = PT100S'
+
+wsrep_sst_receive_address=127.0.0.2:@mysqld.6.#sst_port
+wsrep_node_incoming_address=127.0.0.1:@mysqld.6.port
+wsrep_sst_receive_address='127.0.0.1:@mysqld.6.#sst_port'
+
+[ENV]
+NODE_MYPORT_1= @mysqld.1.port
+NODE_MYSOCK_1= @mysqld.1.socket
+
+NODE_MYPORT_2= @mysqld.2.port
+NODE_MYSOCK_2= @mysqld.2.socket
+
+NODE_MYPORT_3= @mysqld.3.port
+NODE_MYSOCK_3= @mysqld.3.socket
+
+NODE_MYPORT_4= @mysqld.4.port
+NODE_MYSOCK_4= @mysqld.4.socket
+
+NODE_MYPORT_5= @mysqld.5.port
+NODE_MYSOCK_5= @mysqld.5.socket
+
+NODE_MYPORT_6= @mysqld.6.port
+NODE_MYSOCK_6= @mysqld.6.socket
+
+NODE_GALERAPORT_1= @mysqld.1.#galera_port
+NODE_GALERAPORT_2= @mysqld.2.#galera_port
+NODE_GALERAPORT_3= @mysqld.3.#galera_port
+NODE_GALERAPORT_4= @mysqld.4.#galera_port
+NODE_GALERAPORT_5= @mysqld.5.#galera_port
+NODE_GALERAPORT_6= @mysqld.6.#galera_port
+
+NODE_SSTPORT_1= @mysqld.1.#sst_port
+NODE_SSTPORT_2= @mysqld.2.#sst_port
+NODE_SSTPORT_3= @mysqld.3.#sst_port
+NODE_SSTPORT_4= @mysqld.4.#sst_port
+NODE_SSTPORT_5= @mysqld.5.#sst_port
+NODE_SSTPORT_6= @mysqld.6.#sst_port
diff --git a/mysql-test/suite/galera_3nodes/r/galera_gtid_2_cluster.result b/mysql-test/suite/galera_3nodes/r/galera_gtid_2_cluster.result
new file mode 100644
index 00000000000..35ca84119e7
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/r/galera_gtid_2_cluster.result
@@ -0,0 +1,231 @@
+cluster 1 node 1
+SHOW STATUS LIKE 'wsrep_cluster_size';
+Variable_name Value
+wsrep_cluster_size 3
+cluster 1 node 2
+SHOW STATUS LIKE 'wsrep_cluster_size';
+Variable_name Value
+wsrep_cluster_size 3
+cluster 1 node 3
+SHOW STATUS LIKE 'wsrep_cluster_size';
+Variable_name Value
+wsrep_cluster_size 3
+cluster 2 node 1
+SHOW STATUS LIKE 'wsrep_cluster_size';
+Variable_name Value
+wsrep_cluster_size 3
+cluster 2 node 2
+SHOW STATUS LIKE 'wsrep_cluster_size';
+Variable_name Value
+wsrep_cluster_size 3
+cluster 2 node 3
+SHOW STATUS LIKE 'wsrep_cluster_size';
+Variable_name Value
+wsrep_cluster_size 3
+change master to master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_4, master_use_gtid=current_pos, ignore_server_ids=(12,13);;
+start slave;
+include/wait_for_slave_to_start.inc
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+
+select @@gtid_slave_pos;
+@@gtid_slave_pos
+
+change master to master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_1, master_use_gtid=current_pos, ignore_server_ids=(22,23);;
+start slave;
+include/wait_for_slave_to_start.inc
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+
+select @@gtid_slave_pos;
+@@gtid_slave_pos
+
+cluster 1 node 1
+create table t1 (cluster_domain_id int ,node_server_id int, seq_no int);
+insert into t1 values (1, 11, 2);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-11-2
+#wait for sync cluster 1 and 2
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+cluster 2 node 1
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-11-2
+insert into t1 values (2, 21, 1);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-11-2,2-21-1
+select * from t1;
+cluster_domain_id node_server_id seq_no
+1 11 2
+2 21 1
+#wait for sync cluster 1 and 2
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+cluster 1 node 2
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-11-2,2-21-1
+insert into t1 values (1, 12, 3);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-11-2,1-12-3,2-21-1
+#wait for sync cluster 1 and 2
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+cluster 1 node 3
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-11-2,1-12-3,2-21-1
+insert into t1 values (1, 13, 4);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-12-3,1-11-2,1-13-4,2-21-1
+#wait for sync cluster 1 and 2
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+cluster 2 node 2
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-12-3,1-11-2,1-13-4,2-21-1
+insert into t1 values (2, 22, 2);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-12-3,1-11-2,1-13-4,2-21-1,2-22-2
+#wait for sync cluster 2 and 1
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+cluster 2 node 3
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-12-3,1-11-2,1-13-4,2-21-1,2-22-2
+insert into t1 values (2, 23, 3);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-12-3,1-11-2,1-13-4,2-21-1,2-22-2,2-23-3
+#wait for sync cluster 2 and 1
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+cluster 1 node 1
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-12-3,1-11-2,1-13-4,2-21-1,2-22-2,2-23-3
+drop table t1;
+stop slave;
+reset slave;
+change master to master_use_gtid=no, ignore_server_ids=();
+reset master;
+set global GTID_SLAVE_POS="";
+cluster 2 node 1
+stop slave;
+reset slave;
+change master to master_use_gtid=no, ignore_server_ids=();
+reset master;
+set global GTID_SLAVE_POS="";
+reset master;
+reset master;
+reset master;
+reset master;
+change master to master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_6, master_use_gtid=current_pos, ignore_server_ids=(12,13);;
+start slave;
+include/wait_for_slave_to_start.inc
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+
+select @@gtid_slave_pos;
+@@gtid_slave_pos
+
+change master to master_host='127.0.0.1', master_user='root', master_port=NODE_MYPORT_3, master_use_gtid=current_pos, ignore_server_ids=(22,23);;
+start slave;
+include/wait_for_slave_to_start.inc
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+
+select @@gtid_slave_pos;
+@@gtid_slave_pos
+
+cluster 1 node 1
+create table t1 (cluster_domain_id int ,node_server_id int, seq_no int);
+insert into t1 values (1, 11, 2);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-11-2
+#wait for sync cluster 1 and 2
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+cluster 2 node 1
+insert into t1 values (2, 21, 1);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-11-2,2-21-1
+select * from t1;
+cluster_domain_id node_server_id seq_no
+1 11 2
+2 21 1
+#wait for sync cluster 1 and 2
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+cluster 1 node 2
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-11-2,2-21-1
+insert into t1 values (1, 12, 3);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-11-2,1-12-3,2-21-1
+#wait for sync cluster 1 and 2
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+cluster 1 node 3
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-11-2,1-12-3,2-21-1
+insert into t1 values (1, 13, 4);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-12-3,1-11-2,1-13-4,2-21-1
+#wait for sync cluster 1 and 2
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+cluster 2 node 2
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-12-3,1-11-2,1-13-4,2-21-1
+insert into t1 values (2, 22, 2);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-12-3,1-11-2,1-13-4,2-21-1,2-22-2
+#wait for sync cluster 2 and 1
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+cluster 2 node 3
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-12-3,1-11-2,1-13-4,2-21-1,2-22-2
+insert into t1 values (2, 23, 3);
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-12-3,1-11-2,1-13-4,2-21-1,2-22-2,2-23-3
+#wait for sync cluster 2 and 1
+include/save_master_gtid.inc
+include/sync_with_master_gtid.inc
+cluster 1 node 1
+select @@gtid_binlog_state;
+@@gtid_binlog_state
+1-12-3,1-11-2,1-13-4,2-21-1,2-22-2,2-23-3
+drop table t1;
+stop slave;
+change master to master_use_gtid=no, ignore_server_ids=();
+reset master;
+set global GTID_SLAVE_POS="";
+cluster 2 node 1
+stop slave;
+change master to master_use_gtid=no, ignore_server_ids=();
+reset master;
+set global GTID_SLAVE_POS="";
+reset master;
+reset master;
+reset master;
+reset master;
diff --git a/mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.cnf b/mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.cnf
new file mode 100644
index 00000000000..dc5535ef34a
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.cnf
@@ -0,0 +1,28 @@
+# We need a dedicated .cnf file, even if empty, in order to force this test to run
+# alone on a freshly started cluster. Otherwise there are adverse interactions with
+# following tests such as galera_3nodes.galera_var_dirty_reads2
+
+!include ../galera_2x3nodes.cnf
+[mysqld.1]
+wsrep_gtid_domain_id=1
+server-id=11
+
+[mysqld.2]
+wsrep_gtid_domain_id=1
+server-id=12
+
+[mysqld.3]
+wsrep_gtid_domain_id=1
+server-id=13
+
+[mysqld.4]
+wsrep_gtid_domain_id=2
+server-id=21
+
+[mysqld.5]
+wsrep_gtid_domain_id=2
+server-id=22
+
+[mysqld.6]
+wsrep_gtid_domain_id=2
+server-id=23
diff --git a/mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.test b/mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.test
new file mode 100644
index 00000000000..c679db1305d
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_gtid_2_cluster.test
@@ -0,0 +1,292 @@
+#
+# This test creates 2x 3 nodes galera cluster.
+# The whole test case
+# A <-> B <-> C {Galera cluster 1}
+# | {Circular Async replication}
+# D <-> E <-> F {Galera cluster 2}
+# We will write on any random node to see if gtid is consitent or not
+# Then we will kill node D and set up the replication between A and E
+# To see whether fail over works or not.
+
+--source include/big_test.inc
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--connection node_1
+--echo cluster 1 node 1
+SHOW STATUS LIKE 'wsrep_cluster_size';
+
+--connection node_2
+--echo cluster 1 node 2
+SHOW STATUS LIKE 'wsrep_cluster_size';
+
+--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
+--connection node_3
+--echo cluster 1 node 3
+SHOW STATUS LIKE 'wsrep_cluster_size';
+
+--connect node_4, 127.0.0.1, root, , test, $NODE_MYPORT_4
+--connection node_4
+--echo cluster 2 node 1
+SHOW STATUS LIKE 'wsrep_cluster_size';
+
+--connect node_5, 127.0.0.1, root, , test, $NODE_MYPORT_5
+--connection node_5
+--echo cluster 2 node 2
+SHOW STATUS LIKE 'wsrep_cluster_size';
+
+--connect node_6, 127.0.0.1, root, , test, $NODE_MYPORT_6
+--connection node_6
+--echo cluster 2 node 3
+SHOW STATUS LIKE 'wsrep_cluster_size';
+#--disable_parsing
+--connection node_1
+--replace_result $NODE_MYPORT_4 NODE_MYPORT_4
+--eval change master to master_host='127.0.0.1', master_user='root', master_port=$NODE_MYPORT_4, master_use_gtid=current_pos, ignore_server_ids=(12,13);
+start slave;
+--source include/wait_for_slave_to_start.inc
+select @@gtid_binlog_state;
+select @@gtid_slave_pos;
+#--query_vertical SHOW SLAVE STATUS;
+
+--connection node_4
+--replace_result $NODE_MYPORT_1 NODE_MYPORT_1
+--eval change master to master_host='127.0.0.1', master_user='root', master_port=$NODE_MYPORT_1, master_use_gtid=current_pos, ignore_server_ids=(22,23);
+start slave;
+--source include/wait_for_slave_to_start.inc
+select @@gtid_binlog_state;
+select @@gtid_slave_pos;
+#--query_vertical SHOW SLAVE STATUS;
+
+--echo cluster 1 node 1
+--connection node_1
+create table t1 (cluster_domain_id int ,node_server_id int, seq_no int);
+insert into t1 values (1, 11, 2);
+select @@gtid_binlog_state;
+
+--echo #wait for sync cluster 1 and 2
+--connection node_1
+--source include/save_master_gtid.inc
+--connection node_4
+--source include/sync_with_master_gtid.inc
+
+--echo cluster 2 node 1
+--connection node_4
+select @@gtid_binlog_state;
+insert into t1 values (2, 21, 1);
+select @@gtid_binlog_state;
+select * from t1;
+--echo #wait for sync cluster 1 and 2
+--connection node_1
+--source include/save_master_gtid.inc
+--connection node_4
+--source include/sync_with_master_gtid.inc
+
+
+--echo cluster 1 node 2
+--connection node_2
+select @@gtid_binlog_state;
+insert into t1 values (1, 12, 3);
+select @@gtid_binlog_state;
+
+--echo #wait for sync cluster 1 and 2
+--connection node_1
+--source include/save_master_gtid.inc
+--connection node_4
+--source include/sync_with_master_gtid.inc
+
+--echo cluster 1 node 3
+--connection node_3
+select @@gtid_binlog_state;
+insert into t1 values (1, 13, 4);
+select @@gtid_binlog_state;
+
+--echo #wait for sync cluster 1 and 2
+--connection node_1
+--source include/save_master_gtid.inc
+--connection node_4
+--source include/sync_with_master_gtid.inc
+
+--echo cluster 2 node 2
+--connection node_5
+select @@gtid_binlog_state;
+insert into t1 values (2, 22, 2);
+select @@gtid_binlog_state;
+
+--echo #wait for sync cluster 2 and 1
+--connection node_4
+--source include/save_master_gtid.inc
+--connection node_1
+--source include/sync_with_master_gtid.inc
+
+--echo cluster 2 node 3
+--connection node_6
+select @@gtid_binlog_state;
+insert into t1 values (2, 23, 3);
+select @@gtid_binlog_state;
+
+--echo #wait for sync cluster 2 and 1
+--connection node_4
+--source include/save_master_gtid.inc
+--connection node_1
+--source include/sync_with_master_gtid.inc
+
+
+--echo cluster 1 node 1
+--connection node_1
+select @@gtid_binlog_state;
+drop table t1;
+stop slave;
+reset slave;
+change master to master_use_gtid=no, ignore_server_ids=();
+reset master;
+set global GTID_SLAVE_POS="";
+--sleep 2
+
+--echo cluster 2 node 1
+--connection node_4
+stop slave;
+reset slave;
+change master to master_use_gtid=no, ignore_server_ids=();
+reset master;
+set global GTID_SLAVE_POS="";
+
+--connection node_2
+reset master;
+--connection node_3
+reset master;
+--connection node_5
+reset master;
+--connection node_6
+reset master;
+#--enable_parsing
+#
+# This test creates 2x 3 nodes galera cluster.
+# The whole test case
+# A <-> B <-> C {Galera cluster 1}
+# \ /
+# \ /
+# / {C->D, F->A , Async normal slave repl}
+# / \
+# | \
+# D <-> E <-> F {Galera cluster 2}
+# We will write on any random node to see if gtid is consitent or not
+# Then we will kill node D and set up the replication between A and E
+# To see whether fail over works or not.
+--connection node_1
+--replace_result $NODE_MYPORT_6 NODE_MYPORT_6
+--eval change master to master_host='127.0.0.1', master_user='root', master_port=$NODE_MYPORT_6, master_use_gtid=current_pos, ignore_server_ids=(12,13);
+start slave;
+--source include/wait_for_slave_to_start.inc
+select @@gtid_binlog_state;
+select @@gtid_slave_pos;
+#--query_vertical SHOW SLAVE STATUS;
+
+--connection node_4
+--replace_result $NODE_MYPORT_3 NODE_MYPORT_3
+--eval change master to master_host='127.0.0.1', master_user='root', master_port=$NODE_MYPORT_3, master_use_gtid=current_pos, ignore_server_ids=(22,23);
+start slave;
+--source include/wait_for_slave_to_start.inc
+select @@gtid_binlog_state;
+select @@gtid_slave_pos;
+#--query_vertical SHOW SLAVE STATUS;
+
+--echo cluster 1 node 1
+--connection node_1
+create table t1 (cluster_domain_id int ,node_server_id int, seq_no int);
+insert into t1 values (1, 11, 2);
+
+select @@gtid_binlog_state;
+
+--echo #wait for sync cluster 1 and 2
+--connection node_1
+--source include/save_master_gtid.inc
+--connection node_4
+--source include/sync_with_master_gtid.inc
+--sleep 2
+--echo cluster 2 node 1
+--connection node_4
+insert into t1 values (2, 21, 1);
+select @@gtid_binlog_state;
+select * from t1;
+
+--echo #wait for sync cluster 1 and 2
+--connection node_1
+--source include/save_master_gtid.inc
+--connection node_4
+--source include/sync_with_master_gtid.inc
+
+
+--echo cluster 1 node 2
+--connection node_2
+select @@gtid_binlog_state;
+insert into t1 values (1, 12, 3);
+select @@gtid_binlog_state;
+
+--echo #wait for sync cluster 1 and 2
+--connection node_1
+--source include/save_master_gtid.inc
+--connection node_4
+--source include/sync_with_master_gtid.inc
+
+--echo cluster 1 node 3
+--connection node_3
+select @@gtid_binlog_state;
+insert into t1 values (1, 13, 4);
+select @@gtid_binlog_state;
+
+--echo #wait for sync cluster 1 and 2
+--connection node_1
+--source include/save_master_gtid.inc
+--connection node_4
+--source include/sync_with_master_gtid.inc
+
+--echo cluster 2 node 2
+--connection node_5
+select @@gtid_binlog_state;
+insert into t1 values (2, 22, 2);
+select @@gtid_binlog_state;
+
+--echo #wait for sync cluster 2 and 1
+--connection node_4
+--source include/save_master_gtid.inc
+--connection node_1
+--source include/sync_with_master_gtid.inc
+
+--echo cluster 2 node 3
+--connection node_6
+select @@gtid_binlog_state;
+insert into t1 values (2, 23, 3);
+select @@gtid_binlog_state;
+
+--echo #wait for sync cluster 2 and 1
+--connection node_4
+--source include/save_master_gtid.inc
+--connection node_1
+--source include/sync_with_master_gtid.inc
+
+
+--echo cluster 1 node 1
+--connection node_1
+select @@gtid_binlog_state;
+drop table t1;
+stop slave;
+change master to master_use_gtid=no, ignore_server_ids=();
+reset master;
+set global GTID_SLAVE_POS="";
+
+--echo cluster 2 node 1
+--connection node_4
+stop slave;
+change master to master_use_gtid=no, ignore_server_ids=();
+reset master;
+set global GTID_SLAVE_POS="";
+
+--connection node_2
+reset master;
+--connection node_3
+reset master;
+--connection node_5
+reset master;
+--connection node_6
+reset master;
diff --git a/mysql-test/suite/gcol/disabled.def b/mysql-test/suite/gcol/disabled.def
deleted file mode 100644
index 37209a4c353..00000000000
--- a/mysql-test/suite/gcol/disabled.def
+++ /dev/null
@@ -1 +0,0 @@
-innodb_virtual_debug_purge : MDEV-13568 should purge yield to LOCK TABLES?
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result b/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result
index 65a2f5c844f..1613e8ac9af 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_debug_purge.result
@@ -143,20 +143,15 @@ connect prevent_purge, localhost, root;
start transaction with consistent snapshot;
connection default;
update t set a = repeat('m', 16000) where a like "aaa%";
-connect con1, localhost, root;
+connect lock_table, localhost, root;
lock table t write;
disconnect prevent_purge;
connection default;
-select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age';
-variable_value>1
-0
-disconnect con1;
+InnoDB 0 transactions not purged
+disconnect lock_table;
start transaction with consistent snapshot;
commit;
InnoDB 0 transactions not purged
-select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age';
-variable_value>1
-0
set global debug_dbug=@old_dbug;
drop table t;
set debug_sync=reset;
diff --git a/mysql-test/suite/gcol/r/innodb_virtual_index.result b/mysql-test/suite/gcol/r/innodb_virtual_index.result
index 375c62bd173..b1f7976c6c0 100644
--- a/mysql-test/suite/gcol/r/innodb_virtual_index.result
+++ b/mysql-test/suite/gcol/r/innodb_virtual_index.result
@@ -1,3 +1,5 @@
+SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
+SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
#
# Bug 21922176 - PREBUILT->SEARCH_TUPLE CREATED WITHOUT INCLUDING
# THE NUMBER OF VIRTUAL COLUMNS
@@ -86,6 +88,7 @@ DISTINCT I1.c14 AS y
FROM t1 AS I1
ORDER BY I1.c14);
SET @@SESSION.sql_mode=default;
+InnoDB 0 transactions not purged
DROP TABLE t1, t2, t3;
#
# Bug 22650296 - ASSERTION IN INNOBASE_BUILD_COL_MAP, ALTER
@@ -194,3 +197,4 @@ ALTER TABLE t1 ADD COLUMN col7a INT GENERATED ALWAYS AS (col1 % col2)
VIRTUAL, ADD UNIQUE index idx (col1), algorithm=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported. Reason: INPLACE ADD or DROP of virtual columns cannot be combined with other ALTER TABLE actions. Try ALGORITHM=COPY
DROP TABLE t1;
+SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test b/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test
index 2668e26c976..1862de268af 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_debug_purge.test
@@ -182,16 +182,15 @@ connect(prevent_purge, localhost, root);
start transaction with consistent snapshot;
connection default;
update t set a = repeat('m', 16000) where a like "aaa%";
-connect(con1, localhost, root);
+connect(lock_table, localhost, root);
lock table t write;
disconnect prevent_purge;
connection default;
-select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age';
-disconnect con1;
+--source ../../innodb/include/wait_all_purged.inc
+disconnect lock_table;
start transaction with consistent snapshot;
commit;
--source ../../innodb/include/wait_all_purged.inc
-select variable_value>1 from information_schema.global_status where variable_name='innodb_purge_trx_id_age';
set global debug_dbug=@old_dbug;
drop table t;
diff --git a/mysql-test/suite/gcol/t/innodb_virtual_index.test b/mysql-test/suite/gcol/t/innodb_virtual_index.test
index 4c4cb2a2d05..432faeb65ae 100644
--- a/mysql-test/suite/gcol/t/innodb_virtual_index.test
+++ b/mysql-test/suite/gcol/t/innodb_virtual_index.test
@@ -1,5 +1,9 @@
--source include/have_innodb.inc
+# Ensure that the history list length will actually be decremented by purge.
+SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
+SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
+
--echo #
--echo # Bug 21922176 - PREBUILT->SEARCH_TUPLE CREATED WITHOUT INCLUDING
--echo # THE NUMBER OF VIRTUAL COLUMNS
@@ -96,6 +100,7 @@ FROM t1 AS I1
ORDER BY I1.c14);
SET @@SESSION.sql_mode=default;
+--source ../../innodb/include/wait_all_purged.inc
DROP TABLE t1, t2, t3;
@@ -218,3 +223,4 @@ ALTER TABLE t1 ADD COLUMN col7a INT GENERATED ALWAYS AS (col1 % col2)
VIRTUAL, ADD UNIQUE index idx (col1), algorithm=inplace;
DROP TABLE t1;
+SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
diff --git a/mysql-test/suite/innodb/r/innodb-autoinc.result b/mysql-test/suite/innodb/r/innodb-autoinc.result
index 1d61079dbd8..ee1adc07661 100644
--- a/mysql-test/suite/innodb/r/innodb-autoinc.result
+++ b/mysql-test/suite/innodb/r/innodb-autoinc.result
@@ -1363,3 +1363,9 @@ SELECT * FROM t1;
c1
1e19
DROP TABLE t1;
+CREATE TABLE t1 (a DOUBLE PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (-1);
+SELECT * FROM t1;
+a
+-1
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb-index-debug.result b/mysql-test/suite/innodb/r/innodb-index-debug.result
index beab075f3c8..1d0d5268fa9 100644
--- a/mysql-test/suite/innodb/r/innodb-index-debug.result
+++ b/mysql-test/suite/innodb/r/innodb-index-debug.result
@@ -112,6 +112,35 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB AUTO_INCREMENT=1023 DEFAULT CHARSET=latin1
drop table t1;
drop table t480;
+#
+# MDEV-12827 Assertion failure when reporting duplicate key error
+# in online table rebuild
+#
+CREATE TABLE t1 (j INT UNIQUE, i INT UNIQUE) ENGINE=InnoDB;
+connect con1,localhost,root,,test;
+SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL built WAIT_FOR log';
+ALTER TABLE t1 DROP j, FORCE;
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR built';
+INSERT INTO t1 (i) VALUES (0),(0);
+ERROR 23000: Duplicate entry '0' for key 'i'
+SET DEBUG_SYNC='now SIGNAL log';
+connection con1;
+ERROR 23000: Duplicate entry '0' for key 'i'
+SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL built2 WAIT_FOR log2';
+ALTER TABLE t1 DROP j, FORCE;
+connection default;
+SET DEBUG_SYNC='now WAIT_FOR built2';
+INSERT INTO t1 (i) VALUES (0),(1);
+UPDATE t1 SET i=0;
+ERROR 23000: Duplicate entry '0' for key 'i'
+SET DEBUG_SYNC='now SIGNAL log2';
+connection con1;
+ERROR 23000: Duplicate entry '0' for key 'i'
+disconnect con1;
+connection default;
+SET DEBUG_SYNC='RESET';
+DROP TABLE t1;
SET DEBUG_SYNC='RESET';
#
# BUG#21612714 ALTER TABLE SORTING SKIPPED WHEN CHANGE PK AND DROP
diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result
index edac0d0ab69..f19929f8e17 100644
--- a/mysql-test/suite/innodb/r/innodb.result
+++ b/mysql-test/suite/innodb/r/innodb.result
@@ -3299,3 +3299,83 @@ show status like "handler_read_key";
Variable_name Value
Handler_read_key 0
drop table t1;
+CREATE TABLE t1 (c1 INT) ENGINE=InnoDB;
+CREATE TEMPORARY TABLE t2 (c1 INT) ENGINE=InnoDB;
+START TRANSACTION READ ONLY;
+INSERT INTO t2 VALUES(0);
+INSERT INTO t1 VALUES(0);
+ERROR 25006: Cannot execute statement in a READ ONLY transaction
+ROLLBACK;
+SELECT * FROM t1;
+c1
+SELECT * FROM t2;
+c1
+START TRANSACTION READ ONLY;
+INSERT INTO t1 VALUES(0);
+ERROR 25006: Cannot execute statement in a READ ONLY transaction
+INSERT INTO t2 VALUES(1);
+COMMIT;
+SET TRANSACTION READ ONLY;
+START TRANSACTION;
+INSERT INTO t2 VALUES(3);
+INSERT INTO t1 VALUES(0);
+ERROR 25006: Cannot execute statement in a READ ONLY transaction
+COMMIT;
+SELECT * FROM t1;
+c1
+SELECT * FROM t2;
+c1
+1
+3
+DROP TABLE t2;
+CREATE TEMPORARY TABLE t2 (
+c1 INT AUTO_INCREMENT PRIMARY KEY,
+c2 INT, INDEX idx(c2)) ENGINE=InnoDB;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TEMPORARY TABLE `t2` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ `c2` int(11) DEFAULT NULL,
+ PRIMARY KEY (`c1`),
+ KEY `idx` (`c2`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+START TRANSACTION READ ONLY;
+INSERT INTO t2 VALUES(NULL,1),(NULL,2),(NULL,3);
+INSERT INTO t1 VALUES(0);
+ERROR 25006: Cannot execute statement in a READ ONLY transaction
+ROLLBACK;
+SELECT * FROM t1;
+c1
+SELECT * FROM t2;
+c1 c2
+START TRANSACTION READ ONLY;
+INSERT INTO t1 VALUES(0);
+ERROR 25006: Cannot execute statement in a READ ONLY transaction
+INSERT INTO t2 VALUES(NULL,1),(NULL,2),(NULL,3);
+COMMIT;
+SET TRANSACTION READ ONLY;
+START TRANSACTION;
+INSERT INTO t2 VALUES(NULL,1),(NULL,2),(NULL,3);
+INSERT INTO t1 VALUES(0);
+ERROR 25006: Cannot execute statement in a READ ONLY transaction
+COMMIT;
+SHOW CREATE TABLE t2;
+Table Create Table
+t2 CREATE TEMPORARY TABLE `t2` (
+ `c1` int(11) NOT NULL AUTO_INCREMENT,
+ `c2` int(11) DEFAULT NULL,
+ PRIMARY KEY (`c1`),
+ KEY `idx` (`c2`)
+) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1
+SELECT * FROM t1;
+c1
+SELECT * FROM t2;
+c1 c2
+4 1
+7 1
+5 2
+8 2
+6 3
+9 3
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/suite/innodb/r/purge_secondary.result b/mysql-test/suite/innodb/r/purge_secondary.result
new file mode 100644
index 00000000000..2312434a2bd
--- /dev/null
+++ b/mysql-test/suite/innodb/r/purge_secondary.result
@@ -0,0 +1,148 @@
+SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
+SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
+CREATE TABLE t1 (
+a SERIAL, b CHAR(255) NOT NULL DEFAULT '', c BOOLEAN DEFAULT false,
+l LINESTRING NOT NULL DEFAULT ST_linefromtext('linestring(448 -689,
+ 453 -684,451 -679,453 -677,458 -681,463 -681,468 -678,470 -676,470 -678,
+ 468 -675,472 -675,472 -675,474 -674,479 -676,477 -675,473 -676,475 1324,
+ 479 1319,484 1322,483 1323,486 1323,491 1328,492 1325,496 1325,498 1325,
+ 501 1330,498 1331,500 1331,504 1330,508 1329,512 1332,513 1337,518 1339,
+ 518 1339,513 1344,513 1344,512 1346,514 1351,515 1353,519 1358,518 1362,
+ 522 1365,525 1360,526 1362,527 1362,528 1367,525 1371,528 1366,532 1369,
+ 536 1374,539 1377,543 1379,539 1381,541 1382,543 1383,546 1388,549 1393,
+ 554 1393,554 1395,554 1392,550 1394,550 1392,546 1394,549 1397,550 1393,
+ 549 1394,554 1390,554 1391,549 1396,551 1396,547 1400,547 1402,551 1407,
+ 554 1412,554 1415,558 1418,463 -681,465 -677,465 -675,470 -670,470 -665,
+ 470 -660,470 -659,473 -656,476 -656,481 -655,482 -652,486 -654,486 -652,
+ 486 -648,491 -646,490 -651,494 -646,493 -644,493 -644,490 -644,491 2356,
+ 495 2359,495 2364,500 2359,503 5359,504 5364,509 5368,504 5367,499 5368,
+ 498 5371,498 5369,500 5370,504 5370,508 5370,511 5370,507 5374,508 5378,
+ 511 5382,507 5387,509 5389,512 5388,515 5393,520 5396,517 5397,517 5402,
+ 515 5404,520 5402,521 5405,525 5405,526 5408,530 7408,535 7413,533 7415,
+ 529 7412,532 7416,4532 7416,4534 7421,4533 7417,4536 7413,4536 7418,
+ 4540 3418,4545 3418,4549 3415,4551 3419,4554 3421,4559 3423,4559 3426,
+ 4557 3424,4561 3428,4558 3428,4563 3431,4565 3435,4569 3439,4569 3439,
+ 4569 3444,4567 3444,4572 3446,4577 3447,4581 3444,4581 3448,4584 3448,
+ 4579 3447,4580 3450,4583 3449,4583 3453,4587 3455,4588 3458,4593 3463,
+ 4598 3465,4601 3468,4598 3464,4598 3460,4593 5460,4595 5461,4600 5464,
+ 4600 5465,4601 5466,4606 5466,4608 5466,4605 5464,4608 5467,4607 5468,
+ 4609 5465,4614 5461,4618 5463,4621 5467,4623 5470,4622 5470,4622 5470,
+ 4625 6470,4627 6471,4627 6472,4627 6473,6627 6474,6625 6474,6628 6477,
+ 6633 6481,6633 6480,6637 6475,7637 6479,7638 6482,7643 6487,7644 6492,
+ 7647 6492,7648 6495,7646 6498,7650 6499,7646 6494,7644 6499,7644 6497,
+ 7644 6499,7647 6502,7649 6504,7650 6501,7647 6503,7649 6504,7650 6508,
+ 7651 6503,7652 6508,7655 6508,7650 6511,7655 6515,7658 6513,7663 6513,
+ 7665 6514,7669 6512,7667 6510,7664 6510,472 -675,477 -670,479 -666,
+ 482 -663,484 -668,484 -666,485 -664,481 -664,479 -659,482 -659,484 -658,
+ 483 -659,488 2341,493 2339,489 2338,491 2342,491 2346,494 2346,490 2348,
+ 493 2348,498 2349,498 2350,499 2349,502 2350,503 2348,506 2348,506 2348,
+ 507 2353,507 2355,504 2359,504 2364,504 2361,499 2365,502 2360,502 2358,
+ 503 2357,504 2353,504 2357,500 2356,497 2355,498 2355,500 2359,502 2361,
+ 505 2364,508 2364,506 2368,506 2370,504 2373,499 2373,496 2372,493 2377,
+ 497 2380,495 2383,496 7383,493 7386,497 7391,494 7387,495 7389,498 7392,
+ 498 7392,495 7395,493 7398,498 7401,498 7403,503 7400,498 8400,501 8401,
+ 503 8401,503 8401,501 10401,496 10396,491 10401,492 10399,493 10403,
+ 496 10403,491 10403,493 10407,489 10410,493 10407,489 10403,498 7403,
+ 497 7399,496 7403,500 7405,500 7407,503 7411,508 7415,511 7415,511 7420,
+ 515 7420,520 7423,523 7423,520 7427,523 7427,523 7427,522 7432,525 4432,
+ 527 4434,530 4437,534 4441,529 4446,529 4441,534 4436,537 4436,535 4437,
+ 532 4437,534 4432,535 4429,538 4430,542 4427,542 4431,538 4431,541 4431,
+ 541 4433,543 4433,545 4432,549 4428,552 4426,556 4427,557 4423,560 4427,
+ 561 4428,558 4430,559 4434,559 4432,561 4434,561 4437,563 4435,559 4430,
+ 561 4435,4561 4437,4566 4441,4568 4446,4568 4450,4569 4455,4565 4458,
+ 4561 4463,4561 9463,4564 9463,4565 9461,9565 9463,9560 9467,9560 9466,
+ 9555 9469,9555 9471,9559 9469,9557 9473,9553 9478,9555 9480,9557 9481,
+ 9557 9481,9557 9483,9562 9487,9558 9487,9558 9490,9561 9493,9562 9493,
+ 9557 9493,9560 9496,9555 9501,9553 9503,9553 9506,9557 9510,9558 9511,
+ 9561 9514,9563 9512,9568 9514,9567 9514,9567 13514,9570 13517,9566 13521,
+ 9571 13521,9571 13526,9573 13521,9571 13521,9576 10521,9580 10526,9582 10525,
+ 9584 10528,9584 10531,9584 10533,9589 10533,9588 10537,9588 10541,9589 10542,
+ 9593 10544,9595 10540,9597 10541,9600 10545,9601 15545,9603 15549,9605 15553,
+ 9601 15558,9601 15553,9605 15551,9605 15550,9605 15554,9607 15556,9605 15556,
+ 9604 15561,9607 15559,9603 15559,9603 15562,9604 15563,9608 15566,9612 15570,
+ 9617 15565,9622 15568,9627 15566,9628 15564,9629 15564,9633 15569,9636 15569,
+ 9634 15571,9634 15572,9636 15574,9634 15570,9629 15570,9631 15567,9629 15570,
+ 9626 15574,9626 15575,498 7401,502 7401,506 7397,506 7395,502 7398,497 7401,
+ 502 7402,505 7397,508 7400,504 7404,3504 7409,3505 7405,3508 7410,3511 7413,
+ 3511 7416,3511 7419,3511 7419,3513 7421,3517 7424,3519 7426,3520 11426,
+ 3523 11421,3527 11418,3530 11415,3530 11416,3533 11418,7533 11415,7531 11415,
+ 7531 11417,7536 11420,7541 11424,7543 11425,7543 11427,7543 11429,7540 11429,
+ 7542 11425,7541 11420,7542 11421,7542 11422,7540 11424,7540 11423,7543 11422,
+ 7546 11426,7550 11431,7553 11436,7555 16436,7553 16438,7558 16438,7559 16438,
+ 7560 16439,7565 16437,7560 16435,7563 16435,7566 16440,7566 16444,7564 16447,
+ 7559 16443,7561 16443,7566 16448,7570 16451,7574 16456,7578 16459,
+ 12578 16459,12578 20459,12577 20456,12581 20454,12585 20456,12585 20456,
+ 12585 20456,12583 20456,12579 20459,12580 20461,12580 20462,12580 20460,
+ 12585 20465,12586 20467,12590 20470,12590 20470,12589 20471,12584 20471,
+ 12589 20471,9589 20472,9594 20472,9595 20472,9596 20477,9598 20482,
+ 9603 20480,9608 20484,9613 20484,9610 20486,9608 20488,9608 20489,9610 20489,
+ 9614 20486,9619 20481,9620 20481,9618 21481,9621 21483,9626 21483,9628 21485,
+ 9623 21487,9622 21490,9626 21493,9621 21495,9626 21498,9622 21499,9624 21504,
+ 9625 21499,9629 21501,9633 21498,9637 21495,9639 21498,9644 21501,9557 9481,
+ 9560 9485,9561 9490,9563 9488,9560 9486,9558 9488,9561 9492,9563 9495,
+ 9567 9492,9567 9488,9564 9490,9559 9495,9559 9498,9557 9502,9562 9506,
+ 9564 9509,9569 9512,9569 9516,9569 9518,9569 9515,9571 9513,9571 9512,
+ 9573 9513,9578 9516,9581 9516,9585 11516,9585 11521,9590 10521,9586 10524,
+ 9589 10529,9589 10527,9589 10527,9594 10532,9594 10534,9598 10536,9598 10540,
+ 9600 10542,9604 10538,9607 10538,9609 10543,9613 10538,9613 10533,9613 10537,
+ 9610 10537,9614 10542,9609 10542,9610 10543,9610 10548,9611 10553,9616 7553,
+ 9620 7553,9621 7557,9618 7559,9618 7554,9622 7557,9622 7561,9622 7556,
+ 9622 7560,9619 7560,9620 7565,9622 7563,9627 7566,9630 7570,9630 7571,
+ 9632 7573,9637 7576,9639 7578,9640 7576,9640 7579,9640 7575,9642 7570,
+ 9646 7570,9651 7574,9653 7577,9652 7572,9653 7576,9653 7576,9651 7581,
+ 9656 7585,9660 7586,9659 7591,9657 7594,9661 7598,9664 7602,9668 12602,
+ 9673 12604,9676 12606,9679 12602,9682 12605,9677 12610,9674 12606,9674 12601,
+ 9674 12603,9672 9603,9668 9605,9671 9606,9668 9611,9668 9606,9671 9611,
+ 9675 9615,9677 9620,9678 9622,9679 9624,9684 9626,9685 9627,9685 9622,
+ 9685 9626,9689 9628,9694 9633,9699 9637,9699 9637,9704 9636,9708 9637,
+ 9709 9638,9707 9639,9705 9642,9707 9647,9710 9649,9711 9653,9716 9649,
+ 9716 9648,9720 9650,9721 9648,9723 9648,9726 4648,12726 4653,12731 4655,
+ 12734 4660,12730 4661,12733 4664,12733 4665,12735 4670,12737 4674,12741 4674,
+ 12738 4675,12740 4675,12737 4675,12742 4678,12743 4681,12746 4677)'),
+INDEX(b,c), SPATIAL INDEX(l)
+) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+INSERT INTO t1 () VALUES (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),();
+SELECT LENGTH(l) FROM t1;
+LENGTH(l)
+11197
+11197
+11197
+11197
+11197
+11197
+11197
+11197
+11197
+11197
+11197
+11197
+11197
+11197
+11197
+11197
+11197
+INSERT INTO t1 (a) SELECT NULL FROM t1;
+INSERT INTO t1 (a) SELECT NULL FROM t1;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+UPDATE t1 SET c=true, l=ST_linefromtext('linestring(0 0,1 1,2 2)');
+DELETE FROM t1;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check status OK
+InnoDB 0 transactions not purged
+ANALYZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 analyze status OK
+SELECT OTHER_INDEX_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE NAME='test/t1';
+OTHER_INDEX_SIZE
+1
+# Note: The OTHER_INDEX_SIZE does not cover any SPATIAL INDEX.
+# To test that all indexes were emptied, replace DROP TABLE
+# with the following, and examine the root pages in t1.ibd:
+# FLUSH TABLES t1 FOR EXPORT;
+# UNLOCK TABLES;
+DROP TABLE t1;
+SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
diff --git a/mysql-test/suite/innodb/t/innodb-autoinc.test b/mysql-test/suite/innodb/t/innodb-autoinc.test
index fe7ac2c9657..db265ff8f67 100644
--- a/mysql-test/suite/innodb/t/innodb-autoinc.test
+++ b/mysql-test/suite/innodb/t/innodb-autoinc.test
@@ -695,3 +695,8 @@ CREATE TABLE t1 (
INSERT INTO t1 VALUES ();
SELECT * FROM t1;
DROP TABLE t1;
+
+CREATE TABLE t1 (a DOUBLE PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (-1);
+SELECT * FROM t1;
+DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb-index-debug.test b/mysql-test/suite/innodb/t/innodb-index-debug.test
index de598740e6a..e680fb719cc 100644
--- a/mysql-test/suite/innodb/t/innodb-index-debug.test
+++ b/mysql-test/suite/innodb/t/innodb-index-debug.test
@@ -114,6 +114,45 @@ connection default;
show create table t1;
drop table t1;
drop table t480;
+--echo #
+--echo # MDEV-12827 Assertion failure when reporting duplicate key error
+--echo # in online table rebuild
+--echo #
+
+CREATE TABLE t1 (j INT UNIQUE, i INT UNIQUE) ENGINE=InnoDB;
+--connect (con1,localhost,root,,test)
+SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL built WAIT_FOR log';
+--send
+ALTER TABLE t1 DROP j, FORCE;
+
+--connection default
+SET DEBUG_SYNC='now WAIT_FOR built';
+--error ER_DUP_ENTRY
+INSERT INTO t1 (i) VALUES (0),(0);
+SET DEBUG_SYNC='now SIGNAL log';
+
+--connection con1
+--error ER_DUP_ENTRY
+reap;
+SET DEBUG_SYNC='row_log_table_apply1_before SIGNAL built2 WAIT_FOR log2';
+--send
+ALTER TABLE t1 DROP j, FORCE;
+
+--connection default
+SET DEBUG_SYNC='now WAIT_FOR built2';
+INSERT INTO t1 (i) VALUES (0),(1);
+--error ER_DUP_ENTRY
+UPDATE t1 SET i=0;
+SET DEBUG_SYNC='now SIGNAL log2';
+
+--connection con1
+--error ER_DUP_ENTRY
+reap;
+--disconnect con1
+--connection default
+SET DEBUG_SYNC='RESET';
+DROP TABLE t1;
+
SET DEBUG_SYNC='RESET';
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/suite/innodb/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test
index a4ba60ec94c..9781d284636 100644
--- a/mysql-test/suite/innodb/t/innodb.test
+++ b/mysql-test/suite/innodb/t/innodb.test
@@ -2583,6 +2583,76 @@ select f1 from t1;
show status like "handler_read_key";
drop table t1;
+#
+# Test handling of writes to TEMPORARY tables for read-only transactions
+#
+CREATE TABLE t1 (c1 INT) ENGINE=InnoDB;
+CREATE TEMPORARY TABLE t2 (c1 INT) ENGINE=InnoDB;
+
+# Check that the rollback works
+START TRANSACTION READ ONLY;
+INSERT INTO t2 VALUES(0);
+--error ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION
+INSERT INTO t1 VALUES(0);
+ROLLBACK;
+
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+START TRANSACTION READ ONLY;
+--error ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION
+INSERT INTO t1 VALUES(0);
+INSERT INTO t2 VALUES(1);
+COMMIT;
+
+SET TRANSACTION READ ONLY;
+START TRANSACTION;
+INSERT INTO t2 VALUES(3);
+--error ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION
+INSERT INTO t1 VALUES(0);
+COMMIT;
+
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+DROP TABLE t2;
+
+# This time with some indexes
+CREATE TEMPORARY TABLE t2 (
+ c1 INT AUTO_INCREMENT PRIMARY KEY,
+ c2 INT, INDEX idx(c2)) ENGINE=InnoDB;
+
+SHOW CREATE TABLE t2;
+
+# Check that the rollback works
+START TRANSACTION READ ONLY;
+INSERT INTO t2 VALUES(NULL,1),(NULL,2),(NULL,3);
+--error ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION
+INSERT INTO t1 VALUES(0);
+ROLLBACK;
+
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+START TRANSACTION READ ONLY;
+--error ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION
+INSERT INTO t1 VALUES(0);
+INSERT INTO t2 VALUES(NULL,1),(NULL,2),(NULL,3);
+COMMIT;
+
+SET TRANSACTION READ ONLY;
+START TRANSACTION;
+INSERT INTO t2 VALUES(NULL,1),(NULL,2),(NULL,3);
+--error ER_CANT_EXECUTE_IN_READ_ONLY_TRANSACTION
+INSERT INTO t1 VALUES(0);
+COMMIT;
+
+SHOW CREATE TABLE t2;
+SELECT * FROM t1;
+SELECT * FROM t2;
+
+DROP TABLE t1;
+DROP TABLE t2;
#######################################################################
# #
# Please, DO NOT TOUCH this file as well as the innodb.result file. #
diff --git a/mysql-test/suite/innodb/t/purge_secondary.opt b/mysql-test/suite/innodb/t/purge_secondary.opt
new file mode 100644
index 00000000000..99bf0e5a28b
--- /dev/null
+++ b/mysql-test/suite/innodb/t/purge_secondary.opt
@@ -0,0 +1 @@
+--innodb-sys-tablestats
diff --git a/mysql-test/suite/innodb/t/purge_secondary.test b/mysql-test/suite/innodb/t/purge_secondary.test
new file mode 100644
index 00000000000..47cfaec41ca
--- /dev/null
+++ b/mysql-test/suite/innodb/t/purge_secondary.test
@@ -0,0 +1,131 @@
+--source include/have_innodb.inc
+
+# Ensure that the history list length will actually be decremented by purge.
+SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
+SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
+
+CREATE TABLE t1 (
+ a SERIAL, b CHAR(255) NOT NULL DEFAULT '', c BOOLEAN DEFAULT false,
+ l LINESTRING NOT NULL DEFAULT ST_linefromtext('linestring(448 -689,
+ 453 -684,451 -679,453 -677,458 -681,463 -681,468 -678,470 -676,470 -678,
+ 468 -675,472 -675,472 -675,474 -674,479 -676,477 -675,473 -676,475 1324,
+ 479 1319,484 1322,483 1323,486 1323,491 1328,492 1325,496 1325,498 1325,
+ 501 1330,498 1331,500 1331,504 1330,508 1329,512 1332,513 1337,518 1339,
+ 518 1339,513 1344,513 1344,512 1346,514 1351,515 1353,519 1358,518 1362,
+ 522 1365,525 1360,526 1362,527 1362,528 1367,525 1371,528 1366,532 1369,
+ 536 1374,539 1377,543 1379,539 1381,541 1382,543 1383,546 1388,549 1393,
+ 554 1393,554 1395,554 1392,550 1394,550 1392,546 1394,549 1397,550 1393,
+ 549 1394,554 1390,554 1391,549 1396,551 1396,547 1400,547 1402,551 1407,
+ 554 1412,554 1415,558 1418,463 -681,465 -677,465 -675,470 -670,470 -665,
+ 470 -660,470 -659,473 -656,476 -656,481 -655,482 -652,486 -654,486 -652,
+ 486 -648,491 -646,490 -651,494 -646,493 -644,493 -644,490 -644,491 2356,
+ 495 2359,495 2364,500 2359,503 5359,504 5364,509 5368,504 5367,499 5368,
+ 498 5371,498 5369,500 5370,504 5370,508 5370,511 5370,507 5374,508 5378,
+ 511 5382,507 5387,509 5389,512 5388,515 5393,520 5396,517 5397,517 5402,
+ 515 5404,520 5402,521 5405,525 5405,526 5408,530 7408,535 7413,533 7415,
+ 529 7412,532 7416,4532 7416,4534 7421,4533 7417,4536 7413,4536 7418,
+ 4540 3418,4545 3418,4549 3415,4551 3419,4554 3421,4559 3423,4559 3426,
+ 4557 3424,4561 3428,4558 3428,4563 3431,4565 3435,4569 3439,4569 3439,
+ 4569 3444,4567 3444,4572 3446,4577 3447,4581 3444,4581 3448,4584 3448,
+ 4579 3447,4580 3450,4583 3449,4583 3453,4587 3455,4588 3458,4593 3463,
+ 4598 3465,4601 3468,4598 3464,4598 3460,4593 5460,4595 5461,4600 5464,
+ 4600 5465,4601 5466,4606 5466,4608 5466,4605 5464,4608 5467,4607 5468,
+ 4609 5465,4614 5461,4618 5463,4621 5467,4623 5470,4622 5470,4622 5470,
+ 4625 6470,4627 6471,4627 6472,4627 6473,6627 6474,6625 6474,6628 6477,
+ 6633 6481,6633 6480,6637 6475,7637 6479,7638 6482,7643 6487,7644 6492,
+ 7647 6492,7648 6495,7646 6498,7650 6499,7646 6494,7644 6499,7644 6497,
+ 7644 6499,7647 6502,7649 6504,7650 6501,7647 6503,7649 6504,7650 6508,
+ 7651 6503,7652 6508,7655 6508,7650 6511,7655 6515,7658 6513,7663 6513,
+ 7665 6514,7669 6512,7667 6510,7664 6510,472 -675,477 -670,479 -666,
+ 482 -663,484 -668,484 -666,485 -664,481 -664,479 -659,482 -659,484 -658,
+ 483 -659,488 2341,493 2339,489 2338,491 2342,491 2346,494 2346,490 2348,
+ 493 2348,498 2349,498 2350,499 2349,502 2350,503 2348,506 2348,506 2348,
+ 507 2353,507 2355,504 2359,504 2364,504 2361,499 2365,502 2360,502 2358,
+ 503 2357,504 2353,504 2357,500 2356,497 2355,498 2355,500 2359,502 2361,
+ 505 2364,508 2364,506 2368,506 2370,504 2373,499 2373,496 2372,493 2377,
+ 497 2380,495 2383,496 7383,493 7386,497 7391,494 7387,495 7389,498 7392,
+ 498 7392,495 7395,493 7398,498 7401,498 7403,503 7400,498 8400,501 8401,
+ 503 8401,503 8401,501 10401,496 10396,491 10401,492 10399,493 10403,
+ 496 10403,491 10403,493 10407,489 10410,493 10407,489 10403,498 7403,
+ 497 7399,496 7403,500 7405,500 7407,503 7411,508 7415,511 7415,511 7420,
+ 515 7420,520 7423,523 7423,520 7427,523 7427,523 7427,522 7432,525 4432,
+ 527 4434,530 4437,534 4441,529 4446,529 4441,534 4436,537 4436,535 4437,
+ 532 4437,534 4432,535 4429,538 4430,542 4427,542 4431,538 4431,541 4431,
+ 541 4433,543 4433,545 4432,549 4428,552 4426,556 4427,557 4423,560 4427,
+ 561 4428,558 4430,559 4434,559 4432,561 4434,561 4437,563 4435,559 4430,
+ 561 4435,4561 4437,4566 4441,4568 4446,4568 4450,4569 4455,4565 4458,
+ 4561 4463,4561 9463,4564 9463,4565 9461,9565 9463,9560 9467,9560 9466,
+ 9555 9469,9555 9471,9559 9469,9557 9473,9553 9478,9555 9480,9557 9481,
+ 9557 9481,9557 9483,9562 9487,9558 9487,9558 9490,9561 9493,9562 9493,
+ 9557 9493,9560 9496,9555 9501,9553 9503,9553 9506,9557 9510,9558 9511,
+ 9561 9514,9563 9512,9568 9514,9567 9514,9567 13514,9570 13517,9566 13521,
+ 9571 13521,9571 13526,9573 13521,9571 13521,9576 10521,9580 10526,9582 10525,
+ 9584 10528,9584 10531,9584 10533,9589 10533,9588 10537,9588 10541,9589 10542,
+ 9593 10544,9595 10540,9597 10541,9600 10545,9601 15545,9603 15549,9605 15553,
+ 9601 15558,9601 15553,9605 15551,9605 15550,9605 15554,9607 15556,9605 15556,
+ 9604 15561,9607 15559,9603 15559,9603 15562,9604 15563,9608 15566,9612 15570,
+ 9617 15565,9622 15568,9627 15566,9628 15564,9629 15564,9633 15569,9636 15569,
+ 9634 15571,9634 15572,9636 15574,9634 15570,9629 15570,9631 15567,9629 15570,
+ 9626 15574,9626 15575,498 7401,502 7401,506 7397,506 7395,502 7398,497 7401,
+ 502 7402,505 7397,508 7400,504 7404,3504 7409,3505 7405,3508 7410,3511 7413,
+ 3511 7416,3511 7419,3511 7419,3513 7421,3517 7424,3519 7426,3520 11426,
+ 3523 11421,3527 11418,3530 11415,3530 11416,3533 11418,7533 11415,7531 11415,
+ 7531 11417,7536 11420,7541 11424,7543 11425,7543 11427,7543 11429,7540 11429,
+ 7542 11425,7541 11420,7542 11421,7542 11422,7540 11424,7540 11423,7543 11422,
+ 7546 11426,7550 11431,7553 11436,7555 16436,7553 16438,7558 16438,7559 16438,
+ 7560 16439,7565 16437,7560 16435,7563 16435,7566 16440,7566 16444,7564 16447,
+ 7559 16443,7561 16443,7566 16448,7570 16451,7574 16456,7578 16459,
+ 12578 16459,12578 20459,12577 20456,12581 20454,12585 20456,12585 20456,
+ 12585 20456,12583 20456,12579 20459,12580 20461,12580 20462,12580 20460,
+ 12585 20465,12586 20467,12590 20470,12590 20470,12589 20471,12584 20471,
+ 12589 20471,9589 20472,9594 20472,9595 20472,9596 20477,9598 20482,
+ 9603 20480,9608 20484,9613 20484,9610 20486,9608 20488,9608 20489,9610 20489,
+ 9614 20486,9619 20481,9620 20481,9618 21481,9621 21483,9626 21483,9628 21485,
+ 9623 21487,9622 21490,9626 21493,9621 21495,9626 21498,9622 21499,9624 21504,
+ 9625 21499,9629 21501,9633 21498,9637 21495,9639 21498,9644 21501,9557 9481,
+ 9560 9485,9561 9490,9563 9488,9560 9486,9558 9488,9561 9492,9563 9495,
+ 9567 9492,9567 9488,9564 9490,9559 9495,9559 9498,9557 9502,9562 9506,
+ 9564 9509,9569 9512,9569 9516,9569 9518,9569 9515,9571 9513,9571 9512,
+ 9573 9513,9578 9516,9581 9516,9585 11516,9585 11521,9590 10521,9586 10524,
+ 9589 10529,9589 10527,9589 10527,9594 10532,9594 10534,9598 10536,9598 10540,
+ 9600 10542,9604 10538,9607 10538,9609 10543,9613 10538,9613 10533,9613 10537,
+ 9610 10537,9614 10542,9609 10542,9610 10543,9610 10548,9611 10553,9616 7553,
+ 9620 7553,9621 7557,9618 7559,9618 7554,9622 7557,9622 7561,9622 7556,
+ 9622 7560,9619 7560,9620 7565,9622 7563,9627 7566,9630 7570,9630 7571,
+ 9632 7573,9637 7576,9639 7578,9640 7576,9640 7579,9640 7575,9642 7570,
+ 9646 7570,9651 7574,9653 7577,9652 7572,9653 7576,9653 7576,9651 7581,
+ 9656 7585,9660 7586,9659 7591,9657 7594,9661 7598,9664 7602,9668 12602,
+ 9673 12604,9676 12606,9679 12602,9682 12605,9677 12610,9674 12606,9674 12601,
+ 9674 12603,9672 9603,9668 9605,9671 9606,9668 9611,9668 9606,9671 9611,
+ 9675 9615,9677 9620,9678 9622,9679 9624,9684 9626,9685 9627,9685 9622,
+ 9685 9626,9689 9628,9694 9633,9699 9637,9699 9637,9704 9636,9708 9637,
+ 9709 9638,9707 9639,9705 9642,9707 9647,9710 9649,9711 9653,9716 9649,
+ 9716 9648,9720 9650,9721 9648,9723 9648,9726 4648,12726 4653,12731 4655,
+ 12734 4660,12730 4661,12733 4664,12733 4665,12735 4670,12737 4674,12741 4674,
+ 12738 4675,12740 4675,12737 4675,12742 4678,12743 4681,12746 4677)'),
+ INDEX(b,c), SPATIAL INDEX(l)
+) ENGINE=InnoDB ROW_FORMAT=REDUNDANT;
+INSERT INTO t1 () VALUES (),(),(),(),(),(),(),(),(),(),(),(),(),(),(),(),();
+SELECT LENGTH(l) FROM t1;
+INSERT INTO t1 (a) SELECT NULL FROM t1;
+INSERT INTO t1 (a) SELECT NULL FROM t1;
+CHECK TABLE t1;
+UPDATE t1 SET c=true, l=ST_linefromtext('linestring(0 0,1 1,2 2)');
+DELETE FROM t1;
+CHECK TABLE t1;
+
+source include/wait_all_purged.inc;
+
+ANALYZE TABLE t1;
+SELECT OTHER_INDEX_SIZE FROM INFORMATION_SCHEMA.INNODB_SYS_TABLESTATS
+WHERE NAME='test/t1';
+
+--echo # Note: The OTHER_INDEX_SIZE does not cover any SPATIAL INDEX.
+--echo # To test that all indexes were emptied, replace DROP TABLE
+--echo # with the following, and examine the root pages in t1.ibd:
+--echo # FLUSH TABLES t1 FOR EXPORT;
+--echo # UNLOCK TABLES;
+
+DROP TABLE t1;
+
+SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
diff --git a/mysql-test/suite/mariabackup/apply-log-only-incr.result b/mysql-test/suite/mariabackup/apply-log-only-incr.result
index 2baed8c1db9..114a471aa2c 100644
--- a/mysql-test/suite/mariabackup/apply-log-only-incr.result
+++ b/mysql-test/suite/mariabackup/apply-log-only-incr.result
@@ -3,6 +3,13 @@ CREATE TABLE t(a INT UNSIGNED PRIMARY KEY) ENGINE INNODB;
INSERT INTO t VALUES(0);
COMMIT;
start transaction;
+connect flush_log,localhost,root,,;
+BEGIN;
+DELETE FROM t LIMIT 1;
+SET GLOBAL innodb_flush_log_at_trx_commit = 1;
+ROLLBACK;
+disconnect flush_log;
+connection default;
NOT FOUND /Rollback of trx with id/ in current_test
# expect NOT FOUND
NOT FOUND /Rollback of trx with id/ in current_test
diff --git a/mysql-test/suite/mariabackup/apply-log-only-incr.test b/mysql-test/suite/mariabackup/apply-log-only-incr.test
index aa5110cc51e..81c91d3c452 100644
--- a/mysql-test/suite/mariabackup/apply-log-only-incr.test
+++ b/mysql-test/suite/mariabackup/apply-log-only-incr.test
@@ -26,6 +26,13 @@ eval INSERT t VALUES(201-$n);
dec $n;
}
--enable_query_log
+connect (flush_log,localhost,root,,);
+BEGIN;
+DELETE FROM t LIMIT 1;
+SET GLOBAL innodb_flush_log_at_trx_commit = 1;
+ROLLBACK;
+disconnect flush_log;
+connection default;
--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --ftwrl-wait-timeout=5 --ftwrl-wait-threshold=300 --ftwrl-wait-query-type=all --target-dir=$incremental_dir --incremental-basedir=$basedir ;
diff --git a/mysql-test/suite/parts/inc/part_alter_values.inc b/mysql-test/suite/parts/inc/part_alter_values.inc
new file mode 100644
index 00000000000..0d4929d9820
--- /dev/null
+++ b/mysql-test/suite/parts/inc/part_alter_values.inc
@@ -0,0 +1,37 @@
+--echo #
+--echo # MDEV-14641 Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine
+--echo #
+
+--eval CREATE TABLE t1 (i INT) ENGINE=$engine PARTITION BY LIST(i) (PARTITION p0 VALUES IN (1), PARTITION p1 VALUES IN (2));
+ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
+ALTER TABLE t1 DROP PARTITION p1;
+SELECT * FROM t1;
+
+# Cleanup
+DROP TABLE t1;
+
+
+--echo #
+--echo # MDEV-13788 Server crash when issuing bad SQL partition syntax
+--echo #
+
+--eval CREATE TABLE t1 (id int, d date) ENGINE=$engine PARTITION BY RANGE COLUMNS(d) (PARTITION p1 VALUES LESS THAN (MAXVALUE))
+SHOW CREATE TABLE t1;
+--error ER_PARTITION_REQUIRES_VALUES_ERROR
+ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
+(
+ PARTITION p2, /* Notice no values */
+ PARTITION p3 VALUES LESS THAN (MAXVALUE)
+);
+DROP TABLE t1;
+
+
+--eval CREATE TABLE t1 (id int, d date) ENGINE=$engine PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1,2,3))
+SHOW CREATE TABLE t1;
+--error ER_PARTITION_REQUIRES_VALUES_ERROR
+ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
+(
+ PARTITION p2, /* Notice no values */
+ PARTITION p3 VALUES IN (4,5,6)
+);
+DROP TABLE t1;
diff --git a/mysql-test/suite/parts/r/partition_alter_innodb.result b/mysql-test/suite/parts/r/partition_alter_innodb.result
new file mode 100644
index 00000000000..99697086170
--- /dev/null
+++ b/mysql-test/suite/parts/r/partition_alter_innodb.result
@@ -0,0 +1,44 @@
+#
+# MDEV-14641 Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine
+#
+CREATE TABLE t1 (i INT) ENGINE=InnoDB PARTITION BY LIST(i) (PARTITION p0 VALUES IN (1), PARTITION p1 VALUES IN (2));;
+ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
+ALTER TABLE t1 DROP PARTITION p1;
+SELECT * FROM t1;
+i
+DROP TABLE t1;
+#
+# MDEV-13788 Server crash when issuing bad SQL partition syntax
+#
+CREATE TABLE t1 (id int, d date) ENGINE=InnoDB PARTITION BY RANGE COLUMNS(d) (PARTITION p1 VALUES LESS THAN (MAXVALUE));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) DEFAULT NULL,
+ `d` date DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+ PARTITION BY RANGE COLUMNS(`d`)
+(PARTITION `p1` VALUES LESS THAN (MAXVALUE) ENGINE = InnoDB)
+ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
+(
+PARTITION p2, /* Notice no values */
+PARTITION p3 VALUES LESS THAN (MAXVALUE)
+);
+ERROR HY000: Syntax error: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition
+DROP TABLE t1;
+CREATE TABLE t1 (id int, d date) ENGINE=InnoDB PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1,2,3));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) DEFAULT NULL,
+ `d` date DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1
+ PARTITION BY LIST (`id`)
+(PARTITION `p1` VALUES IN (1,2,3) ENGINE = InnoDB)
+ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
+(
+PARTITION p2, /* Notice no values */
+PARTITION p3 VALUES IN (4,5,6)
+);
+ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
+DROP TABLE t1;
diff --git a/mysql-test/suite/parts/r/partition_alter_maria.result b/mysql-test/suite/parts/r/partition_alter_maria.result
index 6343566e408..7fed69bb5a5 100644
--- a/mysql-test/suite/parts/r/partition_alter_maria.result
+++ b/mysql-test/suite/parts/r/partition_alter_maria.result
@@ -16,3 +16,47 @@ select * from t1;
pk dt
1 2017-09-28 15:12:00
drop table t1;
+#
+# MDEV-14641 Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine
+#
+CREATE TABLE t1 (i INT) ENGINE=Aria PARTITION BY LIST(i) (PARTITION p0 VALUES IN (1), PARTITION p1 VALUES IN (2));;
+ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
+ALTER TABLE t1 DROP PARTITION p1;
+SELECT * FROM t1;
+i
+DROP TABLE t1;
+#
+# MDEV-13788 Server crash when issuing bad SQL partition syntax
+#
+CREATE TABLE t1 (id int, d date) ENGINE=Aria PARTITION BY RANGE COLUMNS(d) (PARTITION p1 VALUES LESS THAN (MAXVALUE));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) DEFAULT NULL,
+ `d` date DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1
+ PARTITION BY RANGE COLUMNS(`d`)
+(PARTITION `p1` VALUES LESS THAN (MAXVALUE) ENGINE = Aria)
+ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
+(
+PARTITION p2, /* Notice no values */
+PARTITION p3 VALUES LESS THAN (MAXVALUE)
+);
+ERROR HY000: Syntax error: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition
+DROP TABLE t1;
+CREATE TABLE t1 (id int, d date) ENGINE=Aria PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1,2,3));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) DEFAULT NULL,
+ `d` date DEFAULT NULL
+) ENGINE=Aria DEFAULT CHARSET=latin1
+ PARTITION BY LIST (`id`)
+(PARTITION `p1` VALUES IN (1,2,3) ENGINE = Aria)
+ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
+(
+PARTITION p2, /* Notice no values */
+PARTITION p3 VALUES IN (4,5,6)
+);
+ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
+DROP TABLE t1;
diff --git a/mysql-test/suite/parts/r/partition_alter_myisam.result b/mysql-test/suite/parts/r/partition_alter_myisam.result
index 514593fd4ef..50b8b802ad4 100644
--- a/mysql-test/suite/parts/r/partition_alter_myisam.result
+++ b/mysql-test/suite/parts/r/partition_alter_myisam.result
@@ -1,10 +1,57 @@
-CREATE TABLE t1 (i INT) ENGINE=MYISAM
-PARTITION BY LIST(i) (
-PARTITION p0 VALUES IN (1),
-PARTITION p1 VALUES IN (2)
-);
+#
+# MDEV-14641 Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine
+#
+CREATE TABLE t1 (i INT) ENGINE=MyISAM PARTITION BY LIST(i) (PARTITION p0 VALUES IN (1), PARTITION p1 VALUES IN (2));;
ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
ALTER TABLE t1 DROP PARTITION p1;
SELECT * FROM t1;
i
DROP TABLE t1;
+#
+# MDEV-13788 Server crash when issuing bad SQL partition syntax
+#
+CREATE TABLE t1 (id int, d date) ENGINE=MyISAM PARTITION BY RANGE COLUMNS(d) (PARTITION p1 VALUES LESS THAN (MAXVALUE));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) DEFAULT NULL,
+ `d` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE COLUMNS(`d`)
+(PARTITION `p1` VALUES LESS THAN (MAXVALUE) ENGINE = MyISAM)
+ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
+(
+PARTITION p2, /* Notice no values */
+PARTITION p3 VALUES LESS THAN (MAXVALUE)
+);
+ERROR HY000: Syntax error: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition
+DROP TABLE t1;
+CREATE TABLE t1 (id int, d date) ENGINE=MyISAM PARTITION BY LIST (id) (PARTITION p1 VALUES IN (1,2,3));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `id` int(11) DEFAULT NULL,
+ `d` date DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY LIST (`id`)
+(PARTITION `p1` VALUES IN (1,2,3) ENGINE = MyISAM)
+ALTER TABLE t1 REORGANIZE PARTITION p1 INTO
+(
+PARTITION p2, /* Notice no values */
+PARTITION p3 VALUES IN (4,5,6)
+);
+ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
+DROP TABLE t1;
+create table t1 ( c1 int, c2 int, c3 varchar(100)) delay_key_write=1
+partition by key(c1) (
+partition p01 data directory = 'MYSQL_TMP_DIR'
+ index directory = 'MYSQL_TMP_DIR',
+partition p02 data directory = 'MYSQL_TMP_DIR'
+ index directory = 'MYSQL_TMP_DIR');
+insert into t1 values (1, 1, repeat('a', 100));
+insert into t1 select rand()*1000, rand()*1000, repeat('b', 100) from t1;
+insert into t1 select rand()*1000, rand()*1000, repeat('b', 100) from t1;
+insert into t1 select rand()*1000, rand()*1000, repeat('b', 100) from t1;
+alter online table t1 delay_key_write=0;
+alter online table t1 delay_key_write=1;
+drop table t1;
diff --git a/mysql-test/suite/parts/t/partition_alter_innodb.test b/mysql-test/suite/parts/t/partition_alter_innodb.test
new file mode 100644
index 00000000000..451bec05adc
--- /dev/null
+++ b/mysql-test/suite/parts/t/partition_alter_innodb.test
@@ -0,0 +1,4 @@
+--source include/have_innodb.inc
+--source include/have_partition.inc
+--let $engine=InnoDB
+--source inc/part_alter_values.inc
diff --git a/mysql-test/suite/parts/t/partition_alter_maria.test b/mysql-test/suite/parts/t/partition_alter_maria.test
index db249591158..e21f0dfab82 100644
--- a/mysql-test/suite/parts/t/partition_alter_maria.test
+++ b/mysql-test/suite/parts/t/partition_alter_maria.test
@@ -16,3 +16,6 @@ select * from t1;
alter table t1 drop partition p20181231;
select * from t1;
drop table t1;
+
+--let $engine=Aria
+--source inc/part_alter_values.inc
diff --git a/mysql-test/suite/parts/t/partition_alter_myisam.test b/mysql-test/suite/parts/t/partition_alter_myisam.test
index 91ce8d21327..d3abb8842e1 100644
--- a/mysql-test/suite/parts/t/partition_alter_myisam.test
+++ b/mysql-test/suite/parts/t/partition_alter_myisam.test
@@ -1,17 +1,24 @@
-#
-# MDEV-14641 Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine
-#
-
--source include/have_partition.inc
+--let $engine=MyISAM
+--source inc/part_alter_values.inc
-CREATE TABLE t1 (i INT) ENGINE=MYISAM
-PARTITION BY LIST(i) (
- PARTITION p0 VALUES IN (1),
- PARTITION p1 VALUES IN (2)
-);
-ALTER TABLE t1 ROW_FORMAT=COMPRESSED;
-ALTER TABLE t1 DROP PARTITION p1;
-SELECT * FROM t1;
+#
+# MDEV-14026 ALTER TABLE ... DELAY_KEY_WRITE=1 creates table copy for partitioned MyISAM table with DATA DIRECTORY/INDEX DIRECTORY options
+#
-# Cleanup
-DROP TABLE t1;
+replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR;
+--disable_warnings
+eval create table t1 ( c1 int, c2 int, c3 varchar(100)) delay_key_write=1
+ partition by key(c1) (
+ partition p01 data directory = '$MYSQL_TMP_DIR'
+ index directory = '$MYSQL_TMP_DIR',
+ partition p02 data directory = '$MYSQL_TMP_DIR'
+ index directory = '$MYSQL_TMP_DIR');
+--enable_warnings
+insert into t1 values (1, 1, repeat('a', 100));
+insert into t1 select rand()*1000, rand()*1000, repeat('b', 100) from t1;
+insert into t1 select rand()*1000, rand()*1000, repeat('b', 100) from t1;
+insert into t1 select rand()*1000, rand()*1000, repeat('b', 100) from t1;
+alter online table t1 delay_key_write=0;
+alter online table t1 delay_key_write=1;
+drop table t1;
diff --git a/mysql-test/suite/plugins/r/binlog-simple_plugin_check.result b/mysql-test/suite/plugins/r/binlog-simple_plugin_check.result
new file mode 100644
index 00000000000..6c960ee325c
--- /dev/null
+++ b/mysql-test/suite/plugins/r/binlog-simple_plugin_check.result
@@ -0,0 +1,19 @@
+INSTALL SONAME "simple_password_check";
+SELECT PLUGIN_NAME FROM INFORMATION_SCHEMA.PLUGINS
+WHERE PLUGIN_NAME='simple_password_check';
+PLUGIN_NAME
+simple_password_check
+#
+# MDEV-14031 Password policy causes replication failure
+#
+CREATE USER user1@localhost IDENTIFIED BY 'BsG9#9.cem#!85';
+CREATE USER user2@localhost IDENTIFIED BY 'bsg9#d.cem#!85';
+ERROR HY000: Your password does not satisfy the current policy requirements
+DROP USER user1@localhost;
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; CREATE USER user1@localhost IDENTIFIED BY 'BsG9#9.cem#!85'
+master-bin.000001 # Gtid # # GTID #-#-#
+master-bin.000001 # Query # # use `test`; DROP USER user1@localhost
+UNINSTALL PLUGIN simple_password_check;
diff --git a/mysql-test/suite/plugins/t/binlog-simple_plugin_check.test b/mysql-test/suite/plugins/t/binlog-simple_plugin_check.test
new file mode 100644
index 00000000000..773dafe8a81
--- /dev/null
+++ b/mysql-test/suite/plugins/t/binlog-simple_plugin_check.test
@@ -0,0 +1,31 @@
+--source include/not_embedded.inc
+--source include/have_binlog_format_statement.inc
+
+if (!$SIMPLE_PASSWORD_CHECK_SO) {
+ skip No SIMPLE_PASSWORD_CHECK plugin;
+}
+
+INSTALL SONAME "simple_password_check";
+SELECT PLUGIN_NAME FROM INFORMATION_SCHEMA.PLUGINS
+WHERE PLUGIN_NAME='simple_password_check';
+
+
+--echo #
+--echo # MDEV-14031 Password policy causes replication failure
+--echo #
+
+--disable_query_log
+RESET MASTER; # get rid of previous tests binlog
+--enable_query_log
+
+CREATE USER user1@localhost IDENTIFIED BY 'BsG9#9.cem#!85';
+
+--error ER_NOT_VALID_PASSWORD
+CREATE USER user2@localhost IDENTIFIED BY 'bsg9#d.cem#!85';
+
+DROP USER user1@localhost;
+
+--let $binlog_file = LAST
+source include/show_binlog_events.inc;
+
+UNINSTALL PLUGIN simple_password_check;
diff --git a/mysql-test/suite/roles/flush_roles-12366.result b/mysql-test/suite/roles/flush_roles-12366.result
new file mode 100644
index 00000000000..f65c97e0ee3
--- /dev/null
+++ b/mysql-test/suite/roles/flush_roles-12366.result
@@ -0,0 +1,543 @@
+#
+# MDEV-12366: FLUSH PRIVILEGES can break hierarchy of roles
+#
+# This testcase contains a user, who is granted a master role
+# operations_cluster. operations_cluster is granted 8 different roles
+# who in turn each have 4 different roles granted to them.
+#
+# Only the leaf roles contain privileges to access databases.
+# Make sure the user has access to all databases if the master role
+# is granted to him.
+#
+CREATE USER u;
+CREATE ROLE operations_cluster;
+GRANT operations_cluster TO u;
+CREATE DATABASE bob_live_sg;
+CREATE TABLE bob_live_sg.a (i INT(10));
+CREATE TABLE bob_live_sg.b (i INT(10));
+CREATE TABLE bob_live_sg.c (i INT(10));
+CREATE TABLE bob_live_sg.d (i INT(10));
+CREATE DATABASE oms_live_sg;
+CREATE TABLE oms_live_sg.a (i INT(10));
+CREATE TABLE oms_live_sg.b (i INT(10));
+CREATE TABLE oms_live_sg.c (i INT(10));
+CREATE TABLE oms_live_sg.d (i INT(10));
+CREATE DATABASE bob_live_ph;
+CREATE TABLE bob_live_ph.a (i INT(10));
+CREATE TABLE bob_live_ph.b (i INT(10));
+CREATE TABLE bob_live_ph.c (i INT(10));
+CREATE TABLE bob_live_ph.d (i INT(10));
+CREATE DATABASE oms_live_ph;
+CREATE TABLE oms_live_ph.a (i INT(10));
+CREATE TABLE oms_live_ph.b (i INT(10));
+CREATE TABLE oms_live_ph.c (i INT(10));
+CREATE TABLE oms_live_ph.d (i INT(10));
+CREATE DATABASE bob_live_id;
+CREATE TABLE bob_live_id.a (i INT(10));
+CREATE TABLE bob_live_id.b (i INT(10));
+CREATE TABLE bob_live_id.c (i INT(10));
+CREATE TABLE bob_live_id.d (i INT(10));
+CREATE DATABASE oms_live_id;
+CREATE TABLE oms_live_id.a (i INT(10));
+CREATE TABLE oms_live_id.b (i INT(10));
+CREATE TABLE oms_live_id.c (i INT(10));
+CREATE TABLE oms_live_id.d (i INT(10));
+CREATE DATABASE bob_live_hk;
+CREATE TABLE bob_live_hk.a (i INT(10));
+CREATE TABLE bob_live_hk.b (i INT(10));
+CREATE TABLE bob_live_hk.c (i INT(10));
+CREATE TABLE bob_live_hk.d (i INT(10));
+CREATE DATABASE oms_live_hk;
+CREATE TABLE oms_live_hk.a (i INT(10));
+CREATE TABLE oms_live_hk.b (i INT(10));
+CREATE TABLE oms_live_hk.c (i INT(10));
+CREATE TABLE oms_live_hk.d (i INT(10));
+CREATE DATABASE bob_live_vn;
+CREATE TABLE bob_live_vn.a (i INT(10));
+CREATE TABLE bob_live_vn.b (i INT(10));
+CREATE TABLE bob_live_vn.c (i INT(10));
+CREATE TABLE bob_live_vn.d (i INT(10));
+CREATE DATABASE oms_live_vn;
+CREATE TABLE oms_live_vn.a (i INT(10));
+CREATE TABLE oms_live_vn.b (i INT(10));
+CREATE TABLE oms_live_vn.c (i INT(10));
+CREATE TABLE oms_live_vn.d (i INT(10));
+CREATE DATABASE bob_live_tw;
+CREATE TABLE bob_live_tw.a (i INT(10));
+CREATE TABLE bob_live_tw.b (i INT(10));
+CREATE TABLE bob_live_tw.c (i INT(10));
+CREATE TABLE bob_live_tw.d (i INT(10));
+CREATE DATABASE oms_live_tw;
+CREATE TABLE oms_live_tw.a (i INT(10));
+CREATE TABLE oms_live_tw.b (i INT(10));
+CREATE TABLE oms_live_tw.c (i INT(10));
+CREATE TABLE oms_live_tw.d (i INT(10));
+CREATE DATABASE bob_live_my;
+CREATE TABLE bob_live_my.a (i INT(10));
+CREATE TABLE bob_live_my.b (i INT(10));
+CREATE TABLE bob_live_my.c (i INT(10));
+CREATE TABLE bob_live_my.d (i INT(10));
+CREATE DATABASE oms_live_my;
+CREATE TABLE oms_live_my.a (i INT(10));
+CREATE TABLE oms_live_my.b (i INT(10));
+CREATE TABLE oms_live_my.c (i INT(10));
+CREATE TABLE oms_live_my.d (i INT(10));
+CREATE DATABASE bob_live_th;
+CREATE TABLE bob_live_th.a (i INT(10));
+CREATE TABLE bob_live_th.b (i INT(10));
+CREATE TABLE bob_live_th.c (i INT(10));
+CREATE TABLE bob_live_th.d (i INT(10));
+CREATE DATABASE oms_live_th;
+CREATE TABLE oms_live_th.a (i INT(10));
+CREATE TABLE oms_live_th.b (i INT(10));
+CREATE TABLE oms_live_th.c (i INT(10));
+CREATE TABLE oms_live_th.d (i INT(10));
+CREATE ROLE a_sg;
+CREATE ROLE b_sg;
+CREATE ROLE c_sg;
+CREATE ROLE d_sg;
+CREATE ROLE operations_sg;
+GRANT a_sg TO operations_sg;
+GRANT b_sg TO operations_sg;
+GRANT c_sg TO operations_sg;
+GRANT d_sg TO operations_sg;
+GRANT SELECT ON bob_live_sg.a TO a_sg;
+GRANT SELECT ON bob_live_sg.b TO b_sg;
+GRANT SELECT ON bob_live_sg.c TO c_sg;
+GRANT SELECT ON bob_live_sg.d TO d_sg;
+GRANT SELECT ON oms_live_sg.a TO a_sg;
+GRANT SELECT ON oms_live_sg.b TO b_sg;
+GRANT SELECT ON oms_live_sg.c TO c_sg;
+GRANT SELECT ON oms_live_sg.d TO d_sg;
+CREATE ROLE a_ph;
+CREATE ROLE b_ph;
+CREATE ROLE c_ph;
+CREATE ROLE d_ph;
+CREATE ROLE operations_ph;
+GRANT a_ph TO operations_ph;
+GRANT b_ph TO operations_ph;
+GRANT c_ph TO operations_ph;
+GRANT d_ph TO operations_ph;
+GRANT SELECT ON bob_live_ph.a TO a_ph;
+GRANT SELECT ON bob_live_ph.b TO b_ph;
+GRANT SELECT ON bob_live_ph.c TO c_ph;
+GRANT SELECT ON bob_live_ph.d TO d_ph;
+GRANT SELECT ON oms_live_ph.a TO a_ph;
+GRANT SELECT ON oms_live_ph.b TO b_ph;
+GRANT SELECT ON oms_live_ph.c TO c_ph;
+GRANT SELECT ON oms_live_ph.d TO d_ph;
+CREATE ROLE a_id;
+CREATE ROLE b_id;
+CREATE ROLE c_id;
+CREATE ROLE d_id;
+CREATE ROLE operations_id;
+GRANT a_id TO operations_id;
+GRANT b_id TO operations_id;
+GRANT c_id TO operations_id;
+GRANT d_id TO operations_id;
+GRANT SELECT ON bob_live_id.a TO a_id;
+GRANT SELECT ON bob_live_id.b TO b_id;
+GRANT SELECT ON bob_live_id.c TO c_id;
+GRANT SELECT ON bob_live_id.d TO d_id;
+GRANT SELECT ON oms_live_id.a TO a_id;
+GRANT SELECT ON oms_live_id.b TO b_id;
+GRANT SELECT ON oms_live_id.c TO c_id;
+GRANT SELECT ON oms_live_id.d TO d_id;
+CREATE ROLE a_hk;
+CREATE ROLE b_hk;
+CREATE ROLE c_hk;
+CREATE ROLE d_hk;
+CREATE ROLE operations_hk;
+GRANT a_hk TO operations_hk;
+GRANT b_hk TO operations_hk;
+GRANT c_hk TO operations_hk;
+GRANT d_hk TO operations_hk;
+GRANT SELECT ON bob_live_hk.a TO a_hk;
+GRANT SELECT ON bob_live_hk.b TO b_hk;
+GRANT SELECT ON bob_live_hk.c TO c_hk;
+GRANT SELECT ON bob_live_hk.d TO d_hk;
+GRANT SELECT ON oms_live_hk.a TO a_hk;
+GRANT SELECT ON oms_live_hk.b TO b_hk;
+GRANT SELECT ON oms_live_hk.c TO c_hk;
+GRANT SELECT ON oms_live_hk.d TO d_hk;
+CREATE ROLE a_vn;
+CREATE ROLE b_vn;
+CREATE ROLE c_vn;
+CREATE ROLE d_vn;
+CREATE ROLE operations_vn;
+GRANT a_vn TO operations_vn;
+GRANT b_vn TO operations_vn;
+GRANT c_vn TO operations_vn;
+GRANT d_vn TO operations_vn;
+GRANT SELECT ON bob_live_vn.a TO a_vn;
+GRANT SELECT ON bob_live_vn.b TO b_vn;
+GRANT SELECT ON bob_live_vn.c TO c_vn;
+GRANT SELECT ON bob_live_vn.d TO d_vn;
+GRANT SELECT ON oms_live_vn.a TO a_vn;
+GRANT SELECT ON oms_live_vn.b TO b_vn;
+GRANT SELECT ON oms_live_vn.c TO c_vn;
+GRANT SELECT ON oms_live_vn.d TO d_vn;
+CREATE ROLE a_tw;
+CREATE ROLE b_tw;
+CREATE ROLE c_tw;
+CREATE ROLE d_tw;
+CREATE ROLE operations_tw;
+GRANT a_tw TO operations_tw;
+GRANT b_tw TO operations_tw;
+GRANT c_tw TO operations_tw;
+GRANT d_tw TO operations_tw;
+GRANT SELECT ON bob_live_tw.a TO a_tw;
+GRANT SELECT ON bob_live_tw.b TO b_tw;
+GRANT SELECT ON bob_live_tw.c TO c_tw;
+GRANT SELECT ON bob_live_tw.d TO d_tw;
+GRANT SELECT ON oms_live_tw.a TO a_tw;
+GRANT SELECT ON oms_live_tw.b TO b_tw;
+GRANT SELECT ON oms_live_tw.c TO c_tw;
+GRANT SELECT ON oms_live_tw.d TO d_tw;
+CREATE ROLE a_my;
+CREATE ROLE b_my;
+CREATE ROLE c_my;
+CREATE ROLE d_my;
+CREATE ROLE operations_my;
+GRANT a_my TO operations_my;
+GRANT b_my TO operations_my;
+GRANT c_my TO operations_my;
+GRANT d_my TO operations_my;
+GRANT SELECT ON bob_live_my.a TO a_my;
+GRANT SELECT ON bob_live_my.b TO b_my;
+GRANT SELECT ON bob_live_my.c TO c_my;
+GRANT SELECT ON bob_live_my.d TO d_my;
+GRANT SELECT ON oms_live_my.a TO a_my;
+GRANT SELECT ON oms_live_my.b TO b_my;
+GRANT SELECT ON oms_live_my.c TO c_my;
+GRANT SELECT ON oms_live_my.d TO d_my;
+CREATE ROLE a_th;
+CREATE ROLE b_th;
+CREATE ROLE c_th;
+CREATE ROLE d_th;
+CREATE ROLE operations_th;
+GRANT a_th TO operations_th;
+GRANT b_th TO operations_th;
+GRANT c_th TO operations_th;
+GRANT d_th TO operations_th;
+GRANT SELECT ON bob_live_th.a TO a_th;
+GRANT SELECT ON bob_live_th.b TO b_th;
+GRANT SELECT ON bob_live_th.c TO c_th;
+GRANT SELECT ON bob_live_th.d TO d_th;
+GRANT SELECT ON oms_live_th.a TO a_th;
+GRANT SELECT ON oms_live_th.b TO b_th;
+GRANT SELECT ON oms_live_th.c TO c_th;
+GRANT SELECT ON oms_live_th.d TO d_th;
+GRANT operations_sg TO operations_cluster;
+GRANT operations_ph TO operations_cluster;
+GRANT operations_id TO operations_cluster;
+GRANT operations_hk TO operations_cluster;
+GRANT operations_vn TO operations_cluster;
+GRANT operations_tw TO operations_cluster;
+GRANT operations_my TO operations_cluster;
+GRANT operations_th TO operations_cluster;
+connect con1,localhost,u,,;
+SHOW DATABASES;
+Database
+information_schema
+test
+SET ROLE operations_cluster;
+SHOW DATABASES;
+Database
+bob_live_hk
+bob_live_id
+bob_live_my
+bob_live_ph
+bob_live_sg
+bob_live_th
+bob_live_tw
+bob_live_vn
+information_schema
+oms_live_hk
+oms_live_id
+oms_live_my
+oms_live_ph
+oms_live_sg
+oms_live_th
+oms_live_tw
+oms_live_vn
+test
+SELECT COUNT(1) FROM oms_live_sg.a;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_sg.b;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_sg.c;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_sg.d;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_ph.a;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_ph.b;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_ph.c;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_ph.d;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_id.a;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_id.b;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_id.c;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_id.d;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_hk.a;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_hk.b;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_hk.c;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_hk.d;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_vn.a;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_vn.b;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_vn.c;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_vn.d;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_tw.a;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_tw.b;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_tw.c;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_tw.d;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_my.a;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_my.b;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_my.c;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_my.d;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_th.a;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_th.b;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_th.c;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_th.d;
+COUNT(1)
+0
+connect con2,localhost,root,,;
+FLUSH PRIVILEGES;
+connect con3,localhost,u,,;
+SHOW DATABASES;
+Database
+information_schema
+test
+SET ROLE operations_cluster;
+SHOW DATABASES;
+Database
+bob_live_hk
+bob_live_id
+bob_live_my
+bob_live_ph
+bob_live_sg
+bob_live_th
+bob_live_tw
+bob_live_vn
+information_schema
+oms_live_hk
+oms_live_id
+oms_live_my
+oms_live_ph
+oms_live_sg
+oms_live_th
+oms_live_tw
+oms_live_vn
+test
+SELECT COUNT(1) FROM oms_live_sg.a;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_sg.b;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_sg.c;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_sg.d;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_ph.a;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_ph.b;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_ph.c;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_ph.d;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_id.a;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_id.b;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_id.c;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_id.d;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_hk.a;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_hk.b;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_hk.c;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_hk.d;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_vn.a;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_vn.b;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_vn.c;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_vn.d;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_tw.a;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_tw.b;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_tw.c;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_tw.d;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_my.a;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_my.b;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_my.c;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_my.d;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_th.a;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_th.b;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_th.c;
+COUNT(1)
+0
+SELECT COUNT(1) FROM oms_live_th.d;
+COUNT(1)
+0
+connect con4,localhost,root,,;
+DROP DATABASE bob_live_sg;
+DROP DATABASE oms_live_sg;
+DROP DATABASE bob_live_ph;
+DROP DATABASE oms_live_ph;
+DROP DATABASE bob_live_id;
+DROP DATABASE oms_live_id;
+DROP DATABASE bob_live_hk;
+DROP DATABASE oms_live_hk;
+DROP DATABASE bob_live_vn;
+DROP DATABASE oms_live_vn;
+DROP DATABASE bob_live_tw;
+DROP DATABASE oms_live_tw;
+DROP DATABASE bob_live_my;
+DROP DATABASE oms_live_my;
+DROP DATABASE bob_live_th;
+DROP DATABASE oms_live_th;
+DROP ROLE operations_sg;
+DROP ROLE a_sg;
+DROP ROLE b_sg;
+DROP ROLE c_sg;
+DROP ROLE d_sg;
+DROP ROLE operations_ph;
+DROP ROLE a_ph;
+DROP ROLE b_ph;
+DROP ROLE c_ph;
+DROP ROLE d_ph;
+DROP ROLE operations_id;
+DROP ROLE a_id;
+DROP ROLE b_id;
+DROP ROLE c_id;
+DROP ROLE d_id;
+DROP ROLE operations_hk;
+DROP ROLE a_hk;
+DROP ROLE b_hk;
+DROP ROLE c_hk;
+DROP ROLE d_hk;
+DROP ROLE operations_vn;
+DROP ROLE a_vn;
+DROP ROLE b_vn;
+DROP ROLE c_vn;
+DROP ROLE d_vn;
+DROP ROLE operations_tw;
+DROP ROLE a_tw;
+DROP ROLE b_tw;
+DROP ROLE c_tw;
+DROP ROLE d_tw;
+DROP ROLE operations_my;
+DROP ROLE a_my;
+DROP ROLE b_my;
+DROP ROLE c_my;
+DROP ROLE d_my;
+DROP ROLE operations_th;
+DROP ROLE a_th;
+DROP ROLE b_th;
+DROP ROLE c_th;
+DROP ROLE d_th;
+DROP USER u;
+DROP ROLE operations_cluster;
diff --git a/mysql-test/suite/roles/flush_roles-12366.test b/mysql-test/suite/roles/flush_roles-12366.test
new file mode 100644
index 00000000000..343ac4abf72
--- /dev/null
+++ b/mysql-test/suite/roles/flush_roles-12366.test
@@ -0,0 +1,379 @@
+--source include/not_embedded.inc
+--echo #
+--echo # MDEV-12366: FLUSH PRIVILEGES can break hierarchy of roles
+--echo #
+--echo # This testcase contains a user, who is granted a master role
+--echo # operations_cluster. operations_cluster is granted 8 different roles
+--echo # who in turn each have 4 different roles granted to them.
+--echo #
+--echo # Only the leaf roles contain privileges to access databases.
+--echo # Make sure the user has access to all databases if the master role
+--echo # is granted to him.
+--echo #
+CREATE USER u;
+CREATE ROLE operations_cluster;
+GRANT operations_cluster TO u;
+CREATE DATABASE bob_live_sg;
+CREATE TABLE bob_live_sg.a (i INT(10));
+CREATE TABLE bob_live_sg.b (i INT(10));
+CREATE TABLE bob_live_sg.c (i INT(10));
+CREATE TABLE bob_live_sg.d (i INT(10));
+CREATE DATABASE oms_live_sg;
+CREATE TABLE oms_live_sg.a (i INT(10));
+CREATE TABLE oms_live_sg.b (i INT(10));
+CREATE TABLE oms_live_sg.c (i INT(10));
+CREATE TABLE oms_live_sg.d (i INT(10));
+CREATE DATABASE bob_live_ph;
+CREATE TABLE bob_live_ph.a (i INT(10));
+CREATE TABLE bob_live_ph.b (i INT(10));
+CREATE TABLE bob_live_ph.c (i INT(10));
+CREATE TABLE bob_live_ph.d (i INT(10));
+CREATE DATABASE oms_live_ph;
+CREATE TABLE oms_live_ph.a (i INT(10));
+CREATE TABLE oms_live_ph.b (i INT(10));
+CREATE TABLE oms_live_ph.c (i INT(10));
+CREATE TABLE oms_live_ph.d (i INT(10));
+CREATE DATABASE bob_live_id;
+CREATE TABLE bob_live_id.a (i INT(10));
+CREATE TABLE bob_live_id.b (i INT(10));
+CREATE TABLE bob_live_id.c (i INT(10));
+CREATE TABLE bob_live_id.d (i INT(10));
+CREATE DATABASE oms_live_id;
+CREATE TABLE oms_live_id.a (i INT(10));
+CREATE TABLE oms_live_id.b (i INT(10));
+CREATE TABLE oms_live_id.c (i INT(10));
+CREATE TABLE oms_live_id.d (i INT(10));
+CREATE DATABASE bob_live_hk;
+CREATE TABLE bob_live_hk.a (i INT(10));
+CREATE TABLE bob_live_hk.b (i INT(10));
+CREATE TABLE bob_live_hk.c (i INT(10));
+CREATE TABLE bob_live_hk.d (i INT(10));
+CREATE DATABASE oms_live_hk;
+CREATE TABLE oms_live_hk.a (i INT(10));
+CREATE TABLE oms_live_hk.b (i INT(10));
+CREATE TABLE oms_live_hk.c (i INT(10));
+CREATE TABLE oms_live_hk.d (i INT(10));
+CREATE DATABASE bob_live_vn;
+CREATE TABLE bob_live_vn.a (i INT(10));
+CREATE TABLE bob_live_vn.b (i INT(10));
+CREATE TABLE bob_live_vn.c (i INT(10));
+CREATE TABLE bob_live_vn.d (i INT(10));
+CREATE DATABASE oms_live_vn;
+CREATE TABLE oms_live_vn.a (i INT(10));
+CREATE TABLE oms_live_vn.b (i INT(10));
+CREATE TABLE oms_live_vn.c (i INT(10));
+CREATE TABLE oms_live_vn.d (i INT(10));
+CREATE DATABASE bob_live_tw;
+CREATE TABLE bob_live_tw.a (i INT(10));
+CREATE TABLE bob_live_tw.b (i INT(10));
+CREATE TABLE bob_live_tw.c (i INT(10));
+CREATE TABLE bob_live_tw.d (i INT(10));
+CREATE DATABASE oms_live_tw;
+CREATE TABLE oms_live_tw.a (i INT(10));
+CREATE TABLE oms_live_tw.b (i INT(10));
+CREATE TABLE oms_live_tw.c (i INT(10));
+CREATE TABLE oms_live_tw.d (i INT(10));
+CREATE DATABASE bob_live_my;
+CREATE TABLE bob_live_my.a (i INT(10));
+CREATE TABLE bob_live_my.b (i INT(10));
+CREATE TABLE bob_live_my.c (i INT(10));
+CREATE TABLE bob_live_my.d (i INT(10));
+CREATE DATABASE oms_live_my;
+CREATE TABLE oms_live_my.a (i INT(10));
+CREATE TABLE oms_live_my.b (i INT(10));
+CREATE TABLE oms_live_my.c (i INT(10));
+CREATE TABLE oms_live_my.d (i INT(10));
+CREATE DATABASE bob_live_th;
+CREATE TABLE bob_live_th.a (i INT(10));
+CREATE TABLE bob_live_th.b (i INT(10));
+CREATE TABLE bob_live_th.c (i INT(10));
+CREATE TABLE bob_live_th.d (i INT(10));
+CREATE DATABASE oms_live_th;
+CREATE TABLE oms_live_th.a (i INT(10));
+CREATE TABLE oms_live_th.b (i INT(10));
+CREATE TABLE oms_live_th.c (i INT(10));
+CREATE TABLE oms_live_th.d (i INT(10));
+CREATE ROLE a_sg;
+CREATE ROLE b_sg;
+CREATE ROLE c_sg;
+CREATE ROLE d_sg;
+CREATE ROLE operations_sg;
+GRANT a_sg TO operations_sg;
+GRANT b_sg TO operations_sg;
+GRANT c_sg TO operations_sg;
+GRANT d_sg TO operations_sg;
+GRANT SELECT ON bob_live_sg.a TO a_sg;
+GRANT SELECT ON bob_live_sg.b TO b_sg;
+GRANT SELECT ON bob_live_sg.c TO c_sg;
+GRANT SELECT ON bob_live_sg.d TO d_sg;
+GRANT SELECT ON oms_live_sg.a TO a_sg;
+GRANT SELECT ON oms_live_sg.b TO b_sg;
+GRANT SELECT ON oms_live_sg.c TO c_sg;
+GRANT SELECT ON oms_live_sg.d TO d_sg;
+CREATE ROLE a_ph;
+CREATE ROLE b_ph;
+CREATE ROLE c_ph;
+CREATE ROLE d_ph;
+CREATE ROLE operations_ph;
+GRANT a_ph TO operations_ph;
+GRANT b_ph TO operations_ph;
+GRANT c_ph TO operations_ph;
+GRANT d_ph TO operations_ph;
+GRANT SELECT ON bob_live_ph.a TO a_ph;
+GRANT SELECT ON bob_live_ph.b TO b_ph;
+GRANT SELECT ON bob_live_ph.c TO c_ph;
+GRANT SELECT ON bob_live_ph.d TO d_ph;
+GRANT SELECT ON oms_live_ph.a TO a_ph;
+GRANT SELECT ON oms_live_ph.b TO b_ph;
+GRANT SELECT ON oms_live_ph.c TO c_ph;
+GRANT SELECT ON oms_live_ph.d TO d_ph;
+CREATE ROLE a_id;
+CREATE ROLE b_id;
+CREATE ROLE c_id;
+CREATE ROLE d_id;
+CREATE ROLE operations_id;
+GRANT a_id TO operations_id;
+GRANT b_id TO operations_id;
+GRANT c_id TO operations_id;
+GRANT d_id TO operations_id;
+GRANT SELECT ON bob_live_id.a TO a_id;
+GRANT SELECT ON bob_live_id.b TO b_id;
+GRANT SELECT ON bob_live_id.c TO c_id;
+GRANT SELECT ON bob_live_id.d TO d_id;
+GRANT SELECT ON oms_live_id.a TO a_id;
+GRANT SELECT ON oms_live_id.b TO b_id;
+GRANT SELECT ON oms_live_id.c TO c_id;
+GRANT SELECT ON oms_live_id.d TO d_id;
+CREATE ROLE a_hk;
+CREATE ROLE b_hk;
+CREATE ROLE c_hk;
+CREATE ROLE d_hk;
+CREATE ROLE operations_hk;
+GRANT a_hk TO operations_hk;
+GRANT b_hk TO operations_hk;
+GRANT c_hk TO operations_hk;
+GRANT d_hk TO operations_hk;
+GRANT SELECT ON bob_live_hk.a TO a_hk;
+GRANT SELECT ON bob_live_hk.b TO b_hk;
+GRANT SELECT ON bob_live_hk.c TO c_hk;
+GRANT SELECT ON bob_live_hk.d TO d_hk;
+GRANT SELECT ON oms_live_hk.a TO a_hk;
+GRANT SELECT ON oms_live_hk.b TO b_hk;
+GRANT SELECT ON oms_live_hk.c TO c_hk;
+GRANT SELECT ON oms_live_hk.d TO d_hk;
+CREATE ROLE a_vn;
+CREATE ROLE b_vn;
+CREATE ROLE c_vn;
+CREATE ROLE d_vn;
+CREATE ROLE operations_vn;
+GRANT a_vn TO operations_vn;
+GRANT b_vn TO operations_vn;
+GRANT c_vn TO operations_vn;
+GRANT d_vn TO operations_vn;
+GRANT SELECT ON bob_live_vn.a TO a_vn;
+GRANT SELECT ON bob_live_vn.b TO b_vn;
+GRANT SELECT ON bob_live_vn.c TO c_vn;
+GRANT SELECT ON bob_live_vn.d TO d_vn;
+GRANT SELECT ON oms_live_vn.a TO a_vn;
+GRANT SELECT ON oms_live_vn.b TO b_vn;
+GRANT SELECT ON oms_live_vn.c TO c_vn;
+GRANT SELECT ON oms_live_vn.d TO d_vn;
+CREATE ROLE a_tw;
+CREATE ROLE b_tw;
+CREATE ROLE c_tw;
+CREATE ROLE d_tw;
+CREATE ROLE operations_tw;
+GRANT a_tw TO operations_tw;
+GRANT b_tw TO operations_tw;
+GRANT c_tw TO operations_tw;
+GRANT d_tw TO operations_tw;
+GRANT SELECT ON bob_live_tw.a TO a_tw;
+GRANT SELECT ON bob_live_tw.b TO b_tw;
+GRANT SELECT ON bob_live_tw.c TO c_tw;
+GRANT SELECT ON bob_live_tw.d TO d_tw;
+GRANT SELECT ON oms_live_tw.a TO a_tw;
+GRANT SELECT ON oms_live_tw.b TO b_tw;
+GRANT SELECT ON oms_live_tw.c TO c_tw;
+GRANT SELECT ON oms_live_tw.d TO d_tw;
+CREATE ROLE a_my;
+CREATE ROLE b_my;
+CREATE ROLE c_my;
+CREATE ROLE d_my;
+CREATE ROLE operations_my;
+GRANT a_my TO operations_my;
+GRANT b_my TO operations_my;
+GRANT c_my TO operations_my;
+GRANT d_my TO operations_my;
+GRANT SELECT ON bob_live_my.a TO a_my;
+GRANT SELECT ON bob_live_my.b TO b_my;
+GRANT SELECT ON bob_live_my.c TO c_my;
+GRANT SELECT ON bob_live_my.d TO d_my;
+GRANT SELECT ON oms_live_my.a TO a_my;
+GRANT SELECT ON oms_live_my.b TO b_my;
+GRANT SELECT ON oms_live_my.c TO c_my;
+GRANT SELECT ON oms_live_my.d TO d_my;
+CREATE ROLE a_th;
+CREATE ROLE b_th;
+CREATE ROLE c_th;
+CREATE ROLE d_th;
+CREATE ROLE operations_th;
+GRANT a_th TO operations_th;
+GRANT b_th TO operations_th;
+GRANT c_th TO operations_th;
+GRANT d_th TO operations_th;
+GRANT SELECT ON bob_live_th.a TO a_th;
+GRANT SELECT ON bob_live_th.b TO b_th;
+GRANT SELECT ON bob_live_th.c TO c_th;
+GRANT SELECT ON bob_live_th.d TO d_th;
+GRANT SELECT ON oms_live_th.a TO a_th;
+GRANT SELECT ON oms_live_th.b TO b_th;
+GRANT SELECT ON oms_live_th.c TO c_th;
+GRANT SELECT ON oms_live_th.d TO d_th;
+GRANT operations_sg TO operations_cluster;
+GRANT operations_ph TO operations_cluster;
+GRANT operations_id TO operations_cluster;
+GRANT operations_hk TO operations_cluster;
+GRANT operations_vn TO operations_cluster;
+GRANT operations_tw TO operations_cluster;
+GRANT operations_my TO operations_cluster;
+GRANT operations_th TO operations_cluster;
+
+connect(con1,localhost,u,,);
+SHOW DATABASES;
+SET ROLE operations_cluster;
+SHOW DATABASES;
+SELECT COUNT(1) FROM oms_live_sg.a;
+SELECT COUNT(1) FROM oms_live_sg.b;
+SELECT COUNT(1) FROM oms_live_sg.c;
+SELECT COUNT(1) FROM oms_live_sg.d;
+SELECT COUNT(1) FROM oms_live_ph.a;
+SELECT COUNT(1) FROM oms_live_ph.b;
+SELECT COUNT(1) FROM oms_live_ph.c;
+SELECT COUNT(1) FROM oms_live_ph.d;
+SELECT COUNT(1) FROM oms_live_id.a;
+SELECT COUNT(1) FROM oms_live_id.b;
+SELECT COUNT(1) FROM oms_live_id.c;
+SELECT COUNT(1) FROM oms_live_id.d;
+SELECT COUNT(1) FROM oms_live_hk.a;
+SELECT COUNT(1) FROM oms_live_hk.b;
+SELECT COUNT(1) FROM oms_live_hk.c;
+SELECT COUNT(1) FROM oms_live_hk.d;
+SELECT COUNT(1) FROM oms_live_vn.a;
+SELECT COUNT(1) FROM oms_live_vn.b;
+SELECT COUNT(1) FROM oms_live_vn.c;
+SELECT COUNT(1) FROM oms_live_vn.d;
+SELECT COUNT(1) FROM oms_live_tw.a;
+SELECT COUNT(1) FROM oms_live_tw.b;
+SELECT COUNT(1) FROM oms_live_tw.c;
+SELECT COUNT(1) FROM oms_live_tw.d;
+SELECT COUNT(1) FROM oms_live_my.a;
+SELECT COUNT(1) FROM oms_live_my.b;
+SELECT COUNT(1) FROM oms_live_my.c;
+SELECT COUNT(1) FROM oms_live_my.d;
+SELECT COUNT(1) FROM oms_live_th.a;
+SELECT COUNT(1) FROM oms_live_th.b;
+SELECT COUNT(1) FROM oms_live_th.c;
+SELECT COUNT(1) FROM oms_live_th.d;
+
+
+connect(con2,localhost,root,,);
+FLUSH PRIVILEGES;
+
+connect(con3,localhost,u,,);
+SHOW DATABASES;
+SET ROLE operations_cluster;
+SHOW DATABASES;
+SELECT COUNT(1) FROM oms_live_sg.a;
+SELECT COUNT(1) FROM oms_live_sg.b;
+SELECT COUNT(1) FROM oms_live_sg.c;
+SELECT COUNT(1) FROM oms_live_sg.d;
+SELECT COUNT(1) FROM oms_live_ph.a;
+SELECT COUNT(1) FROM oms_live_ph.b;
+SELECT COUNT(1) FROM oms_live_ph.c;
+SELECT COUNT(1) FROM oms_live_ph.d;
+SELECT COUNT(1) FROM oms_live_id.a;
+SELECT COUNT(1) FROM oms_live_id.b;
+SELECT COUNT(1) FROM oms_live_id.c;
+SELECT COUNT(1) FROM oms_live_id.d;
+SELECT COUNT(1) FROM oms_live_hk.a;
+SELECT COUNT(1) FROM oms_live_hk.b;
+SELECT COUNT(1) FROM oms_live_hk.c;
+SELECT COUNT(1) FROM oms_live_hk.d;
+SELECT COUNT(1) FROM oms_live_vn.a;
+SELECT COUNT(1) FROM oms_live_vn.b;
+SELECT COUNT(1) FROM oms_live_vn.c;
+SELECT COUNT(1) FROM oms_live_vn.d;
+SELECT COUNT(1) FROM oms_live_tw.a;
+SELECT COUNT(1) FROM oms_live_tw.b;
+SELECT COUNT(1) FROM oms_live_tw.c;
+SELECT COUNT(1) FROM oms_live_tw.d;
+SELECT COUNT(1) FROM oms_live_my.a;
+SELECT COUNT(1) FROM oms_live_my.b;
+SELECT COUNT(1) FROM oms_live_my.c;
+SELECT COUNT(1) FROM oms_live_my.d;
+SELECT COUNT(1) FROM oms_live_th.a;
+SELECT COUNT(1) FROM oms_live_th.b;
+SELECT COUNT(1) FROM oms_live_th.c;
+SELECT COUNT(1) FROM oms_live_th.d;
+
+
+connect(con4,localhost,root,,);
+
+DROP DATABASE bob_live_sg;
+DROP DATABASE oms_live_sg;
+DROP DATABASE bob_live_ph;
+DROP DATABASE oms_live_ph;
+DROP DATABASE bob_live_id;
+DROP DATABASE oms_live_id;
+DROP DATABASE bob_live_hk;
+DROP DATABASE oms_live_hk;
+DROP DATABASE bob_live_vn;
+DROP DATABASE oms_live_vn;
+DROP DATABASE bob_live_tw;
+DROP DATABASE oms_live_tw;
+DROP DATABASE bob_live_my;
+DROP DATABASE oms_live_my;
+DROP DATABASE bob_live_th;
+DROP DATABASE oms_live_th;
+DROP ROLE operations_sg;
+DROP ROLE a_sg;
+DROP ROLE b_sg;
+DROP ROLE c_sg;
+DROP ROLE d_sg;
+DROP ROLE operations_ph;
+DROP ROLE a_ph;
+DROP ROLE b_ph;
+DROP ROLE c_ph;
+DROP ROLE d_ph;
+DROP ROLE operations_id;
+DROP ROLE a_id;
+DROP ROLE b_id;
+DROP ROLE c_id;
+DROP ROLE d_id;
+DROP ROLE operations_hk;
+DROP ROLE a_hk;
+DROP ROLE b_hk;
+DROP ROLE c_hk;
+DROP ROLE d_hk;
+DROP ROLE operations_vn;
+DROP ROLE a_vn;
+DROP ROLE b_vn;
+DROP ROLE c_vn;
+DROP ROLE d_vn;
+DROP ROLE operations_tw;
+DROP ROLE a_tw;
+DROP ROLE b_tw;
+DROP ROLE c_tw;
+DROP ROLE d_tw;
+DROP ROLE operations_my;
+DROP ROLE a_my;
+DROP ROLE b_my;
+DROP ROLE c_my;
+DROP ROLE d_my;
+DROP ROLE operations_th;
+DROP ROLE a_th;
+DROP ROLE b_th;
+DROP ROLE c_th;
+DROP ROLE d_th;
+DROP USER u;
+DROP ROLE operations_cluster;
diff --git a/mysql-test/suite/roles/set_role-13655.result b/mysql-test/suite/roles/set_role-13655.result
new file mode 100644
index 00000000000..c30e4115953
--- /dev/null
+++ b/mysql-test/suite/roles/set_role-13655.result
@@ -0,0 +1,52 @@
+#
+# MDEV-13655: SET ROLE does not properly grant privileges.
+#
+# We must test that if aditional db privileges get granted to a role
+# which previously inherited privileges from another granted role
+# keep the internal memory structures intact.
+#
+create role simple;
+#
+# First we create an entry with privileges for databases for the simple role.
+#
+grant select, insert, update, delete, lock tables, execute on t.* to simple;
+create role admin;
+#
+# Now we grant the simple role to admin. This means that db privileges
+# should propagate to admin.
+#
+grant simple to admin;
+show grants for admin;
+Grants for admin
+GRANT simple TO 'admin'
+GRANT USAGE ON *.* TO 'admin'
+GRANT USAGE ON *.* TO 'simple'
+GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES, EXECUTE ON `t`.* TO 'simple'
+#
+# Finally, we give the admin all the available privileges for the db.
+#
+grant all on t.* to admin;
+#
+# Create a user to test out the new roles;
+#
+create user foo;
+grant admin to foo;
+connect foo,localhost,foo,,,,,;
+create database t;
+ERROR 42000: Access denied for user 'foo'@'%' to database 't'
+set role admin;
+show grants;
+Grants for foo@%
+GRANT admin TO 'foo'@'%'
+GRANT USAGE ON *.* TO 'foo'@'%'
+GRANT simple TO 'admin'
+GRANT USAGE ON *.* TO 'admin'
+GRANT ALL PRIVILEGES ON `t`.* TO 'admin'
+GRANT USAGE ON *.* TO 'simple'
+GRANT SELECT, INSERT, UPDATE, DELETE, LOCK TABLES, EXECUTE ON `t`.* TO 'simple'
+create database t;
+drop database t;
+connection default;
+drop role simple;
+drop role admin;
+drop user foo;
diff --git a/mysql-test/suite/roles/set_role-13655.test b/mysql-test/suite/roles/set_role-13655.test
new file mode 100644
index 00000000000..97a82109276
--- /dev/null
+++ b/mysql-test/suite/roles/set_role-13655.test
@@ -0,0 +1,49 @@
+source include/not_embedded.inc;
+
+--echo #
+--echo # MDEV-13655: SET ROLE does not properly grant privileges.
+--echo #
+--echo # We must test that if aditional db privileges get granted to a role
+--echo # which previously inherited privileges from another granted role
+--echo # keep the internal memory structures intact.
+--echo #
+
+create role simple;
+
+--echo #
+--echo # First we create an entry with privileges for databases for the simple role.
+--echo #
+grant select, insert, update, delete, lock tables, execute on t.* to simple;
+create role admin;
+
+--echo #
+--echo # Now we grant the simple role to admin. This means that db privileges
+--echo # should propagate to admin.
+--echo #
+grant simple to admin;
+show grants for admin;
+
+--echo #
+--echo # Finally, we give the admin all the available privileges for the db.
+--echo #
+grant all on t.* to admin;
+
+--echo #
+--echo # Create a user to test out the new roles;
+--echo #
+create user foo;
+grant admin to foo;
+
+connect (foo,localhost,foo,,,,,);
+--error ER_DBACCESS_DENIED_ERROR
+create database t;
+set role admin;
+show grants;
+create database t;
+drop database t;
+
+connection default;
+
+drop role simple;
+drop role admin;
+drop user foo;
diff --git a/mysql-test/suite/rpl/r/rpl_ctype_latin1.result b/mysql-test/suite/rpl/r/rpl_ctype_latin1.result
new file mode 100644
index 00000000000..5399581ac26
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_ctype_latin1.result
@@ -0,0 +1,34 @@
+include/master-slave.inc
+[connection master]
+#
+# Start of 10.2 tests
+#
+#
+# MDEV-14249 Wrong character set info of Query_log_event and the query in Query_log_event constructed by different charsets cause error when slave apply the event.
+#
+SET NAMES latin1;
+CREATE TABLE `tё` (`tё` INT);
+CREATE VIEW `vё` AS SELECT 'vё';
+CREATE PROCEDURE `pё`() SELECT 'pё';
+select hex(table_name) from information_schema.tables where table_schema="test" and table_name like "t%";
+hex(table_name)
+74C391E28098
+select hex(table_name) from information_schema.tables where table_schema="test" and table_name like "v%";
+hex(table_name)
+76C391E28098
+connection slave;
+select hex(table_name) from information_schema.tables where table_schema="test" and table_name like "t%";
+hex(table_name)
+74C391E28098
+select hex(table_name) from information_schema.tables where table_schema="test" and table_name like "v%";
+hex(table_name)
+76C391E28098
+SHOW PROCEDURE STATUS LIKE 'p%';
+Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
+test pё PROCEDURE root@localhost ts ts DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+connection master;
+DROP TABLE `tё`;
+DROP VIEW `vё`;
+DROP PROCEDURE `pё`;
+connection slave;
+include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_ctype_latin1.test b/mysql-test/suite/rpl/t/rpl_ctype_latin1.test
new file mode 100644
index 00000000000..a85254214d2
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_ctype_latin1.test
@@ -0,0 +1,44 @@
+--source include/have_lowercase0.inc
+--disable_warnings
+--source include/master-slave.inc
+--enable_warnings
+
+--echo #
+--echo # Start of 10.2 tests
+--echo #
+
+
+--echo #
+--echo # MDEV-14249 Wrong character set info of Query_log_event and the query in Query_log_event constructed by different charsets cause error when slave apply the event.
+--echo #
+
+#
+# The below tests uses a sequence of bytes 0xD191,
+# which in a utf8 console looks like Ñ‘ (CYRILIC SMALL LETTER YO).
+# Don't be mislead. This sequence is used in latin1 context and
+# represents a sequence of two characters:
+# U+00D1 CAPITAL LATIN LETTER N WITH TILDE (_latin1 0xD1)
+# U+2018 LEFT SINGLE QUOTATION MARK (_latin1 0x91)
+#
+
+SET NAMES latin1;
+CREATE TABLE `tё` (`tё` INT);
+CREATE VIEW `vё` AS SELECT 'vё';
+CREATE PROCEDURE `pё`() SELECT 'pё';
+
+select hex(table_name) from information_schema.tables where table_schema="test" and table_name like "t%";
+select hex(table_name) from information_schema.tables where table_schema="test" and table_name like "v%";
+
+--sync_slave_with_master
+select hex(table_name) from information_schema.tables where table_schema="test" and table_name like "t%";
+select hex(table_name) from information_schema.tables where table_schema="test" and table_name like "v%";
+--replace_column 5 ts 6 ts
+SHOW PROCEDURE STATUS LIKE 'p%';
+
+--connection master
+DROP TABLE `tё`;
+DROP VIEW `vё`;
+DROP PROCEDURE `pё`;
+--sync_slave_with_master
+
+--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test b/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test
index 981cecb66ad..1c087c550d0 100644
--- a/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test
+++ b/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test
@@ -25,7 +25,7 @@ sync_slave_with_master;
connection master;
# Delete './master-bin.000001' from index file.
let $MYSQLD_DATADIR= `SELECT @@DATADIR`;
-let $file= $MYSQLD_DATADIR/master-bin.index;
+let TRUNCATE_FILE= $MYSQLD_DATADIR/master-bin.index;
source include/truncate_file.inc;
if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) NOT IN ('Win32', 'Win64', 'Windows')`)
diff --git a/mysql-test/suite/vcol/r/range.result b/mysql-test/suite/vcol/r/range.result
index ad7a39bc11c..5b081a5dbe8 100644
--- a/mysql-test/suite/vcol/r/range.result
+++ b/mysql-test/suite/vcol/r/range.result
@@ -4,6 +4,6 @@ create table t2 (a int, b int) engine=myisam;
insert into t2 values (1,2),(2,4);
select * from t1 inner join t2 on ( t2.b = t1.v or t2.a = t1.pk );
pk i v a b
-1 1 0 1 2
-2 2 0 2 4
+1 1 2 1 2
+2 2 4 2 4
drop table t1, t2;
diff --git a/mysql-test/t/create_drop_binlog.test b/mysql-test/t/create_drop_binlog.test
index d31ccd73429..6b2b1bbf1f5 100644
--- a/mysql-test/t/create_drop_binlog.test
+++ b/mysql-test/t/create_drop_binlog.test
@@ -2,6 +2,8 @@
--source include/have_log_bin.inc
--source include/binlog_start_pos.inc
+reset master;
+
--let $pos=`select $binlog_start_pos + 73`
--let $binlog_file=query_get_value(SHOW MASTER STATUS, File, 1)
diff --git a/mysql-test/t/create_or_replace.test b/mysql-test/t/create_or_replace.test
index abf470b62d5..4ef4189694b 100644
--- a/mysql-test/t/create_or_replace.test
+++ b/mysql-test/t/create_or_replace.test
@@ -396,3 +396,27 @@ CREATE OR REPLACE TABLE t1 AS SELECT f1();
UNLOCK TABLES;
DROP FUNCTION f1;
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-11071 - Assertion `thd->transaction.stmt.is_empty()' failed in
+--echo # Locked_tables_list::unlock_locked_tables
+--echo #
+CREATE TEMPORARY TABLE t1(a INT) ENGINE=InnoDB;
+CREATE TEMPORARY TABLE t2(a INT);
+CREATE TABLE t3(a INT);
+LOCK TABLE t2 WRITE;
+SELECT * FROM t2;
+# drops t2
+--error ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE
+CREATE OR REPLACE TEMPORARY TABLE t1(a INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
+# make sure we didn't leave locked tables mode
+--error ER_TABLE_NOT_LOCKED
+SELECT * FROM t3;
+# drops t1
+--error ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE
+CREATE OR REPLACE TEMPORARY TABLE t2(a INT) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
+# make sure we didn't leave locked tables mode
+--error ER_TABLE_NOT_LOCKED
+SELECT * FROM t3;
+UNLOCK TABLES;
+DROP TABLE t3;
diff --git a/mysql-test/t/cte_nonrecursive.test b/mysql-test/t/cte_nonrecursive.test
index 742e8f6e4d7..1f21dbcd36d 100644
--- a/mysql-test/t/cte_nonrecursive.test
+++ b/mysql-test/t/cte_nonrecursive.test
@@ -790,3 +790,66 @@ SHOW CREATE VIEW cte_test;
SELECT * FROM cte_test;
DROP VIEW cte_test;
+
+--echo #
+--echo # mdev-14755 : PS for query using CTE in select with subquery
+--echo #
+
+create table t1 (a int);
+insert into t1 values
+ (7), (2), (8), (1), (3), (2), (7), (5), (4), (7), (9), (8);
+
+let $q1=
+with cte as
+(select a from t1 where a between 4 and 7 group by a)
+(select a from cte where exists( select a from t1 where cte.a=t1.a ))
+union
+(select a from t1 where a < 2);
+
+eval $q1;
+eval prepare stmt from "$q1";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+
+let $q2=
+with cte as
+(select a from t1 where a between 4 and 7 group by a)
+(select a from t1 where a < 2)
+union
+(select a from cte where exists( select a from t1 where cte.a=t1.a ));
+
+eval $q2;
+eval prepare stmt from "$q2";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+
+let $q3=
+with cte as
+(select a from t1 where a between 4 and 7)
+(select a from t1 where a < 2)
+union
+(select a from cte where exists( select a from t1 where cte.a=t1.a ));
+
+eval $q3;
+eval prepare stmt from "$q3";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+
+let $q4=
+with cte as
+(select a from t1 where a between 4 and 7)
+(select a from cte
+ where exists( select a from t1 where t1.a < 2 and cte.a=t1.a ))
+union
+(select a from cte where exists( select a from t1 where cte.a=t1.a ));
+
+eval $q4;
+eval prepare stmt from "$q4";
+execute stmt;
+execute stmt;
+deallocate prepare stmt;
+
+drop table t1;
diff --git a/mysql-test/t/explain_json.test b/mysql-test/t/explain_json.test
index d253b8380e9..c3665b1818b 100644
--- a/mysql-test/t/explain_json.test
+++ b/mysql-test/t/explain_json.test
@@ -406,3 +406,14 @@ explain format=json
select a, (select max(a) from t1 where t0.a<5 and t1.b<t0.a) from t0;
drop table t0,t1;
+--echo #
+--echo # MDEV-10844: EXPLAIN FORMAT=JSON doesn't show order direction for filesort
+--echo #
+
+create table t1 (a int, b int);
+insert into t1 values (1,2),(3,4),(2,3);
+explain format=json select * from t1 order by a, b desc;
+explain format=json select * from t1 order by a desc, b desc;
+explain format=json select * from t1 order by a desc, b ;
+drop table t1;
+
diff --git a/mysql-test/t/func_json.test b/mysql-test/t/func_json.test
index 5a5d06d456d..91fc67570f5 100644
--- a/mysql-test/t/func_json.test
+++ b/mysql-test/t/func_json.test
@@ -383,6 +383,14 @@ select json_contains_path('{"foo":"bar"}', 'one', '$[]');
#
select JSON_VALID(0x36f0c8dccd83c5eac156da);
+#
+# MDEV-13970 crash in Item_func_json_extract::read_json.
+#
+create table t1(a double not null);
+insert into t1 values (2),(1);
+select 1 from t1 where json_extract(a,'$','$[81]');
+drop table t1;
+
--echo #
--echo # Start of 10.3 tests
--echo #
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index 91ee449a7ff..9f452e632ec 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -1153,6 +1153,27 @@ SELECT str, str1, b,c FROM t1;
DROP TABLE t1;
--echo #
+--echo # MDEV-14613: Assertion `fixed == 0' failed in Item_func::fix_fields
+--echo #
+
+CREATE TABLE `t1` (
+ `numgtfmt` char(10) COLLATE utf8_bin NOT NULL
+) DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
+
+create view v1(numgtfmt)
+as
+select 'x' from t1
+union
+select 'x' from t1 ;
+
+SELECT * FROM v1 WHERE numgtfmt = NAME_CONST('wnumgtfmt',_utf8'QEDITIONS' COLLATE 'utf8_bin');
+
+# Cleanup
+DROP VIEW v1;
+DROP TABLE t1;
+
+
+--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/t/func_set.test b/mysql-test/t/func_set.test
index 47072ba5ffe..3509e225a34 100644
--- a/mysql-test/t/func_set.test
+++ b/mysql-test/t/func_set.test
@@ -136,18 +136,14 @@ SELECT * FROM t1 WHERE FIND_IN_SET(NULL, NULL) IS UNKNOWN;
--echo
DROP TABLE t1;
---echo #
---echo # Start of 5.3 tests
---echo #
--echo #
---echo # MDEV-4512 Valgrind warnings in my_long10_to_str_8bit on INTERVAL and DATE_ADD with incorrect types
+--echo # MDEV-14596 Crash in INTERVAL(ROW(..),ROW(..))
--echo #
-CREATE TABLE t1 (pk INT PRIMARY KEY);
-INSERT INTO t1 VALUES (10),(11);
-SELECT INTERVAL( 9, 1, DATE_ADD( pk, INTERVAL pk MINUTE_SECOND ), 9, 8, 3, 5, 2, 1 ) FROM t1;
-DROP TABLE t1;
---echo #
---echo # End of 5.3 tests
---echo #
+--error ER_OPERAND_COLUMNS
+SELECT INTERVAL(ROW(1,1),ROW(1,2));
+--error ER_OPERAND_COLUMNS
+SELECT INTERVAL(1,ROW(1,2));
+--error ER_OPERAND_COLUMNS
+SELECT INTERVAL(ROW(1,2),1);
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index a2df97949d8..275939df5c5 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -1790,6 +1790,32 @@ select t1.c1 as c1, t2.c2 as c1 from t1, t2 where t1.c1 < 20 and t2.c2 > 5 group
drop table t1, t2;
#
+# MDEV-12350: Heap corruption, overrun buffer, ASAN errors, server crash in my_fill_8bit / filesort
+#
+
+SET @old_sort_buff_size = @@sort_buffer_size;
+SET @@sort_buffer_size=256*1024;
+CREATE TABLE t1 (c INT) ENGINE=MyISAM;
+INSERT INTO t1 VALUES
+ (2011),(1977),(1982),(2027),(2023),(NULL),(NULL),(2004),(1974),(2032),
+ (1993),(NULL),(1995),(2034),(NULL),(2009),(1900),(NULL),(2025),(1900),
+ (2033),(1900),(2012),(NULL),(2009),(1992),(1974),(1974),(2012),(2028),
+ (2007),(2012),(1900),(1983),(1900),(2010),(1987),(1994),(1981),(2032),
+ (2010),(1989),(2014),(1900),(1900),(1976),(1978),(2007),(2030),(NULL),
+ (2002),(1997),(1900),(NULL),(2000),(2027),(1975),(2026),(1975),(2026),
+ (2029),(1977),(1900),(1900),(2031),(1993),(1986),(2012),(1979),(2013),
+ (1994),(2014),(2025),(2006),(1971),(1974),(2021),(2011),(NULL),(1991),
+ (2001),(1977),(2023),(2012),(1900),(1978),(1998),(NULL),(1988),(1999),
+ (2017),(2008),(1976),(1900),(2005),(2030),(2023),(1900),(1978),(1990),
+ (1978),(1987),(2030),(1900),(2034),(2006),(2015),(2001),(2019),(2024),
+ (2030),(1989),(1997),(2007),(2023),(1994),(1971),(2011),(2011),(2015),
+ (1984),(1978),(1979),(1989),(2008),(2030);
+
+SELECT ExtractValue('<a></a>','/a') AS f1, SPACE(c) AS f2 FROM t1 GROUP BY f1, f2 WITH ROLLUP;
+SET @@sort_buffer_size = @old_sort_buff_size;
+DROP TABLE t1;
+
+#
# End of MariaDB 5.5 tests
#
diff --git a/mysql-test/t/having.test b/mysql-test/t/having.test
index 3d8f7dc42b7..3675a09d82f 100644
--- a/mysql-test/t/having.test
+++ b/mysql-test/t/having.test
@@ -729,6 +729,23 @@ HAVING UPPER(`column_1`) LIKE '8%';
drop table t1;
--echo #
+--echo # mdev-14368: grouping query with alias for aggregate function in HAVING
+--echo # when sql_mode = 'ONLY_FULL_GROUP_BY'
+
+
+set @save_sql_mode= @@sql_mode;
+set sql_mode = 'ONLY_FULL_GROUP_BY';
+
+create table t1(a int);
+insert t1 values (4),(1),(2),(1), (3),(4);
+
+SELECT a, COUNT(a) as ct FROM t1 GROUP BY a HAVING ct>0;
+
+set sql_mode=@save_sql_mode;
+
+drop table t1;
+
+--echo #
--echo # Bug mdev-5160: two-way join with HAVING over the second table
--echo #
diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test
index 88861511d79..acbe19b5e87 100644
--- a/mysql-test/t/join_outer.test
+++ b/mysql-test/t/join_outer.test
@@ -1962,6 +1962,20 @@ DROP FUNCTION f1;
DROP TABLE t1,t2;
+--echo #
+--echo # MDEV-10397: Server crashes in key_copy with join_cache_level > 2 and join on BIT fields
+--echo #
+
+CREATE TABLE t1 (b1 BIT NOT NULL);
+INSERT INTO t1 VALUES (0),(1);
+
+CREATE TABLE t2 (b2 BIT NOT NULL);
+INSERT INTO t2 VALUES (0),(1);
+
+SET SESSION JOIN_CACHE_LEVEL = 3;
+SELECT t1.b1+'0' , t2.b2 + '0' FROM t1 LEFT JOIN t2 ON b1 = b2;
+DROP TABLE t1, t2;
+
--echo # end of 5.5 tests
SET optimizer_switch=@save_optimizer_switch;
diff --git a/mysql-test/t/mysqlbinlog_row_big.test b/mysql-test/t/mysqlbinlog_row_big.test
index 44bceaad66b..229cc8a31fc 100644
--- a/mysql-test/t/mysqlbinlog_row_big.test
+++ b/mysql-test/t/mysqlbinlog_row_big.test
@@ -146,4 +146,3 @@ DROP TABLE t1;
# NOTE: If you want to see the *huge* mysqlbinlog output, disable next line:
#
--remove_file $MYSQLTEST_VARDIR/$mysqlbinlog_output
-
diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test
index 35bb7aca085..a3db700f787 100644
--- a/mysql-test/t/openssl_1.test
+++ b/mysql-test/t/openssl_1.test
@@ -260,8 +260,9 @@ set global sql_mode=default;
# MDEV-9605 mysqlbinlog does not accept ssl-ca option as expected.
#
+--replace_regex /SSL connection error:.*/SSL connection error/
--error 1
---exec $MYSQL_BINLOG --read-from-remote-server --ssl-ca --user=root --host=localhost nobinlog.111111
+--exec $MYSQL_BINLOG --read-from-remote-server --ssl-ca --user=root --host=localhost nobinlog.111111 2>&1
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/ps.test b/mysql-test/t/ps.test
index 2a16a807542..3121dae2d9f 100644
--- a/mysql-test/t/ps.test
+++ b/mysql-test/t/ps.test
@@ -3857,6 +3857,21 @@ deallocate prepare stmt;
drop view v1,v2,v3;
drop table t1,t2,t3;
+--echo #
+--echo # MDEV-10657: incorrect result returned with binary protocol
+--echo # (prepared statements)
+--echo #
+
+create table t1 (code varchar(10) primary key);
+INSERT INTO t1(code) VALUES ('LINE1'), ('LINE2'), ('LINE3');
+SELECT X.*
+FROM
+ (SELECT CODE, RN
+ FROM
+ (SELECT A.CODE, @cnt := @cnt + 1 AS RN
+ FROM t1 A, (SELECT @cnt := 0) C) T
+ ) X;
+drop table t1;
--echo # End of 5.5 tests
--echo #
@@ -4531,6 +4546,39 @@ DROP TABLE t1;
DROP PROCEDURE p1;
--echo #
+--echo # MDEV-14426 Assertion in Diagnostics_area::set_error_status when using a bad datetime with PS and SP
+--echo #
+
+DELIMITER $$;
+CREATE PROCEDURE p1(OUT a VARCHAR(20))
+BEGIN
+ SET a=10;
+END;
+$$
+--error ER_TRUNCATED_WRONG_VALUE
+BEGIN NOT ATOMIC
+ DECLARE a DATETIME;
+ CALL p1(a);
+END;
+$$
+--error ER_TRUNCATED_WRONG_VALUE
+BEGIN NOT ATOMIC
+ DECLARE a DATETIME;
+ EXECUTE IMMEDIATE 'CALL p1(?)' USING a;
+END;
+$$
+--error ER_TRUNCATED_WRONG_VALUE
+BEGIN NOT ATOMIC
+ DECLARE a DATETIME;
+ PREPARE stmt FROM 'CALL p1(?)';
+ EXECUTE stmt USING a;
+ DEALLOCATE PREPARE stmt;
+END;
+$$
+DELIMITER ;$$
+DROP PROCEDURE p1;
+
+--echo #
--echo # MDEV-14454 Binary protocol returns wrong collation ID for SP OUT parameters
--echo #
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 847fb843ec8..a8d0ac836ae 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -5519,6 +5519,18 @@ PREPARE stmt FROM 'REPLACE INTO v2 SELECT a FROM t3';
drop view v1,v2;
drop table t3;
+--echo #
+--echo # MDEV-14619: VIEW and GROUP_CONCAT
+--echo #
+
+CREATE TABLE t1 (str text);
+INSERT INTO t1 VALUES ("My"),("SQL");
+CREATE VIEW v1 AS SELECT GROUP_CONCAT(str SEPARATOR '\\') FROM t1;
+SELECT * FROM v1;
+SHOW CREATE VIEW v1;
+drop view v1;
+drop table t1;
+
--echo # -----------------------------------------------------------------
--echo # -- End of 5.5 tests.
--echo # -----------------------------------------------------------------
diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test
index 76625bd4e92..bbb2ca7948f 100644
--- a/mysql-test/t/xml.test
+++ b/mysql-test/t/xml.test
@@ -713,7 +713,7 @@ FROM t1;
SELECT UPDATEXML(txt, CONCAT('//', REPEAT('b', 63)), '63/63+') FROM t1;
DROP TABLE t1;
-# This will call my_str_realloc_mysqld()
+# This will call realloc()
CREATE TABLE t1 (a TEXT);
INSERT INTO t1 VALUES (CONCAT('<a><', REPEAT('b',128),'>b128</',REPEAT('b',128),'><',REPEAT('c',512),'>c512</',REPEAT('c',512),'></a>'));
SELECT ExtractValue (a, CONCAT('//',REPEAT('c',512))) AS c512 FROM t1;
diff --git a/mysys/mf_iocache.c b/mysys/mf_iocache.c
index a52ea2c5c40..4dd0f7500aa 100644
--- a/mysys/mf_iocache.c
+++ b/mysys/mf_iocache.c
@@ -115,6 +115,7 @@ init_functions(IO_CACHE* info)
DBUG_ASSERT(!(info->myflags & MY_ENCRYPT));
info->read_function = info->share ? _my_b_cache_read_r : _my_b_cache_read;
info->write_function = info->share ? _my_b_cache_write_r : _my_b_cache_write;
+ info->myflags&= ~MY_FULL_IO;
break;
case TYPE_NOT_SET:
DBUG_ASSERT(0);
@@ -455,6 +456,8 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type,
{
info->read_end=info->write_pos;
info->end_of_file=my_b_tell(info);
+ /* Ensure we will read all data */
+ info->myflags|= MY_FULL_IO;
/*
Trigger a new seek only if we have a valid
file handle.
@@ -469,6 +472,7 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type,
info->seek_not_done=1;
}
info->end_of_file = ~(my_off_t) 0;
+ info->myflags&= ~MY_FULL_IO;
}
pos=info->request_pos+(seek_offset-info->pos_in_file);
if (type == WRITE_CACHE)
@@ -1917,13 +1921,12 @@ int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock)
{
if (append_cache)
{
-
if (mysql_file_write(info->file, info->write_buffer, length,
info->myflags | MY_NABP))
+ {
info->error= -1;
- else
- info->error= 0;
-
+ DBUG_RETURN(-1);
+ }
info->end_of_file+= info->write_pos - info->append_read_pos;
info->append_read_pos= info->write_buffer;
DBUG_ASSERT(info->end_of_file == mysql_file_tell(info->file, MYF(0)));
diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c
index 2499094037d..ef163ee24d3 100644
--- a/mysys/mf_iocache2.c
+++ b/mysys/mf_iocache2.c
@@ -249,18 +249,16 @@ my_off_t my_b_filelength(IO_CACHE *info)
}
-size_t
+my_bool
my_b_write_backtick_quote(IO_CACHE *info, const char *str, size_t len)
{
const uchar *start;
const uchar *p= (const uchar *)str;
const uchar *end= p + len;
size_t count;
- size_t total= 0;
if (my_b_write(info, (uchar *)"`", 1))
- return (size_t)-1;
- ++total;
+ return 1;
for (;;)
{
start= p;
@@ -268,35 +266,32 @@ my_b_write_backtick_quote(IO_CACHE *info, const char *str, size_t len)
++p;
count= p - start;
if (count && my_b_write(info, start, count))
- return (size_t)-1;
- total+= count;
+ return 1;
if (p >= end)
break;
if (my_b_write(info, (uchar *)"``", 2))
- return (size_t)-1;
- total+= 2;
+ return 1;
++p;
}
- if (my_b_write(info, (uchar *)"`", 1))
- return (size_t)-1;
- ++total;
- return total;
+ return (my_b_write(info, (uchar *)"`", 1));
}
/*
Simple printf version. Supports '%s', '%d', '%u', "%ld" and "%lu"
- Used for logging in MySQL
- returns number of written character, or (size_t) -1 on error
+ Used for logging in MariaDB
+
+ @return 0 ok
+ 1 error
*/
-size_t my_b_printf(IO_CACHE *info, const char* fmt, ...)
+my_bool my_b_printf(IO_CACHE *info, const char* fmt, ...)
{
size_t result;
va_list args;
va_start(args,fmt);
result=my_b_vprintf(info, fmt, args);
va_end(args);
- return result;
+ return result == (size_t) -1;
}
diff --git a/mysys/my_default.c b/mysys/my_default.c
index 37f6d2bfbbf..1c8e976d8dc 100644
--- a/mysys/my_default.c
+++ b/mysys/my_default.c
@@ -487,8 +487,7 @@ int load_defaults(const char *conf_file, const char **groups,
easily command line options override options in configuration files
NOTES
- In case of fatal error, the function will print a warning and do
- exit(1)
+ In case of fatal error, the function will print a warning and returns 2
To free used memory one should call free_defaults() with the argument
that was put in *argv
@@ -641,8 +640,7 @@ int my_load_defaults(const char *conf_file, const char **groups,
err:
fprintf(stderr,"Fatal error in defaults handling. Program aborted\n");
- exit(1);
- return 0; /* Keep compiler happy */
+ return 2;
}
diff --git a/mysys/my_malloc.c b/mysys/my_malloc.c
index 2b022522f67..6b24f777aaa 100644
--- a/mysys/my_malloc.c
+++ b/mysys/my_malloc.c
@@ -109,7 +109,7 @@ void *my_malloc(size_t size, myf my_flags)
my_error(EE_OUTOFMEMORY, MYF(ME_BELL + ME_WAITTANG +
ME_NOREFRESH + ME_FATALERROR),size);
if (my_flags & MY_FAE)
- exit(1);
+ abort();
}
else
{
diff --git a/mysys/my_read.c b/mysys/my_read.c
index 922da5a7e95..89b368e9800 100644
--- a/mysys/my_read.c
+++ b/mysys/my_read.c
@@ -35,11 +35,10 @@
size_t my_read(File Filedes, uchar *Buffer, size_t Count, myf MyFlags)
{
- size_t readbytes, save_count;
+ size_t readbytes, save_count= 0;
DBUG_ENTER("my_read");
DBUG_PRINT("my",("fd: %d Buffer: %p Count: %lu MyFlags: %lu",
Filedes, Buffer, (ulong) Count, MyFlags));
- save_count= Count;
if (!(MyFlags & (MY_WME | MY_FAE | MY_FNABP)))
MyFlags|= my_global_flags;
@@ -61,47 +60,52 @@ size_t my_read(File Filedes, uchar *Buffer, size_t Count, myf MyFlags)
if (readbytes != Count)
{
- my_errno= errno;
- if (errno == 0 || (readbytes != (size_t) -1 &&
- (MyFlags & (MY_NABP | MY_FNABP))))
- my_errno= HA_ERR_FILE_TOO_SHORT;
+ int got_errno= my_errno= errno;
DBUG_PRINT("warning",("Read only %d bytes off %lu from %d, errno: %d",
(int) readbytes, (ulong) Count, Filedes,
- my_errno));
+ got_errno));
+
+ if (got_errno == 0 || (readbytes != (size_t) -1 &&
+ (MyFlags & (MY_NABP | MY_FNABP))))
+ my_errno= HA_ERR_FILE_TOO_SHORT;
- if ((readbytes == 0 || (int) readbytes == -1) && errno == EINTR)
+ if ((readbytes == 0 || (int) readbytes == -1) && got_errno == EINTR)
{
DBUG_PRINT("debug", ("my_read() was interrupted and returned %ld",
(long) readbytes));
continue; /* Interrupted */
}
+ /* Do a read retry if we didn't get enough data on first read */
+ if (readbytes != (size_t) -1 && readbytes != 0 &&
+ (MyFlags & MY_FULL_IO))
+ {
+ Buffer+= readbytes;
+ Count-= readbytes;
+ save_count+= readbytes;
+ continue;
+ }
+
if (MyFlags & (MY_WME | MY_FAE | MY_FNABP))
{
if (readbytes == (size_t) -1)
my_error(EE_READ,
MYF(ME_BELL | ME_WAITTANG | (MyFlags & (ME_JUST_INFO | ME_NOREFRESH))),
- my_filename(Filedes),my_errno);
+ my_filename(Filedes), got_errno);
else if (MyFlags & (MY_NABP | MY_FNABP))
my_error(EE_EOFERR,
MYF(ME_BELL | ME_WAITTANG | (MyFlags & (ME_JUST_INFO | ME_NOREFRESH))),
- my_filename(Filedes),my_errno);
+ my_filename(Filedes), got_errno);
}
if (readbytes == (size_t) -1 ||
((MyFlags & (MY_FNABP | MY_NABP)) && !(MyFlags & MY_FULL_IO)))
DBUG_RETURN(MY_FILE_ERROR); /* Return with error */
- if (readbytes != (size_t) -1 && (MyFlags & MY_FULL_IO))
- {
- Buffer+= readbytes;
- Count-= readbytes;
- continue;
- }
}
if (MyFlags & (MY_NABP | MY_FNABP))
readbytes= 0; /* Ok on read */
- else if (MyFlags & MY_FULL_IO)
- readbytes= save_count;
+ else
+ readbytes+= save_count;
break;
}
DBUG_RETURN(readbytes);
diff --git a/mysys/typelib.c b/mysys/typelib.c
index e45ede2c43a..f0be211fd46 100644
--- a/mysys/typelib.c
+++ b/mysys/typelib.c
@@ -45,18 +45,6 @@ int find_type_with_warning(const char *x, TYPELIB *typelib, const char *option)
}
-int find_type_or_exit(const char *x, TYPELIB *typelib, const char *option)
-{
- int res;
- if ((res= find_type_with_warning(x, typelib, option)) <= 0)
- {
- sf_leaking_memory= 1; /* no memory leak reports here */
- exit(1);
- }
- return res;
-}
-
-
/**
Search after a string in a list of strings. Endspace in x is not compared.
diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh
index 80a93c979ac..c0be1ea6e60 100644
--- a/scripts/mysqld_safe.sh
+++ b/scripts/mysqld_safe.sh
@@ -977,8 +977,8 @@ if expr "${-}" : '.*x' > /dev/null
then
:
else
- exec 1>&-
- exec 2>&-
+ exec 1>/dev/null
+ exec 2>/dev/null
fi
# maximum number of wsrep restarts
diff --git a/scripts/wsrep_sst_xtrabackup-v2.sh b/scripts/wsrep_sst_xtrabackup-v2.sh
index 40e686d4d6b..9284bf78019 100644
--- a/scripts/wsrep_sst_xtrabackup-v2.sh
+++ b/scripts/wsrep_sst_xtrabackup-v2.sh
@@ -1072,7 +1072,7 @@ then
wsrep_log_info "Cleaning the existing datadir and innodb-data/log directories"
- find $ib_home_dir $ib_log_dir $ib_undo_dir $DATA -mindepth 1 -regex $cpat -prune -o -exec rm -rfv {} 1>&2 \+
+ find $ib_home_dir $ib_log_dir $ib_undo_dir $DATA -mindepth 1 -prune -regex $cpat -o -exec rm -rfv {} 1>&2 \+
tempdir=$(parse_cnf mysqld log-bin "")
if [[ -n ${tempdir:-} ]];then
diff --git a/sql-common/client.c b/sql-common/client.c
index d2dc79672db..163589a3978 100644
--- a/sql-common/client.c
+++ b/sql-common/client.c
@@ -1234,11 +1234,12 @@ void mysql_read_default_options(struct st_mysql_options *options,
options->max_allowed_packet= atoi(opt_arg);
break;
case OPT_protocol:
- if ((options->protocol= find_type(opt_arg, &sql_protocol_typelib,
+ if (options->protocol != UINT_MAX32 &&
+ (options->protocol= find_type(opt_arg, &sql_protocol_typelib,
FIND_TYPE_BASIC)) <= 0)
{
fprintf(stderr, "Unknown option to protocol: %s\n", opt_arg);
- exit(1);
+ options->protocol= UINT_MAX32;
}
break;
case OPT_shared_memory_base_name:
@@ -3133,6 +3134,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
my_free(mysql->options.my_cnf_file);
my_free(mysql->options.my_cnf_group);
mysql->options.my_cnf_file=mysql->options.my_cnf_group=0;
+ if (mysql->options.protocol == UINT_MAX32)
+ goto error;
}
/* Some empty-string-tests are done because of ODBC */
diff --git a/sql/events.cc b/sql/events.cc
index 36f03e26125..3ad546217a7 100644
--- a/sql/events.cc
+++ b/sql/events.cc
@@ -421,7 +421,7 @@ Events::create_event(THD *thd, Event_parse_data *parse_data)
DBUG_RETURN(ret);
#ifdef WITH_WSREP
error:
- DBUG_RETURN(true);
+ DBUG_RETURN(TRUE);
#endif /* WITH_WSREP */
}
diff --git a/sql/filesort.cc b/sql/filesort.cc
index b762773b11e..4cf2a00dbc4 100644
--- a/sql/filesort.cc
+++ b/sql/filesort.cc
@@ -710,6 +710,7 @@ static ha_rows find_all_keys(THD *thd, Sort_param *param, SQL_SELECT *select,
handler *file;
MY_BITMAP *save_read_set, *save_write_set, *save_vcol_set;
Item *sort_cond;
+ ha_rows retval;
DBUG_ENTER("find_all_keys");
DBUG_PRINT("info",("using: %s",
(select ? select->quick ? "ranges" : "where":
@@ -767,7 +768,7 @@ static ha_rows find_all_keys(THD *thd, Sort_param *param, SQL_SELECT *select,
if (quick_select)
{
if (select->quick->reset())
- DBUG_RETURN(HA_POS_ERROR);
+ goto err;
}
DEBUG_SYNC(thd, "after_index_merge_phase1");
@@ -804,7 +805,7 @@ static ha_rows find_all_keys(THD *thd, Sort_param *param, SQL_SELECT *select,
(void) file->extra(HA_EXTRA_NO_CACHE);
file->ha_rnd_end();
}
- DBUG_RETURN(HA_POS_ERROR); /* purecov: inspected */
+ goto err; /* purecov: inspected */
}
bool write_record= false;
@@ -852,7 +853,7 @@ static ha_rows find_all_keys(THD *thd, Sort_param *param, SQL_SELECT *select,
if (idx == param->max_keys_per_buffer)
{
if (write_keys(param, fs_info, idx, buffpek_pointers, tempfile))
- DBUG_RETURN(HA_POS_ERROR);
+ goto err;
idx= 0;
indexpos++;
}
@@ -878,12 +879,12 @@ static ha_rows find_all_keys(THD *thd, Sort_param *param, SQL_SELECT *select,
file->ha_rnd_end();
}
- if (thd->is_error())
- DBUG_RETURN(HA_POS_ERROR);
-
/* Signal we should use orignal column read and write maps */
sort_form->column_bitmaps_set(save_read_set, save_write_set, save_vcol_set);
+ if (thd->is_error())
+ DBUG_RETURN(HA_POS_ERROR);
+
DBUG_PRINT("test",("error: %d indexpos: %d",error,indexpos));
if (error != HA_ERR_END_OF_FILE)
{
@@ -893,11 +894,15 @@ static ha_rows find_all_keys(THD *thd, Sort_param *param, SQL_SELECT *select,
if (indexpos && idx &&
write_keys(param, fs_info, idx, buffpek_pointers, tempfile))
DBUG_RETURN(HA_POS_ERROR); /* purecov: inspected */
- const ha_rows retval=
- my_b_inited(tempfile) ?
- (ha_rows) (my_b_tell(tempfile)/param->rec_length) : idx;
+ retval= (my_b_inited(tempfile) ?
+ (ha_rows) (my_b_tell(tempfile)/param->rec_length) :
+ idx);
DBUG_PRINT("info", ("find_all_keys return %llu", (ulonglong) retval));
DBUG_RETURN(retval);
+
+err:
+ sort_form->column_bitmaps_set(save_read_set, save_write_set, save_vcol_set);
+ DBUG_RETURN(HA_POS_ERROR);
} /* find_all_keys */
@@ -995,7 +1000,8 @@ Type_handler_string_result::make_sort_key(uchar *to, Item *item,
if (maybe_null)
*to++= 1;
char *tmp_buffer= param->tmp_buffer ? param->tmp_buffer : (char*) to;
- String tmp(tmp_buffer, param->sort_length, cs);
+ String tmp(tmp_buffer, param->tmp_buffer ? param->sort_length :
+ sort_field->length, cs);
String *res= item->str_result(&tmp);
if (!res)
{
diff --git a/sql/filesort_utils.cc b/sql/filesort_utils.cc
index 11be9229c1d..b39bb880c15 100644
--- a/sql/filesort_utils.cc
+++ b/sql/filesort_utils.cc
@@ -105,7 +105,7 @@ uchar **Filesort_buffer::alloc_sort_buffer(uint num_records,
DBUG_EXECUTE_IF("alloc_sort_buffer_fail",
DBUG_SET("+d,simulate_out_of_memory"););
- buff_size= num_records * (record_length + sizeof(uchar*));
+ buff_size= ((size_t)num_records) * (record_length + sizeof(uchar*));
set_if_bigger(buff_size, record_length * MERGEBUFF2);
if (!m_idx_array.is_null())
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index e2d6bb1bdfe..44ae66c76c8 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -2204,38 +2204,19 @@ void ha_partition::update_create_info(HA_CREATE_INFO *create_info)
DBUG_ASSERT(sub_elem);
part= i * num_subparts + j;
DBUG_ASSERT(part < m_file_tot_parts && m_file[part]);
- if (ha_legacy_type(m_file[part]->ht) == DB_TYPE_INNODB)
- {
- dummy_info.data_file_name= dummy_info.index_file_name= NULL;
- m_file[part]->update_create_info(&dummy_info);
-
- if (dummy_info.data_file_name || sub_elem->data_file_name)
- {
- sub_elem->data_file_name= (char*) dummy_info.data_file_name;
- }
- if (dummy_info.index_file_name || sub_elem->index_file_name)
- {
- sub_elem->index_file_name= (char*) dummy_info.index_file_name;
- }
- }
+ dummy_info.data_file_name= dummy_info.index_file_name = NULL;
+ m_file[part]->update_create_info(&dummy_info);
+ sub_elem->data_file_name = (char*) dummy_info.data_file_name;
+ sub_elem->index_file_name = (char*) dummy_info.index_file_name;
}
}
else
{
DBUG_ASSERT(m_file[i]);
- if (ha_legacy_type(m_file[i]->ht) == DB_TYPE_INNODB)
- {
- dummy_info.data_file_name= dummy_info.index_file_name= NULL;
- m_file[i]->update_create_info(&dummy_info);
- if (dummy_info.data_file_name || part_elem->data_file_name)
- {
- part_elem->data_file_name= (char*) dummy_info.data_file_name;
- }
- if (dummy_info.index_file_name || part_elem->index_file_name)
- {
- part_elem->index_file_name= (char*) dummy_info.index_file_name;
- }
- }
+ dummy_info.data_file_name= dummy_info.index_file_name= NULL;
+ m_file[i]->update_create_info(&dummy_info);
+ part_elem->data_file_name = (char*) dummy_info.data_file_name;
+ part_elem->index_file_name = (char*) dummy_info.index_file_name;
}
}
DBUG_VOID_RETURN;
@@ -9681,20 +9662,36 @@ uint ha_partition::alter_table_flags(uint flags)
bool ha_partition::check_if_incompatible_data(HA_CREATE_INFO *create_info,
uint table_changes)
{
- handler **file;
- bool ret= COMPATIBLE_DATA_YES;
-
/*
The check for any partitioning related changes have already been done
in mysql_alter_table (by fix_partition_func), so it is only up to
the underlying handlers.
*/
- for (file= m_file; *file; file++)
- if ((ret= (*file)->check_if_incompatible_data(create_info,
- table_changes)) !=
- COMPATIBLE_DATA_YES)
- break;
- return ret;
+ List_iterator<partition_element> part_it(m_part_info->partitions);
+ HA_CREATE_INFO dummy_info= *create_info;
+ uint i=0;
+ while (partition_element *part_elem= part_it++)
+ {
+ if (m_is_sub_partitioned)
+ {
+ List_iterator<partition_element> subpart_it(part_elem->subpartitions);
+ while (partition_element *sub_elem= subpart_it++)
+ {
+ dummy_info.data_file_name= sub_elem->data_file_name;
+ dummy_info.index_file_name= sub_elem->index_file_name;
+ if (m_file[i++]->check_if_incompatible_data(&dummy_info, table_changes))
+ return COMPATIBLE_DATA_NO;
+ }
+ }
+ else
+ {
+ dummy_info.data_file_name= part_elem->data_file_name;
+ dummy_info.index_file_name= part_elem->index_file_name;
+ if (m_file[i++]->check_if_incompatible_data(&dummy_info, table_changes))
+ return COMPATIBLE_DATA_NO;
+ }
+ }
+ return COMPATIBLE_DATA_YES;
}
diff --git a/sql/item.cc b/sql/item.cc
index 805ddb2918f..ddc0813933a 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -2185,8 +2185,10 @@ bool Item_name_const::fix_fields(THD *thd, Item **ref)
String s(buf, sizeof(buf), &my_charset_bin);
s.length(0);
- if (value_item->fix_fields(thd, &value_item) ||
- name_item->fix_fields(thd, &name_item) ||
+ if ((!value_item->fixed &&
+ value_item->fix_fields(thd, &value_item)) ||
+ (!name_item->fixed &&
+ name_item->fix_fields(thd, &name_item)) ||
!value_item->const_item() ||
!name_item->const_item() ||
!(item_name= name_item->val_str(&s))) // Can't have a NULL name
@@ -5569,7 +5571,8 @@ resolve_ref_in_select_and_group(THD *thd, Item_ident *ref, SELECT_LEX *select)
if (thd->variables.sql_mode & MODE_ONLY_FULL_GROUP_BY &&
select->having_fix_field &&
- select_ref != not_found_item && !group_by_ref)
+ select_ref != not_found_item && !group_by_ref &&
+ !ref->alias_name_used)
{
/*
Report the error if fields was found only in the SELECT item list and
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index dff5fb5df0f..00ee42ac487 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -1839,6 +1839,19 @@ bool Item_func_opt_neg::eq(const Item *item, bool binary_cmp) const
}
+bool Item_func_interval::fix_fields(THD *thd, Item **ref)
+{
+ if (Item_long_func::fix_fields(thd, ref))
+ return true;
+ for (uint i= 0 ; i < row->cols(); i++)
+ {
+ if (row->element_index(i)->check_cols(1))
+ return true;
+ }
+ return false;
+}
+
+
void Item_func_interval::fix_length_and_dec()
{
uint rows= row->cols();
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 1561a78a12a..8b47f09497f 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -976,6 +976,7 @@ public:
Item_func_interval(THD *thd, Item_row *a):
Item_long_func(thd, a), row(a), intervals(0)
{ }
+ bool fix_fields(THD *, Item **);
longlong val_int();
void fix_length_and_dec();
const char *func_name() const { return "interval"; }
diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc
index 7afb94ba332..4b2de7cf28b 100644
--- a/sql/item_jsonfunc.cc
+++ b/sql/item_jsonfunc.cc
@@ -781,10 +781,10 @@ String *Item_func_json_extract::read_json(String *str,
{
str->set_charset(js->charset());
str->length(0);
- }
- if (possible_multiple_values && str->append("[", 1))
- goto error;
+ if (possible_multiple_values && str->append("[", 1))
+ goto error;
+ }
json_get_path_start(&je, js->charset(),(const uchar *) js->ptr(),
(const uchar *) js->ptr() + js->length(), &p);
diff --git a/sql/item_sum.cc b/sql/item_sum.cc
index d4abdfc614f..945224c2623 100644
--- a/sql/item_sum.cc
+++ b/sql/item_sum.cc
@@ -4136,7 +4136,7 @@ void Item_func_group_concat::print(String *str, enum_query_type query_type)
}
}
str->append(STRING_WITH_LEN(" separator \'"));
- str->append(*separator);
+ str->append_for_single_quote(separator->ptr(), separator->length());
str->append(STRING_WITH_LEN("\')"));
}
diff --git a/sql/log.cc b/sql/log.cc
index bdf0b6fdc59..6923a6241cd 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -2470,7 +2470,7 @@ static int find_uniq_filename(char *name, ulong next_log_number)
char buff[FN_REFLEN], ext_buf[FN_REFLEN];
struct st_my_dir *dir_info;
reg1 struct fileinfo *file_info;
- ulong max_found, next, number;
+ ulong max_found, next, UNINIT_VAR(number);
size_t buf_length, length;
char *start, *end;
int error= 0;
@@ -2993,7 +2993,6 @@ bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time,
mysql_mutex_lock(&LOCK_log);
if (is_open())
{ // Safety agains reopen
- int tmp_errno= 0;
char buff[80], *end;
char query_time_buff[22+7], lock_time_buff[22+7];
size_t buff_len;
@@ -3015,16 +3014,13 @@ bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time,
/* Note that my_b_write() assumes it knows the length for this */
if (my_b_write(&log_file, (uchar*) buff, buff_len))
- tmp_errno= errno;
+ goto err;
}
const uchar uh[]= "# User@Host: ";
- if (my_b_write(&log_file, uh, sizeof(uh) - 1))
- tmp_errno= errno;
- if (my_b_write(&log_file, (uchar*) user_host, user_host_len))
- tmp_errno= errno;
- if (my_b_write(&log_file, (uchar*) "\n", 1))
- tmp_errno= errno;
- }
+ if (my_b_write(&log_file, uh, sizeof(uh) - 1) ||
+ my_b_write(&log_file, (uchar*) user_host, user_host_len) ||
+ my_b_write(&log_file, (uchar*) "\n", 1))
+ goto err;
/* For slow query log */
sprintf(query_time_buff, "%.6f", ulonglong2double(query_utime)/1000000.0);
@@ -3039,9 +3035,8 @@ bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time,
(ulong) thd->get_sent_row_count(),
(ulong) thd->get_examined_row_count(),
(ulong) thd->get_affected_rows(),
- (ulong) (thd->status_var.bytes_sent - thd->bytes_sent_old))
- == (size_t) -1)
- tmp_errno= errno;
+ (ulong) (thd->status_var.bytes_sent - thd->bytes_sent_old)))
+ goto err;
if ((thd->variables.log_slow_verbosity & LOG_SLOW_VERBOSITY_QUERY_PLAN)
&& thd->tmp_tables_used &&
@@ -3050,13 +3045,13 @@ bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time,
"Tmp_table_sizes: %s\n",
(ulong) thd->tmp_tables_used,
(ulong) thd->tmp_tables_disk_used,
- llstr(thd->tmp_tables_size, llbuff)) == (uint) -1)
- tmp_errno= errno;
+ llstr(thd->tmp_tables_size, llbuff)))
+ goto err;
- if (thd->spcont)
- if (my_b_printf(&log_file, "# Stored_routine: %s\n",
- ErrConvDQName(thd->spcont->m_sp).ptr()) == (uint) -1)
- tmp_errno= errno;
+ if (thd->spcont &&
+ my_b_printf(&log_file, "# Stored_routine: %s\n",
+ ErrConvDQName(thd->spcont->m_sp).ptr()))
+ goto err;
if ((thd->variables.log_slow_verbosity & LOG_SLOW_VERBOSITY_QUERY_PLAN) &&
(thd->query_plan_flags &
@@ -3078,21 +3073,22 @@ bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time,
thd->query_plan_fsort_passes,
((thd->query_plan_flags & QPLAN_FILESORT_PRIORITY_QUEUE) ?
"Yes" : "No")
- ) == (size_t) -1)
- tmp_errno= errno;
+ ))
+ goto err;
if (thd->variables.log_slow_verbosity & LOG_SLOW_VERBOSITY_EXPLAIN &&
thd->lex->explain)
{
StringBuffer<128> buf;
DBUG_ASSERT(!thd->free_list);
if (!print_explain_for_slow_log(thd->lex, thd, &buf))
- my_b_printf(&log_file, "%s", buf.c_ptr_safe());
+ if (my_b_printf(&log_file, "%s", buf.c_ptr_safe()))
+ goto err;
thd->free_items();
}
if (thd->db && strcmp(thd->db, db))
{ // Database changed
- if (my_b_printf(&log_file,"use %s;\n",thd->db) == (size_t) -1)
- tmp_errno= errno;
+ if (my_b_printf(&log_file,"use %s;\n",thd->db))
+ goto err;
strmov(db,thd->db);
}
if (thd->stmt_depends_on_first_successful_insert_id_in_prev_stmt)
@@ -3128,7 +3124,7 @@ bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time,
*end='\n';
if (my_b_write(&log_file, (uchar*) "SET ", 4) ||
my_b_write(&log_file, (uchar*) buff + 1, (uint) (end-buff)))
- tmp_errno= errno;
+ goto err;
}
if (is_command)
{
@@ -3137,24 +3133,27 @@ bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time,
DBUG_EXECUTE_IF("simulate_slow_log_write_error",
{DBUG_SET("+d,simulate_file_write_error");});
if(my_b_write(&log_file, (uchar*) buff, buff_len))
- tmp_errno= errno;
+ goto err;
}
if (my_b_write(&log_file, (uchar*) sql_text, sql_text_len) ||
my_b_write(&log_file, (uchar*) ";\n",2) ||
flush_io_cache(&log_file))
- tmp_errno= errno;
- if (tmp_errno)
- {
- error= 1;
- if (! write_error)
- {
- write_error= 1;
- sql_print_error(ER_THD(thd, ER_ERROR_ON_WRITE), name, tmp_errno);
- }
+ goto err;
+
}
}
+end:
mysql_mutex_unlock(&LOCK_log);
DBUG_RETURN(error);
+
+err:
+ error= 1;
+ if (! write_error)
+ {
+ write_error= 1;
+ sql_print_error(ER_THD(thd, ER_ERROR_ON_WRITE), name, errno);
+ }
+ goto end;
}
@@ -3650,6 +3649,7 @@ bool MYSQL_BIN_LOG::open(const char *log_name,
new_xid_list_entry->binlog_name= name_mem;
new_xid_list_entry->binlog_name_len= len;
new_xid_list_entry->xid_count= 0;
+ new_xid_list_entry->notify_count= 0;
/*
Find the name for the Initial binlog checkpoint.
@@ -5006,7 +5006,55 @@ MYSQL_BIN_LOG::is_xidlist_idle_nolock()
return true;
}
+#ifdef WITH_WSREP
+inline bool
+is_gtid_cached_internal(IO_CACHE *file)
+{
+ uchar data[EVENT_TYPE_OFFSET+1];
+ bool result= false;
+ my_off_t write_pos= my_b_tell(file);
+ if (reinit_io_cache(file, READ_CACHE, 0, 0, 0))
+ return false;
+ /*
+ In the cache we have gtid event if , below condition is true,
+ */
+ my_b_read(file, data, sizeof(data));
+ uint event_type= (uchar)data[EVENT_TYPE_OFFSET];
+ if (event_type == GTID_LOG_EVENT)
+ result= true;
+ /*
+ Cleanup , Why because we have not read the full buffer
+ and this will cause next to next reinit_io_cache(called in write_cache)
+ to make cache empty.
+ */
+ file->read_pos= file->read_end;
+ if (reinit_io_cache(file, WRITE_CACHE, write_pos, 0, 0))
+ return false;
+ return result;
+}
+#endif
+#ifdef WITH_WSREP
+inline bool
+MYSQL_BIN_LOG::is_gtid_cached(THD *thd)
+{
+ binlog_cache_mngr *mngr= (binlog_cache_mngr *) thd_get_ha_data(
+ thd, binlog_hton);
+ if (!mngr)
+ return false;
+ binlog_cache_data *cache_trans= mngr->get_binlog_cache_data(
+ use_trans_cache(thd, true));
+ binlog_cache_data *cache_stmt= mngr->get_binlog_cache_data(
+ use_trans_cache(thd, false));
+ if (cache_trans && !cache_trans->empty() &&
+ is_gtid_cached_internal(&cache_trans->cache_log))
+ return true;
+ if (cache_stmt && !cache_stmt->empty() &&
+ is_gtid_cached_internal(&cache_stmt->cache_log))
+ return true;
+ return false;
+}
+#endif
/**
Create a new log file name.
@@ -5611,7 +5659,36 @@ THD::binlog_start_trans_and_stmt()
cache_mngr->trx_cache.get_prev_position() == MY_OFF_T_UNDEF)
{
this->binlog_set_stmt_begin();
- if (in_multi_stmt_transaction_mode())
+ bool mstmt_mode= in_multi_stmt_transaction_mode();
+#ifdef WITH_WSREP
+ /* Write Gtid
+ Get domain id only when gtid mode is set
+ If this event is replicate through a master then ,
+ we will forward the same gtid another nodes
+ We have to do this only one time in mysql transaction.
+ Since this function is called multiple times , We will check for
+ ha_info->is_started()
+ */
+ Ha_trx_info *ha_info;
+ ha_info= this->ha_data[binlog_hton->slot].ha_info + (mstmt_mode ? 1 : 0);
+
+ if (!ha_info->is_started() && wsrep_gtid_mode
+ && this->variables.gtid_seq_no)
+ {
+ binlog_cache_mngr *const cache_mngr=
+ (binlog_cache_mngr*) thd_get_ha_data(this, binlog_hton);
+ binlog_cache_data *cache_data= cache_mngr->get_binlog_cache_data(1);
+ IO_CACHE *file= &cache_data->cache_log;
+ Log_event_writer writer(file, cache_data);
+ Gtid_log_event gtid_event(this, this->variables.gtid_seq_no,
+ this->variables.gtid_domain_id,
+ true, LOG_EVENT_SUPPRESS_USE_F,
+ true, 0);
+ gtid_event.server_id= this->variables.server_id;
+ writer.write(&gtid_event);
+ }
+#endif
+ if (mstmt_mode)
trans_register_ha(this, TRUE, binlog_hton);
trans_register_ha(this, FALSE, binlog_hton);
/*
@@ -5891,7 +5968,7 @@ MYSQL_BIN_LOG::write_gtid_event(THD *thd, bool standalone,
DBUG_PRINT("enter", ("standalone: %d", standalone));
#ifdef WITH_WSREP
- if (WSREP(thd) && thd->wsrep_trx_meta.gtid.seqno != -1 && wsrep_gtid_mode)
+ if (WSREP(thd) && thd->wsrep_trx_meta.gtid.seqno != -1 && wsrep_gtid_mode && !thd->variables.gtid_seq_no)
{
domain_id= wsrep_gtid_domain_id;
} else {
@@ -5945,6 +6022,12 @@ MYSQL_BIN_LOG::write_gtid_event(THD *thd, bool standalone,
/* Write the event to the binary log. */
DBUG_ASSERT(this == &mysql_bin_log);
+
+#ifdef WITH_WSREP
+ if (wsrep_gtid_mode && is_gtid_cached(thd))
+ DBUG_RETURN(false);
+#endif
+
if (write_event(&gtid_event))
DBUG_RETURN(true);
status_var_add(thd->status_var.binlog_bytes_written, gtid_event.data_written);
@@ -9720,9 +9803,20 @@ void
TC_LOG_BINLOG::commit_checkpoint_notify(void *cookie)
{
xid_count_per_binlog *entry= static_cast<xid_count_per_binlog *>(cookie);
+ bool found_entry= false;
mysql_mutex_lock(&LOCK_binlog_background_thread);
- entry->next_in_queue= binlog_background_thread_queue;
- binlog_background_thread_queue= entry;
+ /* count the same notification kind from different engines */
+ for (xid_count_per_binlog *link= binlog_background_thread_queue;
+ link && !found_entry; link= link->next_in_queue)
+ {
+ if ((found_entry= (entry == link)))
+ entry->notify_count++;
+ }
+ if (!found_entry)
+ {
+ entry->next_in_queue= binlog_background_thread_queue;
+ binlog_background_thread_queue= entry;
+ }
mysql_cond_signal(&COND_binlog_background_thread);
mysql_mutex_unlock(&LOCK_binlog_background_thread);
}
@@ -9817,13 +9911,16 @@ binlog_background_thread(void *arg __attribute__((unused)))
);
while (queue)
{
+ long count= queue->notify_count;
THD_STAGE_INFO(thd, stage_binlog_processing_checkpoint_notify);
DEBUG_SYNC(thd, "binlog_background_thread_before_mark_xid_done");
/* Set the thread start time */
thd->set_time();
/* Grab next pointer first, as mark_xid_done() may free the element. */
next= queue->next_in_queue;
- mysql_bin_log.mark_xid_done(queue->binlog_id, true);
+ queue->notify_count= 0;
+ for (long i= 0; i <= count; i++)
+ mysql_bin_log.mark_xid_done(queue->binlog_id, true);
queue= next;
DBUG_EXECUTE_IF("binlog_background_checkpoint_processed",
diff --git a/sql/log.h b/sql/log.h
index 02ace7c7921..6305dd97355 100644
--- a/sql/log.h
+++ b/sql/log.h
@@ -571,7 +571,13 @@ class MYSQL_BIN_LOG: public TC_LOG, private MYSQL_LOG
bool write_transaction_to_binlog_events(group_commit_entry *entry);
void trx_group_commit_leader(group_commit_entry *leader);
bool is_xidlist_idle_nolock();
-
+#ifdef WITH_WSREP
+ /*
+ When this mariadb node is slave and galera enabled. So in this case
+ we write the gtid in wsrep_run_commit itself.
+ */
+ inline bool is_gtid_cached(THD *thd);
+#endif
public:
/*
A list of struct xid_count_per_binlog is used to keep track of how many
@@ -591,6 +597,7 @@ public:
ulong binlog_id;
/* Total prepared XIDs and pending checkpoint requests in this binlog. */
long xid_count;
+ long notify_count;
/* For linking in requests to the binlog background thread. */
xid_count_per_binlog *next_in_queue;
xid_count_per_binlog(); /* Give link error if constructor used. */
diff --git a/sql/log_event.cc b/sql/log_event.cc
index 7fe00b2bf43..1bf28df876d 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -216,7 +216,7 @@ is_parallel_retry_error(rpl_group_info *rgi, int err)
static void inline slave_rows_error_report(enum loglevel level, int ha_error,
rpl_group_info *rgi, THD *thd,
TABLE *table, const char * type,
- const char *log_name, ulong pos)
+ const char *log_name, my_off_t pos)
{
const char *handler_error= (ha_error ? HA_ERR(ha_error) : NULL);
char buff[MAX_SLAVE_ERRMSG], *slider;
@@ -250,14 +250,14 @@ static void inline slave_rows_error_report(enum loglevel level, int ha_error,
rli->report(level, errcode, rgi->gtid_info(),
"Could not execute %s event on table %s.%s;"
"%s handler error %s; "
- "the event's master log %s, end_log_pos %lu",
+ "the event's master log %s, end_log_pos %llu",
type, table->s->db.str, table->s->table_name.str,
buff, handler_error == NULL ? "<unknown>" : handler_error,
log_name, pos);
else
rli->report(level, errcode, rgi->gtid_info(),
"Could not execute %s event on table %s.%s;"
- "%s the event's master log %s, end_log_pos %lu",
+ "%s the event's master log %s, end_log_pos %llu",
type, table->s->db.str, table->s->table_name.str,
buff, log_name, pos);
}
@@ -290,10 +290,9 @@ public:
flags Flags for the cache
DESCRIPTION
-
- Class used to guarantee copy of cache to file before exiting the
- current block. On successful copy of the cache, the cache will
- be reinited as a WRITE_CACHE.
+ Cache common parameters and ensure common flush_data() code
+ on successful copy of the cache, the cache will be reinited as a
+ WRITE_CACHE.
Currently, a pointer to the cache is provided in the
constructor, but it would be possible to create a subclass
@@ -305,28 +304,35 @@ public:
reinit_io_cache(m_cache, WRITE_CACHE, 0L, FALSE, TRUE);
}
- ~Write_on_release_cache()
+ ~Write_on_release_cache() {}
+
+ bool flush_data()
{
#ifdef MYSQL_CLIENT
- if(m_ev == NULL)
+ if (m_ev == NULL)
{
- copy_event_cache_to_file_and_reinit(m_cache, m_file);
- if (m_flags & FLUSH_F)
- fflush(m_file);
+ if (copy_event_cache_to_file_and_reinit(m_cache, m_file))
+ return 1;
+ if ((m_flags & FLUSH_F) && fflush(m_file))
+ return 1;
}
else // if m_ev<>NULL, then storing the output in output_buf
{
LEX_STRING tmp_str;
+ bool res;
if (copy_event_cache_to_string_and_reinit(m_cache, &tmp_str))
- exit(1);
- m_ev->output_buf.append(&tmp_str);
+ return 1;
+ res= m_ev->output_buf.append(&tmp_str) != 0;
my_free(tmp_str.str);
+ return res ? res : 0;
}
#else /* MySQL_SERVER */
- copy_event_cache_to_file_and_reinit(m_cache, m_file);
- if (m_flags & FLUSH_F)
- fflush(m_file);
+ if (copy_event_cache_to_file_and_reinit(m_cache, m_file))
+ return 1;
+ if ((m_flags & FLUSH_F) && fflush(m_file))
+ return 1;
#endif
+ return 0;
}
/*
@@ -364,27 +370,36 @@ private:
*/
#ifdef MYSQL_CLIENT
-static void pretty_print_str(IO_CACHE* cache, const char* str, int len)
+static bool pretty_print_str(IO_CACHE* cache, const char* str, int len)
{
const char* end = str + len;
- my_b_write_byte(cache, '\'');
+ if (my_b_write_byte(cache, '\''))
+ goto err;
+
while (str < end)
{
char c;
+ int error;
+
switch ((c=*str++)) {
- case '\n': my_b_write(cache, (uchar*)"\\n", 2); break;
- case '\r': my_b_write(cache, (uchar*)"\\r", 2); break;
- case '\\': my_b_write(cache, (uchar*)"\\\\", 2); break;
- case '\b': my_b_write(cache, (uchar*)"\\b", 2); break;
- case '\t': my_b_write(cache, (uchar*)"\\t", 2); break;
- case '\'': my_b_write(cache, (uchar*)"\\'", 2); break;
- case 0 : my_b_write(cache, (uchar*)"\\0", 2); break;
+ case '\n': error= my_b_write(cache, (uchar*)"\\n", 2); break;
+ case '\r': error= my_b_write(cache, (uchar*)"\\r", 2); break;
+ case '\\': error= my_b_write(cache, (uchar*)"\\\\", 2); break;
+ case '\b': error= my_b_write(cache, (uchar*)"\\b", 2); break;
+ case '\t': error= my_b_write(cache, (uchar*)"\\t", 2); break;
+ case '\'': error= my_b_write(cache, (uchar*)"\\'", 2); break;
+ case 0 : error= my_b_write(cache, (uchar*)"\\0", 2); break;
default:
- my_b_write_byte(cache, c);
+ error= my_b_write_byte(cache, c);
break;
}
+ if (error)
+ goto err;
}
- my_b_write_byte(cache, '\'');
+ return my_b_write_byte(cache, '\'');
+
+err:
+ return 1;
}
#endif /* MYSQL_CLIENT */
@@ -1144,19 +1159,25 @@ int append_query_string(CHARSET_INFO *csinfo, String *to,
#ifdef MYSQL_CLIENT
-static void print_set_option(IO_CACHE* file, uint32 bits_changed,
+static bool print_set_option(IO_CACHE* file, uint32 bits_changed,
uint32 option, uint32 flags, const char* name,
bool* need_comma)
{
if (bits_changed & option)
{
if (*need_comma)
- my_b_write(file, (uchar*)", ", 2);
- my_b_printf(file, "%s=%d", name, MY_TEST(flags & option));
+ if (my_b_write(file, (uchar*)", ", 2))
+ goto err;
+ if (my_b_printf(file, "%s=%d", name, MY_TEST(flags & option)))
+ goto err;
*need_comma= 1;
}
+ return 0;
+err:
+ return 1;
}
#endif
+
/**************************************************************************
Log_event methods (= the parent class of all events)
**************************************************************************/
@@ -1327,7 +1348,7 @@ Log_event::Log_event(const char* buf,
*/
log_pos+= data_written; /* purecov: inspected */
}
- DBUG_PRINT("info", ("log_pos: %lu", (ulong) log_pos));
+ DBUG_PRINT("info", ("log_pos: %llu", log_pos));
flags= uint2korr(buf + FLAGS_OFFSET);
if (((uchar)buf[EVENT_TYPE_OFFSET] == FORMAT_DESCRIPTION_EVENT) ||
@@ -1456,7 +1477,7 @@ void Log_event::init_show_field_list(THD *thd, List<Item>* field_list)
mem_root);
field_list->push_back(new (mem_root)
Item_return_int(thd, "Pos",
- MY_INT32_NUM_DECIMAL_DIGITS,
+ MY_INT64_NUM_DECIMAL_DIGITS,
MYSQL_TYPE_LONGLONG),
mem_root);
field_list->push_back(new (mem_root)
@@ -1468,7 +1489,7 @@ void Log_event::init_show_field_list(THD *thd, List<Item>* field_list)
mem_root);
field_list->push_back(new (mem_root)
Item_return_int(thd, "End_log_pos",
- MY_INT32_NUM_DECIMAL_DIGITS,
+ MY_INT64_NUM_DECIMAL_DIGITS,
MYSQL_TYPE_LONGLONG),
mem_root);
field_list->push_back(new (mem_root) Item_empty_string(thd, "Info", 20),
@@ -2241,7 +2262,7 @@ Log_event* Log_event::read_log_event(const char* buf, uint event_len,
#ifdef MYSQL_CLIENT
-static void hexdump_minimal_header_to_io_cache(IO_CACHE *file,
+static bool hexdump_minimal_header_to_io_cache(IO_CACHE *file,
my_off_t offset,
uchar *ptr)
{
@@ -2254,15 +2275,18 @@ static void hexdump_minimal_header_to_io_cache(IO_CACHE *file,
more headers (which must be printed by other methods, if desired).
*/
char emit_buf[120]; // Enough for storing one line
- my_b_printf(file,
- "# "
- "|Timestamp "
- "|Type "
- "|Master ID "
- "|Size "
- "|Master Pos "
- "|Flags\n");
- size_t const emit_buf_written=
+ size_t emit_buf_written;
+
+ if (my_b_printf(file,
+ "# "
+ "|Timestamp "
+ "|Type "
+ "|Master ID "
+ "|Size "
+ "|Master Pos "
+ "|Flags\n"))
+ goto err;
+ emit_buf_written=
my_snprintf(emit_buf, sizeof(emit_buf),
"# %8llx " /* Position */
"|%02x %02x %02x %02x " /* Timestamp */
@@ -2280,8 +2304,13 @@ static void hexdump_minimal_header_to_io_cache(IO_CACHE *file,
ptr[17], ptr[18]); /* Flags */
DBUG_ASSERT(static_cast<size_t>(emit_buf_written) < sizeof(emit_buf));
- my_b_write(file, reinterpret_cast<uchar*>(emit_buf), emit_buf_written);
- my_b_write(file, (uchar*)"#\n", 2);
+ if (my_b_write(file, reinterpret_cast<uchar*>(emit_buf), emit_buf_written) ||
+ my_b_write(file, (uchar*)"#\n", 2))
+ goto err;
+
+ return 0;
+err:
+ return 1;
}
@@ -2306,7 +2335,7 @@ static void format_hex_line(char *emit_buff)
HEXDUMP_BYTES_PER_LINE + 2]= '\0';
}
-static void hexdump_data_to_io_cache(IO_CACHE *file,
+static bool hexdump_data_to_io_cache(IO_CACHE *file,
my_off_t offset,
uchar *ptr,
my_off_t size)
@@ -2328,7 +2357,7 @@ static void hexdump_data_to_io_cache(IO_CACHE *file,
my_off_t i;
if (size == 0)
- return;
+ return 0; // ok, nothing to do
format_hex_line(emit_buffer);
/*
@@ -2358,8 +2387,9 @@ static void hexdump_data_to_io_cache(IO_CACHE *file,
(ulonglong) starting_offset);
/* remove \0 left after printing address */
emit_buffer[2 + emit_buf_written]= ' ';
- my_b_write(file, reinterpret_cast<uchar*>(emit_buffer),
- sizeof(emit_buffer) - 1);
+ if (my_b_write(file, reinterpret_cast<uchar*>(emit_buffer),
+ sizeof(emit_buffer) - 1))
+ goto err;
c= emit_buffer + 2 + 8 + 2 + (HEXDUMP_BYTES_PER_LINE * 3 + 1) + 2;
h= emit_buffer + 2 + 8 + 2;
format_hex_line(emit_buffer);
@@ -2394,17 +2424,23 @@ static void hexdump_data_to_io_cache(IO_CACHE *file,
/* pad unprinted area */
memset(h, ' ',
(HEXDUMP_BYTES_PER_LINE * 3 + 1) - (h - (emit_buffer + 2 + 8 + 2)));
- my_b_write(file, reinterpret_cast<uchar*>(emit_buffer),
- c - emit_buffer);
+ if (my_b_write(file, reinterpret_cast<uchar*>(emit_buffer),
+ c - emit_buffer))
+ goto err;
}
- my_b_write(file, (uchar*)"#\n", 2);
+ if (my_b_write(file, (uchar*)"#\n", 2))
+ goto err;
+
+ return 0;
+err:
+ return 1;
}
/*
Log_event::print_header()
*/
-void Log_event::print_header(IO_CACHE* file,
+bool Log_event::print_header(IO_CACHE* file,
PRINT_EVENT_INFO* print_event_info,
bool is_more __attribute__((unused)))
{
@@ -2412,10 +2448,11 @@ void Log_event::print_header(IO_CACHE* file,
my_off_t hexdump_from= print_event_info->hexdump_from;
DBUG_ENTER("Log_event::print_header");
- my_b_write_byte(file, '#');
- print_timestamp(file);
- my_b_printf(file, " server id %lu end_log_pos %s ", (ulong) server_id,
- llstr(log_pos,llbuff));
+ if (my_b_write_byte(file, '#') ||
+ print_timestamp(file) ||
+ my_b_printf(file, " server id %lu end_log_pos %s ", (ulong) server_id,
+ llstr(log_pos,llbuff)))
+ goto err;
/* print the checksum */
@@ -2425,8 +2462,10 @@ void Log_event::print_header(IO_CACHE* file,
char checksum_buf[BINLOG_CHECKSUM_LEN * 2 + 4]; // to fit to "%p "
size_t const bytes_written=
my_snprintf(checksum_buf, sizeof(checksum_buf), "0x%08x ", crc);
- my_b_printf(file, "%s ", get_type(&binlog_checksum_typelib, checksum_alg));
- my_b_printf(file, checksum_buf, bytes_written);
+ if (my_b_printf(file, "%s ", get_type(&binlog_checksum_typelib,
+ checksum_alg)) ||
+ my_b_printf(file, checksum_buf, bytes_written))
+ goto err;
}
/* mysqlbinlog --hexdump */
@@ -2439,24 +2478,32 @@ void Log_event::print_header(IO_CACHE* file,
size-= hdr_len;
- my_b_printf(file, "# Position\n");
+ if (my_b_printf(file, "# Position\n"))
+ goto err;
/* Write the header, nicely formatted by field. */
- hexdump_minimal_header_to_io_cache(file, hexdump_from, ptr);
+ if (hexdump_minimal_header_to_io_cache(file, hexdump_from, ptr))
+ goto err;
ptr+= hdr_len;
hexdump_from+= hdr_len;
/* Print the rest of the data, mimicking "hexdump -C" output. */
- hexdump_data_to_io_cache(file, hexdump_from, ptr, size);
+ if (hexdump_data_to_io_cache(file, hexdump_from, ptr, size))
+ goto err;
/*
Prefix the next line so that the output from print_helper()
will appear as a comment.
*/
- my_b_write(file, (uchar*)"# Event: ", 9);
+ if (my_b_write(file, (uchar*)"# Event: ", 9))
+ goto err;
}
- DBUG_VOID_RETURN;
+
+ DBUG_RETURN(0);
+
+err:
+ DBUG_RETURN(1);
}
@@ -2464,7 +2511,7 @@ void Log_event::print_header(IO_CACHE* file,
Prints a quoted string to io cache.
Control characters are displayed as hex sequence, e.g. \x00
Single-quote and backslash characters are escaped with a \
-
+
@param[in] file IO cache
@param[in] prt Pointer to string
@param[in] length String length
@@ -2551,12 +2598,14 @@ my_b_write_quoted_with_length(IO_CACHE *file, const uchar *ptr, uint length)
@param[in] sl Signed number
@param[in] ul Unsigned number
*/
-static void
+static bool
my_b_write_sint32_and_uint32(IO_CACHE *file, int32 si, uint32 ui)
{
- my_b_printf(file, "%d", si);
+ bool res= my_b_printf(file, "%d", si);
if (si < 0)
- my_b_printf(file, " (%u)", ui);
+ if (my_b_printf(file, " (%u)", ui))
+ res= 1;
+ return res;
}
@@ -2575,8 +2624,8 @@ my_b_write_sint32_and_uint32(IO_CACHE *file, int32 si, uint32 ui)
*/
static size_t
-log_event_print_value(IO_CACHE *file, const uchar *ptr,
- uint type, uint meta,
+log_event_print_value(IO_CACHE *file, PRINT_EVENT_INFO *print_event_info,
+ const uchar *ptr, uint type, uint meta,
char *typestr, size_t typestr_length)
{
uint32 length= 0;
@@ -2959,19 +3008,15 @@ log_event_print_value(IO_CACHE *file, const uchar *ptr,
return my_b_write_quoted_with_length(file, ptr, length);
case MYSQL_TYPE_DECIMAL:
- my_b_printf(file,
- "!! Old DECIMAL (mysql-4.1 or earlier). "
- "Not enough metadata to display the value. ");
+ print_event_info->flush_for_error();
+ fprintf(stderr, "\nError: Found Old DECIMAL (mysql-4.1 or earlier). "
+ "Not enough metadata to display the value.\n");
break;
-
default:
- {
- char tmp[5];
- my_snprintf(tmp, sizeof(tmp), "%04x", meta);
- my_b_printf(file,
- "!! Don't know how to handle column type=%d meta=%d (%s)",
- type, meta, tmp);
- }
+ print_event_info->flush_for_error();
+ fprintf(stderr,
+ "\nError: Don't know how to handle column type: %d meta: %d (%04x)\n",
+ type, meta, meta);
break;
}
*typestr= 0;
@@ -2992,7 +3037,8 @@ return_null:
@param[in] value Pointer to packed row
@param[in] prefix Row's SQL clause ("SET", "WHERE", etc)
- @retval - number of bytes scanned.
+ @retval 0 error
+ # number of bytes scanned.
*/
@@ -3022,7 +3068,8 @@ Rows_log_event::print_verbose_one_row(IO_CACHE *file, table_def *td,
value+= (bitmap_bits_set(cols_bitmap) + 7) / 8;
if (!no_fill_output)
- my_b_printf(file, "%s", prefix);
+ if (my_b_printf(file, "%s", prefix))
+ goto err;
for (size_t i= 0; i < td->size(); i ++)
{
@@ -3034,7 +3081,8 @@ Rows_log_event::print_verbose_one_row(IO_CACHE *file, table_def *td,
continue;
if (!no_fill_output)
- my_b_printf(file, "### @%d=", static_cast<int>(i + 1));
+ if (my_b_printf(file, "### @%d=", static_cast<int>(i + 1)))
+ goto err;
if (!is_null)
{
@@ -3042,8 +3090,9 @@ Rows_log_event::print_verbose_one_row(IO_CACHE *file, table_def *td,
if (value + fsize > m_rows_end)
{
if (!no_fill_output)
- my_b_printf(file, "***Corrupted replication event was detected."
- " Not printing the value***\n");
+ if (my_b_printf(file, "***Corrupted replication event was detected."
+ " Not printing the value***\n"))
+ goto err;
value+= fsize;
return 0;
}
@@ -3051,7 +3100,7 @@ Rows_log_event::print_verbose_one_row(IO_CACHE *file, table_def *td,
if (!no_fill_output)
{
- size= log_event_print_value(file,is_null? NULL: value,
+ size= log_event_print_value(file, print_event_info, is_null? NULL: value,
td->type(i), td->field_metadata(i),
typestr, sizeof(typestr));
#ifdef WHEN_FLASHBACK_REVIEW_READY
@@ -3062,12 +3111,14 @@ Rows_log_event::print_verbose_one_row(IO_CACHE *file, table_def *td,
// Using a tmp IO_CACHE to get the value output
open_cached_file(&tmp_cache, NULL, NULL, 0, MYF(MY_WME | MY_NABP));
- size= log_event_print_value(&tmp_cache, is_null? NULL: value,
+ size= log_event_print_value(&tmp_cache, print_event_info,
+ is_null ? NULL: value,
td->type(i), td->field_metadata(i),
typestr, sizeof(typestr));
- if (copy_event_cache_to_string_and_reinit(&tmp_cache, &review_str))
- exit(1);
+ error= copy_event_cache_to_string_and_reinit(&tmp_cache, &review_str);
close_cached_file(&tmp_cache);
+ if (error)
+ return 0;
switch (td->type(i)) // Converting a string to HEX format
{
@@ -3085,12 +3136,14 @@ Rows_log_event::print_verbose_one_row(IO_CACHE *file, table_def *td,
exit(1);
}
octet2hex((char*) hex_str.ptr(), tmp_str.ptr(), tmp_str.length());
- my_b_printf(review_sql, ", UNHEX('%s')", hex_str.ptr());
+ if (my_b_printf(review_sql, ", UNHEX('%s')", hex_str.ptr()))
+ goto err;
break;
default:
tmp_str.free();
- tmp_str.append(review_str.str, review_str.length);
- my_b_printf(review_sql, ", %s", tmp_str.ptr());
+ if (tmp_str.append(review_str.str, review_str.length) ||
+ my_b_printf(review_sql, ", %s", tmp_str.ptr()))
+ goto err;
break;
}
my_free(revieww_str.str);
@@ -3101,36 +3154,40 @@ Rows_log_event::print_verbose_one_row(IO_CACHE *file, table_def *td,
{
IO_CACHE tmp_cache;
open_cached_file(&tmp_cache, NULL, NULL, 0, MYF(MY_WME | MY_NABP));
- size= log_event_print_value(&tmp_cache,is_null? NULL: value,
+ size= log_event_print_value(&tmp_cache, print_event_info,
+ is_null ? NULL: value,
td->type(i), td->field_metadata(i),
typestr, sizeof(typestr));
close_cached_file(&tmp_cache);
}
if (!size)
- return 0;
+ goto err;
if (!is_null)
value+= size;
if (print_event_info->verbose > 1 && !no_fill_output)
{
- my_b_write(file, (uchar*)" /* ", 4);
-
- my_b_printf(file, "%s ", typestr);
-
- my_b_printf(file, "meta=%d nullable=%d is_null=%d ",
- td->field_metadata(i),
- td->maybe_null(i), is_null);
- my_b_write(file, (uchar*)"*/", 2);
+ if (my_b_write(file, (uchar*)" /* ", 4) ||
+ my_b_printf(file, "%s ", typestr) ||
+ my_b_printf(file, "meta=%d nullable=%d is_null=%d ",
+ td->field_metadata(i),
+ td->maybe_null(i), is_null) ||
+ my_b_write(file, (uchar*)"*/", 2))
+ goto err;
}
if (!no_fill_output)
- my_b_write_byte(file, '\n');
+ if (my_b_write_byte(file, '\n'))
+ goto err;
null_bit_index++;
}
return value - value0;
+
+err:
+ return 0;
}
@@ -3169,10 +3226,10 @@ void Rows_log_event::change_to_flashback_event(PRINT_EVENT_INFO *print_event_inf
if (!(length1= print_verbose_one_row(NULL, td, print_event_info,
&m_cols, value,
(const uchar*) "", TRUE)))
- {
- fprintf(stderr, "\nError row length: %zu\n", length1);
- exit(1);
- }
+ {
+ fprintf(stderr, "\nError row length: %zu\n", length1);
+ exit(1);
+ }
value+= length1;
swap_buff1= (uchar *) my_malloc(length1, MYF(0));
@@ -3251,18 +3308,230 @@ end:
delete td;
}
+/**
+ Calc length of a packed value of the given SQL type
+
+ @param[in] ptr Pointer to string
+ @param[in] type Column type
+ @param[in] meta Column meta information
+
+ @retval - number of bytes scanned from ptr.
+ Except in case of NULL, in which case we return 1 to indicate ok
+*/
+
+static size_t calc_field_event_length(const uchar *ptr, uint type, uint meta)
+{
+ uint32 length= 0;
+
+ if (type == MYSQL_TYPE_STRING)
+ {
+ if (meta >= 256)
+ {
+ uint byte0= meta >> 8;
+ uint byte1= meta & 0xFF;
+
+ if ((byte0 & 0x30) != 0x30)
+ {
+ /* a long CHAR() field: see #37426 */
+ length= byte1 | (((byte0 & 0x30) ^ 0x30) << 4);
+ type= byte0 | 0x30;
+ }
+ else
+ length = meta & 0xFF;
+ }
+ else
+ length= meta;
+ }
+
+ switch (type) {
+ case MYSQL_TYPE_LONG:
+ case MYSQL_TYPE_TIMESTAMP:
+ return 4;
+ case MYSQL_TYPE_TINY:
+ case MYSQL_TYPE_YEAR:
+ return 1;
+ case MYSQL_TYPE_SHORT:
+ return 2;
+ case MYSQL_TYPE_INT24:
+ case MYSQL_TYPE_TIME:
+ case MYSQL_TYPE_NEWDATE:
+ case MYSQL_TYPE_DATE:
+ return 3;
+ case MYSQL_TYPE_LONGLONG:
+ case MYSQL_TYPE_DATETIME:
+ return 8;
+ case MYSQL_TYPE_NEWDECIMAL:
+ {
+ uint precision= meta >> 8;
+ uint decimals= meta & 0xFF;
+ uint bin_size= my_decimal_get_binary_size(precision, decimals);
+ return bin_size;
+ }
+ case MYSQL_TYPE_FLOAT:
+ return 4;
+ case MYSQL_TYPE_DOUBLE:
+ return 8;
+ case MYSQL_TYPE_BIT:
+ {
+ /* Meta-data: bit_len, bytes_in_rec, 2 bytes */
+ uint nbits= ((meta >> 8) * 8) + (meta & 0xFF);
+ length= (nbits + 7) / 8;
+ return length;
+ }
+ case MYSQL_TYPE_TIMESTAMP2:
+ return my_timestamp_binary_length(meta);
+ case MYSQL_TYPE_DATETIME2:
+ return my_datetime_binary_length(meta);
+ case MYSQL_TYPE_TIME2:
+ return my_time_binary_length(meta);
+ case MYSQL_TYPE_ENUM:
+ switch (meta & 0xFF) {
+ case 1:
+ case 2:
+ return (meta & 0xFF);
+ default:
+ /* Unknown ENUM packlen=%d", meta & 0xFF */
+ return 0;
+ }
+ break;
+ case MYSQL_TYPE_SET:
+ return meta & 0xFF;
+ case MYSQL_TYPE_BLOB:
+ return (meta <= 4 ? meta : 0);
+ case MYSQL_TYPE_VARCHAR:
+ case MYSQL_TYPE_VAR_STRING:
+ length= meta;
+ /* fall through */
+ case MYSQL_TYPE_STRING:
+ if (length < 256)
+ return (uint) *ptr + 1;
+ return uint2korr(ptr) + 2;
+ case MYSQL_TYPE_DECIMAL:
+ break;
+ default:
+ break;
+ }
+ return 0;
+}
+
+
+size_t
+Rows_log_event::calc_row_event_length(table_def *td,
+ PRINT_EVENT_INFO *print_event_info,
+ MY_BITMAP *cols_bitmap,
+ const uchar *value)
+{
+ const uchar *value0= value;
+ const uchar *null_bits= value;
+ uint null_bit_index= 0;
+
+ /*
+ Skip metadata bytes which gives the information about nullabity of master
+ columns. Master writes one bit for each affected column.
+ */
+
+ value+= (bitmap_bits_set(cols_bitmap) + 7) / 8;
+
+ for (size_t i= 0; i < td->size(); i ++)
+ {
+ int is_null;
+ is_null= (null_bits[null_bit_index / 8] >> (null_bit_index % 8)) & 0x01;
+
+ if (bitmap_is_set(cols_bitmap, i) == 0)
+ continue;
+
+ if (!is_null)
+ {
+ size_t size;
+ size_t fsize= td->calc_field_size((uint)i, (uchar*) value);
+ if (value + fsize > m_rows_end)
+ {
+ /* Corrupted replication event was detected, skipping entry */
+ return 0;
+ }
+ if (!(size= calc_field_event_length(value, td->type(i),
+ td->field_metadata(i))))
+ return 0;
+ value+= size;
+ }
+ null_bit_index++;
+ }
+ return value - value0;
+}
+
+
+/**
+ Calculate how many rows there are in the event
+
+ @param[in] file IO cache
+ @param[in] print_event_into Print parameters
+*/
+
+void Rows_log_event::count_row_events(PRINT_EVENT_INFO *print_event_info)
+{
+ Table_map_log_event *map;
+ table_def *td;
+ uint row_events;
+ Log_event_type general_type_code= get_general_type_code();
+
+ switch (general_type_code) {
+ case WRITE_ROWS_EVENT:
+ case DELETE_ROWS_EVENT:
+ row_events= 1;
+ break;
+ case UPDATE_ROWS_EVENT:
+ row_events= 2;
+ break;
+ default:
+ DBUG_ASSERT(0); /* Not possible */
+ return;
+ }
+
+ if (!(map= print_event_info->m_table_map.get_table(m_table_id)) ||
+ !(td= map->create_table_def()))
+ {
+ /* Row event for unknown table */
+ return;
+ }
+
+ for (const uchar *value= m_rows_buf; value < m_rows_end; )
+ {
+ size_t length;
+ print_event_info->row_events++;
+
+ /* Print the first image */
+ if (!(length= calc_row_event_length(td, print_event_info,
+ &m_cols, value)))
+ break;
+ value+= length;
+ DBUG_ASSERT(value <= m_rows_end);
+
+ /* Print the second image (for UPDATE only) */
+ if (row_events == 2)
+ {
+ if (!(length= calc_row_event_length(td, print_event_info,
+ &m_cols_ai, value)))
+ break;
+ value+= length;
+ DBUG_ASSERT(value <= m_rows_end);
+ }
+ }
+ delete td;
+}
+
/**
Print a row event into IO cache in human readable form (in SQL format)
-
+
@param[in] file IO cache
@param[in] print_event_into Print parameters
*/
-void Rows_log_event::print_verbose(IO_CACHE *file,
+
+bool Rows_log_event::print_verbose(IO_CACHE *file,
PRINT_EVENT_INFO *print_event_info)
{
Table_map_log_event *map;
- table_def *td;
+ table_def *td= 0;
const char *sql_command, *sql_clause1, *sql_clause2;
const char *sql_command_short __attribute__((unused));
Log_event_type general_type_code= get_general_type_code();
@@ -3276,9 +3545,10 @@ void Rows_log_event::print_verbose(IO_CACHE *file,
uint8 extra_payload_len= extra_data_len - EXTRA_ROW_INFO_HDR_BYTES;
assert(extra_data_len >= EXTRA_ROW_INFO_HDR_BYTES);
- my_b_printf(file, "### Extra row data format: %u, len: %u :",
- m_extra_row_data[EXTRA_ROW_INFO_FORMAT_OFFSET],
- extra_payload_len);
+ if (my_b_printf(file, "### Extra row data format: %u, len: %u :",
+ m_extra_row_data[EXTRA_ROW_INFO_FORMAT_OFFSET],
+ extra_payload_len))
+ goto err;
if (extra_payload_len)
{
/*
@@ -3289,9 +3559,11 @@ void Rows_log_event::print_verbose(IO_CACHE *file,
char buff[buff_len];
str_to_hex(buff, (const char*) &m_extra_row_data[EXTRA_ROW_INFO_HDR_BYTES],
extra_payload_len);
- my_b_printf(file, "%s", buff);
+ if (my_b_printf(file, "%s", buff))
+ goto err;
}
- my_b_printf(file, "\n");
+ if (my_b_printf(file, "\n"))
+ goto err;
}
switch (general_type_code) {
@@ -3318,41 +3590,45 @@ void Rows_log_event::print_verbose(IO_CACHE *file,
sql_command_short= "";
DBUG_ASSERT(0); /* Not possible */
}
-
+
if (!(map= print_event_info->m_table_map.get_table(m_table_id)) ||
!(td= map->create_table_def()))
{
- my_b_printf(file, "### Row event for unknown table #%lu",
- (ulong) m_table_id);
- return;
+ return (my_b_printf(file, "### Row event for unknown table #%lu",
+ (ulong) m_table_id));
}
/* If the write rows event contained no values for the AI */
if (((general_type_code == WRITE_ROWS_EVENT) && (m_rows_buf==m_rows_end)))
{
- my_b_printf(file, "### INSERT INTO %`s.%`s VALUES ()\n",
- map->get_db_name(), map->get_table_name());
+ if (my_b_printf(file, "### INSERT INTO %`s.%`s VALUES ()\n",
+ map->get_db_name(), map->get_table_name()))
+ goto err;
goto end;
}
for (const uchar *value= m_rows_buf; value < m_rows_end; )
{
size_t length;
- my_b_printf(file, "### %s %`s.%`s\n",
- sql_command,
- map->get_db_name(), map->get_table_name());
+ print_event_info->row_events++;
+ if (my_b_printf(file, "### %s %`s.%`s\n",
+ sql_command,
+ map->get_db_name(), map->get_table_name()))
+ goto err;
#ifdef WHEN_FLASHBACK_REVIEW_READY
if (need_flashback_review)
- my_b_printf(review_sql, "\nINSERT INTO `%s`.`%s` VALUES ('%s'",
- map->get_review_dbname(), map->get_review_tablename(), sql_command_short);
+ if (my_b_printf(review_sql, "\nINSERT INTO `%s`.`%s` VALUES ('%s'",
+ map->get_review_dbname(), map->get_review_tablename(),
+ sql_command_short))
+ goto err;
#endif
/* Print the first image */
if (!(length= print_verbose_one_row(file, td, print_event_info,
&m_cols, value,
(const uchar*) sql_clause1)))
- goto end;
+ goto err;
value+= length;
/* Print the second image (for UPDATE only) */
@@ -3361,7 +3637,7 @@ void Rows_log_event::print_verbose(IO_CACHE *file,
if (!(length= print_verbose_one_row(file, td, print_event_info,
&m_cols_ai, value,
(const uchar*) sql_clause2)))
- goto end;
+ goto err;
value+= length;
}
#ifdef WHEN_FLASHBACK_REVIEW_READY
@@ -3369,16 +3645,22 @@ void Rows_log_event::print_verbose(IO_CACHE *file,
{
if (need_flashback_review)
for (size_t i= 0; i < td->size(); i ++)
- my_b_printf(review_sql, ", NULL");
+ if (my_b_printf(review_sql, ", NULL"))
+ goto err;
}
if (need_flashback_review)
- my_b_printf(review_sql, ")%s\n", print_event_info->delimiter);
+ if (my_b_printf(review_sql, ")%s\n", print_event_info->delimiter))
+ goto err;
#endif
}
end:
delete td;
+ return 0;
+err:
+ delete td;
+ return 1;
}
void free_table_map_log_event(Table_map_log_event *event)
@@ -3386,7 +3668,7 @@ void free_table_map_log_event(Table_map_log_event *event)
delete event;
}
-void Log_event::print_base64(IO_CACHE* file,
+bool Log_event::print_base64(IO_CACHE* file,
PRINT_EVENT_INFO* print_event_info,
bool more)
{
@@ -3394,14 +3676,6 @@ void Log_event::print_base64(IO_CACHE* file,
uint32 size= uint4korr(ptr + EVENT_LEN_OFFSET);
DBUG_ENTER("Log_event::print_base64");
- size_t const tmp_str_sz= my_base64_needed_encoded_length((int) size);
- char *const tmp_str= (char *) my_malloc(tmp_str_sz, MYF(MY_WME));
- if (!tmp_str) {
- fprintf(stderr, "\nError: Out of memory. "
- "Could not print correct binlog event.\n");
- DBUG_VOID_RETURN;
- }
-
if (is_flashback)
{
uint tmp_size= size;
@@ -3447,27 +3721,41 @@ void Log_event::print_base64(IO_CACHE* file,
delete ev;
}
- if (my_base64_encode(ptr, (size_t) size, tmp_str))
+ if (print_event_info->base64_output_mode != BASE64_OUTPUT_NEVER &&
+ print_event_info->base64_output_mode != BASE64_OUTPUT_DECODE_ROWS &&
+ ! print_event_info->short_form)
{
- DBUG_ASSERT(0);
- }
-
- if (print_event_info->base64_output_mode != BASE64_OUTPUT_DECODE_ROWS)
- {
- if (my_b_tell(file) == 0)
- my_b_write_string(file, "\nBINLOG '\n");
+ size_t const tmp_str_sz= my_base64_needed_encoded_length((int) size);
+ bool error= 0;
+ char *tmp_str;
+ if (!(tmp_str= (char *) my_malloc(tmp_str_sz, MYF(MY_WME))))
+ goto err;
- my_b_printf(file, "%s\n", tmp_str);
+ if (my_base64_encode(ptr, (size_t) size, tmp_str))
+ {
+ DBUG_ASSERT(0);
+ }
- if (!more)
- my_b_printf(file, "'%s\n", print_event_info->delimiter);
+ if (my_b_tell(file) == 0)
+ if (my_b_write_string(file, "\nBINLOG '\n"))
+ error= 1;
+ if (!error && my_b_printf(file, "%s\n", tmp_str))
+ error= 1;
+ if (!more && !error)
+ if (my_b_printf(file, "'%s\n", print_event_info->delimiter))
+ error= 1;
+ my_free(tmp_str);
+ if (error)
+ goto err;
}
#ifdef WHEN_FLASHBACK_REVIEW_READY
- if (print_event_info->verbose || need_flashback_review)
+ if (print_event_info->verbose || print_event_info->print_row_count ||
+ need_flashback_review)
#else
// Flashback need the table_map to parse the event
- if (print_event_info->verbose || is_flashback)
+ if (print_event_info->verbose || print_event_info->print_row_count ||
+ is_flashback)
#endif
{
Rows_log_event *ev= NULL;
@@ -3542,27 +3830,49 @@ void Log_event::print_base64(IO_CACHE* file,
if (ev)
{
+ bool error= 0;
+
#ifdef WHEN_FLASHBACK_REVIEW_READY
ev->need_flashback_review= need_flashback_review;
if (print_event_info->verbose)
- ev->print_verbose(file, print_event_info);
+ {
+ if (ev->print_verbose(file, print_event_info))
+ goto err;
+ }
else
{
IO_CACHE tmp_cache;
- open_cached_file(&tmp_cache, NULL, NULL, 0, MYF(MY_WME | MY_NABP));
- ev->print_verbose(&tmp_cache, print_event_info);
+
+ if (open_cached_file(&tmp_cache, NULL, NULL, 0,
+ MYF(MY_WME | MY_NABP)))
+ {
+ delete ev;
+ goto err;
+ }
+
+ error= ev->print_verbose(&tmp_cache, print_event_info);
close_cached_file(&tmp_cache);
+ if (error)
+ {
+ delete ev;
+ goto err;
+ }
}
#else
if (print_event_info->verbose)
- ev->print_verbose(file, print_event_info);
+ error= ev->print_verbose(file, print_event_info);
+ else
+ ev->count_row_events(print_event_info);
#endif
delete ev;
+ if (error)
+ goto err;
}
}
+ DBUG_RETURN(0);
- my_free(tmp_str);
- DBUG_VOID_RETURN;
+err:
+ DBUG_RETURN(1);
}
@@ -3570,7 +3880,7 @@ void Log_event::print_base64(IO_CACHE* file,
Log_event::print_timestamp()
*/
-void Log_event::print_timestamp(IO_CACHE* file, time_t* ts)
+bool Log_event::print_timestamp(IO_CACHE* file, time_t* ts)
{
struct tm *res;
time_t my_when= when;
@@ -3579,14 +3889,13 @@ void Log_event::print_timestamp(IO_CACHE* file, time_t* ts)
ts = &my_when;
res=localtime(ts);
- my_b_printf(file,"%02d%02d%02d %2d:%02d:%02d",
- res->tm_year % 100,
- res->tm_mon+1,
- res->tm_mday,
- res->tm_hour,
- res->tm_min,
- res->tm_sec);
- DBUG_VOID_RETURN;
+ DBUG_RETURN(my_b_printf(file,"%02d%02d%02d %2d:%02d:%02d",
+ res->tm_year % 100,
+ res->tm_mon+1,
+ res->tm_mday,
+ res->tm_hour,
+ res->tm_min,
+ res->tm_sec));
}
#endif /* MYSQL_CLIENT */
@@ -4745,7 +5054,7 @@ Query_log_event::begin_event(String *packet, ulong ev_offset,
@todo
print the catalog ??
*/
-void Query_log_event::print_query_header(IO_CACHE* file,
+bool Query_log_event::print_query_header(IO_CACHE* file,
PRINT_EVENT_INFO* print_event_info)
{
// TODO: print the catalog ??
@@ -4755,10 +5064,12 @@ void Query_log_event::print_query_header(IO_CACHE* file,
if (!print_event_info->short_form)
{
- print_header(file, print_event_info, FALSE);
- my_b_printf(file, "\t%s\tthread_id=%lu\texec_time=%lu\terror_code=%d\n",
- get_type_str(), (ulong) thread_id, (ulong) exec_time,
- error_code);
+ if (print_header(file, print_event_info, FALSE) ||
+ my_b_printf(file,
+ "\t%s\tthread_id=%lu\texec_time=%lu\terror_code=%d\n",
+ get_type_str(), (ulong) thread_id, (ulong) exec_time,
+ error_code))
+ goto err;
}
if ((flags & LOG_EVENT_SUPPRESS_USE_F))
@@ -4772,7 +5083,8 @@ void Query_log_event::print_query_header(IO_CACHE* file,
if (different_db)
memcpy(print_event_info->db, db, db_len + 1);
if (db[0] && different_db)
- my_b_printf(file, "use %`s%s\n", db, print_event_info->delimiter);
+ if (my_b_printf(file, "use %`s%s\n", db, print_event_info->delimiter))
+ goto err;
}
end=int10_to_str((long) when, strmov(buff,"SET TIMESTAMP="),10);
@@ -4783,15 +5095,17 @@ void Query_log_event::print_query_header(IO_CACHE* file,
}
end= strmov(end, print_event_info->delimiter);
*end++='\n';
- my_b_write(file, (uchar*) buff, (uint) (end-buff));
+ if (my_b_write(file, (uchar*) buff, (uint) (end-buff)))
+ goto err;
if ((!print_event_info->thread_id_printed ||
((flags & LOG_EVENT_THREAD_SPECIFIC_F) &&
thread_id != print_event_info->thread_id)))
{
// If --short-form, print deterministic value instead of pseudo_thread_id.
- my_b_printf(file,"SET @@session.pseudo_thread_id=%lu%s\n",
- short_form ? 999999999 : (ulong)thread_id,
- print_event_info->delimiter);
+ if (my_b_printf(file,"SET @@session.pseudo_thread_id=%lu%s\n",
+ short_form ? 999999999 : (ulong)thread_id,
+ print_event_info->delimiter))
+ goto err;
print_event_info->thread_id= thread_id;
print_event_info->thread_id_printed= 1;
}
@@ -4816,18 +5130,20 @@ void Query_log_event::print_query_header(IO_CACHE* file,
if (unlikely(tmp)) /* some bits have changed */
{
bool need_comma= 0;
- my_b_write_string(file, "SET ");
- print_set_option(file, tmp, OPTION_NO_FOREIGN_KEY_CHECKS, ~flags2,
- "@@session.foreign_key_checks", &need_comma);
- print_set_option(file, tmp, OPTION_AUTO_IS_NULL, flags2,
- "@@session.sql_auto_is_null", &need_comma);
- print_set_option(file, tmp, OPTION_RELAXED_UNIQUE_CHECKS, ~flags2,
- "@@session.unique_checks", &need_comma);
- print_set_option(file, tmp, OPTION_NOT_AUTOCOMMIT, ~flags2,
- "@@session.autocommit", &need_comma);
- print_set_option(file, tmp, OPTION_NO_CHECK_CONSTRAINT_CHECKS, ~flags2,
- "@@session.check_constraint_checks", &need_comma);
- my_b_printf(file,"%s\n", print_event_info->delimiter);
+ if (my_b_write_string(file, "SET ") ||
+ print_set_option(file, tmp, OPTION_NO_FOREIGN_KEY_CHECKS, ~flags2,
+ "@@session.foreign_key_checks", &need_comma)||
+ print_set_option(file, tmp, OPTION_AUTO_IS_NULL, flags2,
+ "@@session.sql_auto_is_null", &need_comma) ||
+ print_set_option(file, tmp, OPTION_RELAXED_UNIQUE_CHECKS, ~flags2,
+ "@@session.unique_checks", &need_comma) ||
+ print_set_option(file, tmp, OPTION_NOT_AUTOCOMMIT, ~flags2,
+ "@@session.autocommit", &need_comma) ||
+ print_set_option(file, tmp, OPTION_NO_CHECK_CONSTRAINT_CHECKS,
+ ~flags2,
+ "@@session.check_constraint_checks", &need_comma) ||
+ my_b_printf(file,"%s\n", print_event_info->delimiter))
+ goto err;
print_event_info->flags2= flags2;
}
}
@@ -4850,17 +5166,19 @@ void Query_log_event::print_query_header(IO_CACHE* file,
!print_event_info->sql_mode_inited)))
{
char llbuff[22];
- my_b_printf(file,"SET @@session.sql_mode=%s%s\n",
- ullstr(sql_mode, llbuff), print_event_info->delimiter);
+ if (my_b_printf(file,"SET @@session.sql_mode=%s%s\n",
+ ullstr(sql_mode, llbuff), print_event_info->delimiter))
+ goto err;
print_event_info->sql_mode= sql_mode;
print_event_info->sql_mode_inited= 1;
}
if (print_event_info->auto_increment_increment != auto_increment_increment ||
print_event_info->auto_increment_offset != auto_increment_offset)
{
- my_b_printf(file,"SET @@session.auto_increment_increment=%lu, @@session.auto_increment_offset=%lu%s\n",
- auto_increment_increment,auto_increment_offset,
- print_event_info->delimiter);
+ if (my_b_printf(file,"SET @@session.auto_increment_increment=%lu, @@session.auto_increment_offset=%lu%s\n",
+ auto_increment_increment,auto_increment_offset,
+ print_event_info->delimiter))
+ goto err;
print_event_info->auto_increment_increment= auto_increment_increment;
print_event_info->auto_increment_offset= auto_increment_offset;
}
@@ -4875,18 +5193,20 @@ void Query_log_event::print_query_header(IO_CACHE* file,
if (cs_info)
{
/* for mysql client */
- my_b_printf(file, "/*!\\C %s */%s\n",
- cs_info->csname, print_event_info->delimiter);
- }
- my_b_printf(file,"SET "
- "@@session.character_set_client=%d,"
- "@@session.collation_connection=%d,"
- "@@session.collation_server=%d"
- "%s\n",
- uint2korr(charset),
- uint2korr(charset+2),
- uint2korr(charset+4),
- print_event_info->delimiter);
+ if (my_b_printf(file, "/*!\\C %s */%s\n",
+ cs_info->csname, print_event_info->delimiter))
+ goto err;
+ }
+ if (my_b_printf(file,"SET "
+ "@@session.character_set_client=%d,"
+ "@@session.collation_connection=%d,"
+ "@@session.collation_server=%d"
+ "%s\n",
+ uint2korr(charset),
+ uint2korr(charset+2),
+ uint2korr(charset+4),
+ print_event_info->delimiter))
+ goto err;
memcpy(print_event_info->charset, charset, 6);
print_event_info->charset_inited= 1;
}
@@ -4895,31 +5215,40 @@ void Query_log_event::print_query_header(IO_CACHE* file,
if (memcmp(print_event_info->time_zone_str,
time_zone_str, time_zone_len+1))
{
- my_b_printf(file,"SET @@session.time_zone='%s'%s\n",
- time_zone_str, print_event_info->delimiter);
+ if (my_b_printf(file,"SET @@session.time_zone='%s'%s\n",
+ time_zone_str, print_event_info->delimiter))
+ goto err;
memcpy(print_event_info->time_zone_str, time_zone_str, time_zone_len+1);
}
}
if (lc_time_names_number != print_event_info->lc_time_names_number)
{
- my_b_printf(file, "SET @@session.lc_time_names=%d%s\n",
- lc_time_names_number, print_event_info->delimiter);
+ if (my_b_printf(file, "SET @@session.lc_time_names=%d%s\n",
+ lc_time_names_number, print_event_info->delimiter))
+ goto err;
print_event_info->lc_time_names_number= lc_time_names_number;
}
if (charset_database_number != print_event_info->charset_database_number)
{
if (charset_database_number)
- my_b_printf(file, "SET @@session.collation_database=%d%s\n",
- charset_database_number, print_event_info->delimiter);
- else
- my_b_printf(file, "SET @@session.collation_database=DEFAULT%s\n",
- print_event_info->delimiter);
+ {
+ if (my_b_printf(file, "SET @@session.collation_database=%d%s\n",
+ charset_database_number, print_event_info->delimiter))
+ goto err;
+ }
+ else if (my_b_printf(file, "SET @@session.collation_database=DEFAULT%s\n",
+ print_event_info->delimiter))
+ goto err;
print_event_info->charset_database_number= charset_database_number;
}
+ return 0;
+
+err:
+ return 1;
}
-void Query_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
+bool Query_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
{
Write_on_release_cache cache(&print_event_info->head_cache, file, 0, this);
@@ -4929,25 +5258,32 @@ void Query_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
*/
DBUG_EXECUTE_IF ("simulate_file_write_error",
{(&cache)->write_pos= (&cache)->write_end- 500;});
- print_query_header(&cache, print_event_info);
+ if (print_query_header(&cache, print_event_info))
+ goto err;
if (!is_flashback)
{
- my_b_write(&cache, (uchar*) query, q_len);
- my_b_printf(&cache, "\n%s\n", print_event_info->delimiter);
+ if (my_b_write(&cache, (uchar*) query, q_len) ||
+ my_b_printf(&cache, "\n%s\n", print_event_info->delimiter))
+ goto err;
}
else // is_flashback == 1
{
if (strcmp("BEGIN", query) == 0)
{
- my_b_write(&cache, (uchar*) "COMMIT", 6);
- my_b_printf(&cache, "\n%s\n", print_event_info->delimiter);
+ if (my_b_write(&cache, (uchar*) "COMMIT", 6) ||
+ my_b_printf(&cache, "\n%s\n", print_event_info->delimiter))
+ goto err;
}
else if (strcmp("COMMIT", query) == 0)
{
- my_b_write(&cache, (uchar*) "BEGIN", 5);
- my_b_printf(&cache, "\n%s\n", print_event_info->delimiter);
+ if (my_b_write(&cache, (uchar*) "BEGIN", 5) ||
+ my_b_printf(&cache, "\n%s\n", print_event_info->delimiter))
+ goto err;
}
}
+ return cache.flush_data();
+err:
+ return 1;
}
#endif /* MYSQL_CLIENT */
@@ -5558,7 +5894,7 @@ void Start_log_event_v3::pack_info(Protocol *protocol)
*/
#ifdef MYSQL_CLIENT
-void Start_log_event_v3::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
+bool Start_log_event_v3::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
{
DBUG_ENTER("Start_log_event_v3::print");
@@ -5567,16 +5903,21 @@ void Start_log_event_v3::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
if (!print_event_info->short_form)
{
- print_header(&cache, print_event_info, FALSE);
- my_b_printf(&cache, "\tStart: binlog v %d, server v %s created ",
- binlog_version, server_version);
- print_timestamp(&cache);
+ if (print_header(&cache, print_event_info, FALSE) ||
+ my_b_printf(&cache, "\tStart: binlog v %d, server v %s created ",
+ binlog_version, server_version) ||
+ print_timestamp(&cache))
+ goto err;
if (created)
- my_b_printf(&cache," at startup");
- my_b_printf(&cache, "\n");
+ if (my_b_printf(&cache," at startup"))
+ goto err;
+ if (my_b_printf(&cache, "\n"))
+ goto err;
if (flags & LOG_EVENT_BINLOG_IN_USE_F)
- my_b_printf(&cache, "# Warning: this binlog is either in use or was not "
- "closed properly.\n");
+ if (my_b_printf(&cache,
+ "# Warning: this binlog is either in use or was not "
+ "closed properly.\n"))
+ goto err;
}
if (!is_artificial_event() && created)
{
@@ -5587,9 +5928,12 @@ void Start_log_event_v3::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
and rollback unfinished transaction.
Probably this can be done with RESET CONNECTION (syntax to be defined).
*/
- my_b_printf(&cache,"RESET CONNECTION%s\n", print_event_info->delimiter);
+ if (my_b_printf(&cache,"RESET CONNECTION%s\n",
+ print_event_info->delimiter))
+ goto err;
#else
- my_b_printf(&cache,"ROLLBACK%s\n", print_event_info->delimiter);
+ if (my_b_printf(&cache,"ROLLBACK%s\n", print_event_info->delimiter))
+ goto err;
#endif
}
if (temp_buf &&
@@ -5597,11 +5941,15 @@ void Start_log_event_v3::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
!print_event_info->short_form)
{
if (print_event_info->base64_output_mode != BASE64_OUTPUT_DECODE_ROWS)
- my_b_printf(&cache, "BINLOG '\n");
- print_base64(&cache, print_event_info, FALSE);
+ if (my_b_printf(&cache, "BINLOG '\n"))
+ goto err;
+ if (print_base64(&cache, print_event_info, FALSE))
+ goto err;
print_event_info->printed_fd_event= TRUE;
}
- DBUG_VOID_RETURN;
+ DBUG_RETURN(cache.flush_data());
+err:
+ DBUG_RETURN(1);
}
#endif /* MYSQL_CLIENT */
@@ -6284,7 +6632,7 @@ int Start_encryption_log_event::do_update_pos(rpl_group_info *rgi)
#endif
#ifndef MYSQL_SERVER
-void Start_encryption_log_event::print(FILE* file,
+bool Start_encryption_log_event::print(FILE* file,
PRINT_EVENT_INFO* print_event_info)
{
Write_on_release_cache cache(&print_event_info->head_cache, file);
@@ -6296,7 +6644,9 @@ void Start_encryption_log_event::print(FILE* file,
buf.append(STRING_WITH_LEN(", nonce: "));
buf.append_hex(nonce, BINLOG_NONCE_LENGTH);
buf.append(STRING_WITH_LEN("\n# The rest of the binlog is encrypted!\n"));
- my_b_write(&cache, (uchar*)buf.ptr(), buf.length());
+ if (my_b_write(&cache, (uchar*)buf.ptr(), buf.length()))
+ return 1;
+ return (cache.flush_data());
}
#endif
/**************************************************************************
@@ -6321,7 +6671,7 @@ void Start_encryption_log_event::print(FILE* file,
*/
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
-void Load_log_event::print_query(THD *thd, bool need_db, const char *cs,
+bool Load_log_event::print_query(THD *thd, bool need_db, const char *cs,
String *buf, my_off_t *fn_start,
my_off_t *fn_end, const char *qualify_db)
{
@@ -6417,6 +6767,7 @@ void Load_log_event::print_query(THD *thd, bool need_db, const char *cs,
}
buf->append(STRING_WITH_LEN(")"));
}
+ return 0;
}
@@ -6660,26 +7011,27 @@ err:
*/
#ifdef MYSQL_CLIENT
-void Load_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
+bool Load_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
{
- print(file, print_event_info, 0);
+ return print(file, print_event_info, 0);
}
-void Load_log_event::print(FILE* file_arg, PRINT_EVENT_INFO* print_event_info,
+bool Load_log_event::print(FILE* file_arg, PRINT_EVENT_INFO* print_event_info,
bool commented)
{
Write_on_release_cache cache(&print_event_info->head_cache, file_arg);
-
+ bool different_db= 1;
DBUG_ENTER("Load_log_event::print");
+
if (!print_event_info->short_form)
{
- print_header(&cache, print_event_info, FALSE);
- my_b_printf(&cache, "\tQuery\tthread_id=%ld\texec_time=%ld\n",
- thread_id, exec_time);
+ if (print_header(&cache, print_event_info, FALSE) ||
+ my_b_printf(&cache, "\tQuery\tthread_id=%ld\texec_time=%ld\n",
+ thread_id, exec_time))
+ goto err;
}
- bool different_db= 1;
if (db)
{
/*
@@ -6692,69 +7044,86 @@ void Load_log_event::print(FILE* file_arg, PRINT_EVENT_INFO* print_event_info,
!commented)
memcpy(print_event_info->db, db, db_len + 1);
}
-
+
if (db && db[0] && different_db)
- my_b_printf(&cache, "%suse %`s%s\n",
- commented ? "# " : "",
- db, print_event_info->delimiter);
+ if (my_b_printf(&cache, "%suse %`s%s\n",
+ commented ? "# " : "",
+ db, print_event_info->delimiter))
+ goto err;
if (flags & LOG_EVENT_THREAD_SPECIFIC_F)
- my_b_printf(&cache,"%sSET @@session.pseudo_thread_id=%lu%s\n",
- commented ? "# " : "", (ulong)thread_id,
- print_event_info->delimiter);
- my_b_printf(&cache, "%sLOAD DATA ",
- commented ? "# " : "");
+ if (my_b_printf(&cache,"%sSET @@session.pseudo_thread_id=%lu%s\n",
+ commented ? "# " : "", (ulong)thread_id,
+ print_event_info->delimiter))
+ goto err;
+ if (my_b_printf(&cache, "%sLOAD DATA ",
+ commented ? "# " : ""))
+ goto err;
if (check_fname_outside_temp_buf())
- my_b_write_string(&cache, "LOCAL ");
- my_b_printf(&cache, "INFILE '%-*s' ", fname_len, fname);
+ if (my_b_write_string(&cache, "LOCAL "))
+ goto err;
+ if (my_b_printf(&cache, "INFILE '%-*s' ", fname_len, fname))
+ goto err;
if (sql_ex.opt_flags & REPLACE_FLAG)
- my_b_write_string(&cache, "REPLACE ");
+ {
+ if (my_b_write_string(&cache, "REPLACE "))
+ goto err;
+ }
else if (sql_ex.opt_flags & IGNORE_FLAG)
- my_b_write_string(&cache, "IGNORE ");
-
- my_b_printf(&cache, "INTO TABLE `%s`", table_name);
- my_b_write_string(&cache, " FIELDS TERMINATED BY ");
- pretty_print_str(&cache, sql_ex.field_term, sql_ex.field_term_len);
+ if (my_b_write_string(&cache, "IGNORE "))
+ goto err;
- if (sql_ex.opt_flags & OPT_ENCLOSED_FLAG)
- my_b_write_string(&cache, " OPTIONALLY ");
- my_b_write_string(&cache, " ENCLOSED BY ");
- pretty_print_str(&cache, sql_ex.enclosed, sql_ex.enclosed_len);
-
- my_b_write_string(&cache, " ESCAPED BY ");
- pretty_print_str(&cache, sql_ex.escaped, sql_ex.escaped_len);
-
- my_b_write_string(&cache, " LINES TERMINATED BY ");
- pretty_print_str(&cache, sql_ex.line_term, sql_ex.line_term_len);
+ if (my_b_printf(&cache, "INTO TABLE `%s`", table_name) ||
+ my_b_write_string(&cache, " FIELDS TERMINATED BY ") ||
+ pretty_print_str(&cache, sql_ex.field_term, sql_ex.field_term_len))
+ goto err;
+ if (sql_ex.opt_flags & OPT_ENCLOSED_FLAG)
+ if (my_b_write_string(&cache, " OPTIONALLY "))
+ goto err;
+ if (my_b_write_string(&cache, " ENCLOSED BY ") ||
+ pretty_print_str(&cache, sql_ex.enclosed, sql_ex.enclosed_len) ||
+ my_b_write_string(&cache, " ESCAPED BY ") ||
+ pretty_print_str(&cache, sql_ex.escaped, sql_ex.escaped_len) ||
+ my_b_write_string(&cache, " LINES TERMINATED BY ") ||
+ pretty_print_str(&cache, sql_ex.line_term, sql_ex.line_term_len))
+ goto err;
if (sql_ex.line_start)
{
- my_b_write_string(&cache," STARTING BY ");
- pretty_print_str(&cache, sql_ex.line_start, sql_ex.line_start_len);
+ if (my_b_write_string(&cache," STARTING BY ") ||
+ pretty_print_str(&cache, sql_ex.line_start, sql_ex.line_start_len))
+ goto err;
}
if ((long) skip_lines > 0)
- my_b_printf(&cache, " IGNORE %ld LINES", (long) skip_lines);
+ if (my_b_printf(&cache, " IGNORE %ld LINES", (long) skip_lines))
+ goto err;
if (num_fields)
{
uint i;
const char* field = fields;
- my_b_write_string(&cache, " (");
+ if (my_b_write_string(&cache, " ("))
+ goto err;
for (i = 0; i < num_fields; i++)
{
if (i)
- my_b_write_byte(&cache, ',');
- my_b_printf(&cache, "%`s", field);
-
+ if (my_b_write_byte(&cache, ','))
+ goto err;
+ if (my_b_printf(&cache, "%`s", field))
+ goto err;
field += field_lens[i] + 1;
}
- my_b_write_byte(&cache, ')');
+ if (my_b_write_byte(&cache, ')'))
+ goto err;
}
- my_b_printf(&cache, "%s\n", print_event_info->delimiter);
- DBUG_VOID_RETURN;
+ if (my_b_printf(&cache, "%s\n", print_event_info->delimiter))
+ goto err;
+ DBUG_RETURN(cache.flush_data());
+err:
+ DBUG_RETURN(1);
}
#endif /* MYSQL_CLIENT */
@@ -7113,19 +7482,25 @@ void Rotate_log_event::pack_info(Protocol *protocol)
*/
#ifdef MYSQL_CLIENT
-void Rotate_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
+bool Rotate_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
{
+ if (print_event_info->short_form)
+ return 0;
+
char buf[22];
Write_on_release_cache cache(&print_event_info->head_cache, file,
Write_on_release_cache::FLUSH_F);
-
- if (print_event_info->short_form)
- return;
- print_header(&cache, print_event_info, FALSE);
- my_b_write_string(&cache, "\tRotate to ");
+ if (print_header(&cache, print_event_info, FALSE) ||
+ my_b_write_string(&cache, "\tRotate to "))
+ goto err;
if (new_log_ident)
- my_b_write(&cache, (uchar*) new_log_ident, (uint)ident_len);
- my_b_printf(&cache, " pos: %s\n", llstr(pos, buf));
+ if (my_b_write(&cache, (uchar*) new_log_ident, (uint)ident_len))
+ goto err;
+ if (my_b_printf(&cache, " pos: %s\n", llstr(pos, buf)))
+ goto err;
+ return cache.flush_data();
+err:
+ return 1;
}
#endif /* MYSQL_CLIENT */
@@ -7330,18 +7705,21 @@ Binlog_checkpoint_log_event::do_shall_skip(rpl_group_info *rgi)
#ifdef MYSQL_CLIENT
-void Binlog_checkpoint_log_event::print(FILE *file,
+bool Binlog_checkpoint_log_event::print(FILE *file,
PRINT_EVENT_INFO *print_event_info)
{
+ if (print_event_info->short_form)
+ return 0;
+
Write_on_release_cache cache(&print_event_info->head_cache, file,
Write_on_release_cache::FLUSH_F);
- if (print_event_info->short_form)
- return;
- print_header(&cache, print_event_info, FALSE);
- my_b_write_string(&cache, "\tBinlog checkpoint ");
- my_b_write(&cache, (uchar*)binlog_file_name, binlog_file_len);
- my_b_write_byte(&cache, '\n');
+ if (print_header(&cache, print_event_info, FALSE) ||
+ my_b_write_string(&cache, "\tBinlog checkpoint ") ||
+ my_b_write(&cache, (uchar*)binlog_file_name, binlog_file_len) ||
+ my_b_write_byte(&cache, '\n'))
+ return 1;
+ return cache.flush_data();
}
#endif /* MYSQL_CLIENT */
@@ -7659,7 +8037,7 @@ Gtid_log_event::do_shall_skip(rpl_group_info *rgi)
#else /* !MYSQL_SERVER */
-void
+bool
Gtid_log_event::print(FILE *file, PRINT_EVENT_INFO *print_event_info)
{
Write_on_release_cache cache(&print_event_info->head_cache, file,
@@ -7671,26 +8049,34 @@ Gtid_log_event::print(FILE *file, PRINT_EVENT_INFO *print_event_info)
{
print_header(&cache, print_event_info, FALSE);
longlong10_to_str(seq_no, buf, 10);
- my_b_printf(&cache, "\tGTID %u-%u-%s", domain_id, server_id, buf);
+ if (my_b_printf(&cache, "\tGTID %u-%u-%s", domain_id, server_id, buf))
+ goto err;
if (flags2 & FL_GROUP_COMMIT_ID)
{
longlong10_to_str(commit_id, buf2, 10);
- my_b_printf(&cache, " cid=%s", buf2);
+ if (my_b_printf(&cache, " cid=%s", buf2))
+ goto err;
}
if (flags2 & FL_DDL)
- my_b_write_string(&cache, " ddl");
+ if (my_b_write_string(&cache, " ddl"))
+ goto err;
if (flags2 & FL_TRANSACTIONAL)
- my_b_write_string(&cache, " trans");
+ if (my_b_write_string(&cache, " trans"))
+ goto err;
if (flags2 & FL_WAITED)
- my_b_write_string(&cache, " waited");
- my_b_printf(&cache, "\n");
+ if (my_b_write_string(&cache, " waited"))
+ goto err;
+ if (my_b_printf(&cache, "\n"))
+ goto err;
if (!print_event_info->allow_parallel_printed ||
print_event_info->allow_parallel != !!(flags2 & FL_ALLOW_PARALLEL))
{
- my_b_printf(&cache,
+ if (my_b_printf(&cache,
"/*!100101 SET @@session.skip_parallel_replication=%u*/%s\n",
- !(flags2 & FL_ALLOW_PARALLEL), print_event_info->delimiter);
+ !(flags2 & FL_ALLOW_PARALLEL),
+ print_event_info->delimiter))
+ goto err;
print_event_info->allow_parallel= !!(flags2 & FL_ALLOW_PARALLEL);
print_event_info->allow_parallel_printed= true;
}
@@ -7698,8 +8084,10 @@ Gtid_log_event::print(FILE *file, PRINT_EVENT_INFO *print_event_info)
if (!print_event_info->domain_id_printed ||
print_event_info->domain_id != domain_id)
{
- my_b_printf(&cache, "/*!100001 SET @@session.gtid_domain_id=%u*/%s\n",
- domain_id, print_event_info->delimiter);
+ if (my_b_printf(&cache,
+ "/*!100001 SET @@session.gtid_domain_id=%u*/%s\n",
+ domain_id, print_event_info->delimiter))
+ goto err;
print_event_info->domain_id= domain_id;
print_event_info->domain_id_printed= true;
}
@@ -7707,18 +8095,25 @@ Gtid_log_event::print(FILE *file, PRINT_EVENT_INFO *print_event_info)
if (!print_event_info->server_id_printed ||
print_event_info->server_id != server_id)
{
- my_b_printf(&cache, "/*!100001 SET @@session.server_id=%u*/%s\n",
- server_id, print_event_info->delimiter);
+ if (my_b_printf(&cache, "/*!100001 SET @@session.server_id=%u*/%s\n",
+ server_id, print_event_info->delimiter))
+ goto err;
print_event_info->server_id= server_id;
print_event_info->server_id_printed= true;
}
if (!is_flashback)
- my_b_printf(&cache, "/*!100001 SET @@session.gtid_seq_no=%s*/%s\n",
- buf, print_event_info->delimiter);
+ if (my_b_printf(&cache, "/*!100001 SET @@session.gtid_seq_no=%s*/%s\n",
+ buf, print_event_info->delimiter))
+ goto err;
}
if (!(flags2 & FL_STANDALONE))
- my_b_printf(&cache, is_flashback ? "COMMIT\n%s\n" : "BEGIN\n%s\n", print_event_info->delimiter);
+ if (my_b_printf(&cache, is_flashback ? "COMMIT\n%s\n" : "BEGIN\n%s\n", print_event_info->delimiter))
+ goto err;
+
+ return cache.flush_data();
+err:
+ return 1;
}
#endif /* MYSQL_SERVER */
@@ -7956,28 +8351,37 @@ Gtid_list_log_event::pack_info(Protocol *protocol)
#else /* !MYSQL_SERVER */
-void
+bool
Gtid_list_log_event::print(FILE *file, PRINT_EVENT_INFO *print_event_info)
{
- if (!print_event_info->short_form)
- {
- Write_on_release_cache cache(&print_event_info->head_cache, file,
- Write_on_release_cache::FLUSH_F);
- char buf[21];
- uint32 i;
+ if (print_event_info->short_form)
+ return 0;
- print_header(&cache, print_event_info, FALSE);
- my_b_printf(&cache, "\tGtid list [");
- for (i= 0; i < count; ++i)
- {
- longlong10_to_str(list[i].seq_no, buf, 10);
- my_b_printf(&cache, "%u-%u-%s", list[i].domain_id,
- list[i].server_id, buf);
- if (i < count-1)
- my_b_printf(&cache, ",\n# ");
- }
- my_b_printf(&cache, "]\n");
+ Write_on_release_cache cache(&print_event_info->head_cache, file,
+ Write_on_release_cache::FLUSH_F);
+ char buf[21];
+ uint32 i;
+
+ if (print_header(&cache, print_event_info, FALSE) ||
+ my_b_printf(&cache, "\tGtid list ["))
+ goto err;
+
+ for (i= 0; i < count; ++i)
+ {
+ longlong10_to_str(list[i].seq_no, buf, 10);
+ if (my_b_printf(&cache, "%u-%u-%s", list[i].domain_id,
+ list[i].server_id, buf))
+ goto err;
+ if (i < count-1)
+ if (my_b_printf(&cache, ",\n# "))
+ goto err;
}
+ if (my_b_printf(&cache, "]\n"))
+ goto err;
+
+ return cache.flush_data();
+err:
+ return 1;
}
#endif /* MYSQL_SERVER */
@@ -8109,7 +8513,7 @@ bool Intvar_log_event::write()
*/
#ifdef MYSQL_CLIENT
-void Intvar_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
+bool Intvar_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
{
char llbuff[22];
const char *UNINIT_VAR(msg);
@@ -8118,11 +8522,13 @@ void Intvar_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
if (!print_event_info->short_form)
{
- print_header(&cache, print_event_info, FALSE);
- my_b_write_string(&cache, "\tIntvar\n");
+ if (print_header(&cache, print_event_info, FALSE) ||
+ my_b_write_string(&cache, "\tIntvar\n"))
+ goto err;
}
- my_b_printf(&cache, "SET ");
+ if (my_b_printf(&cache, "SET "))
+ goto err;
switch (type) {
case LAST_INSERT_ID_EVENT:
msg="LAST_INSERT_ID";
@@ -8135,8 +8541,13 @@ void Intvar_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
msg="INVALID_INT";
break;
}
- my_b_printf(&cache, "%s=%s%s\n",
- msg, llstr(val,llbuff), print_event_info->delimiter);
+ if (my_b_printf(&cache, "%s=%s%s\n",
+ msg, llstr(val,llbuff), print_event_info->delimiter))
+ goto err;
+
+ return cache.flush_data();
+err:
+ return 1;
}
#endif
@@ -8235,7 +8646,7 @@ bool Rand_log_event::write()
#ifdef MYSQL_CLIENT
-void Rand_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
+bool Rand_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
{
Write_on_release_cache cache(&print_event_info->head_cache, file,
Write_on_release_cache::FLUSH_F);
@@ -8243,12 +8654,18 @@ void Rand_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
char llbuff[22],llbuff2[22];
if (!print_event_info->short_form)
{
- print_header(&cache, print_event_info, FALSE);
- my_b_write_string(&cache, "\tRand\n");
+ if (print_header(&cache, print_event_info, FALSE) ||
+ my_b_write_string(&cache, "\tRand\n"))
+ goto err;
}
- my_b_printf(&cache, "SET @@RAND_SEED1=%s, @@RAND_SEED2=%s%s\n",
- llstr(seed1, llbuff),llstr(seed2, llbuff2),
- print_event_info->delimiter);
+ if (my_b_printf(&cache, "SET @@RAND_SEED1=%s, @@RAND_SEED2=%s%s\n",
+ llstr(seed1, llbuff),llstr(seed2, llbuff2),
+ print_event_info->delimiter))
+ goto err;
+
+ return cache.flush_data();
+err:
+ return 1;
}
#endif /* MYSQL_CLIENT */
@@ -8360,7 +8777,7 @@ bool Xid_log_event::write()
#ifdef MYSQL_CLIENT
-void Xid_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
+bool Xid_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
{
Write_on_release_cache cache(&print_event_info->head_cache, file,
Write_on_release_cache::FLUSH_F, this);
@@ -8370,10 +8787,17 @@ void Xid_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
char buf[64];
longlong10_to_str(xid, buf, 10);
- print_header(&cache, print_event_info, FALSE);
- my_b_printf(&cache, "\tXid = %s\n", buf);
+ if (print_header(&cache, print_event_info, FALSE) ||
+ my_b_printf(&cache, "\tXid = %s\n", buf))
+ goto err;
}
- my_b_printf(&cache, is_flashback ? "BEGIN%s\n" : "COMMIT%s\n", print_event_info->delimiter);
+ if (my_b_printf(&cache, is_flashback ? "BEGIN%s\n" : "COMMIT%s\n",
+ print_event_info->delimiter))
+ goto err;
+
+ return cache.flush_data();
+err:
+ return 1;
}
#endif /* MYSQL_CLIENT */
@@ -8762,23 +9186,26 @@ bool User_var_log_event::write()
*/
#ifdef MYSQL_CLIENT
-void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
+bool User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
{
Write_on_release_cache cache(&print_event_info->head_cache, file,
Write_on_release_cache::FLUSH_F);
if (!print_event_info->short_form)
{
- print_header(&cache, print_event_info, FALSE);
- my_b_write_string(&cache, "\tUser_var\n");
+ if (print_header(&cache, print_event_info, FALSE) ||
+ my_b_write_string(&cache, "\tUser_var\n"))
+ goto err;
}
- my_b_write_string(&cache, "SET @");
- my_b_write_backtick_quote(&cache, name, name_len);
+ if (my_b_write_string(&cache, "SET @") ||
+ my_b_write_backtick_quote(&cache, name, name_len))
+ goto err;
if (is_null)
{
- my_b_printf(&cache, ":=NULL%s\n", print_event_info->delimiter);
+ if (my_b_printf(&cache, ":=NULL%s\n", print_event_info->delimiter))
+ goto err;
}
else
{
@@ -8788,13 +9215,17 @@ void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
char real_buf[FMT_G_BUFSIZE(14)];
float8get(real_val, val);
sprintf(real_buf, "%.14g", real_val);
- my_b_printf(&cache, ":=%s%s\n", real_buf, print_event_info->delimiter);
+ if (my_b_printf(&cache, ":=%s%s\n", real_buf,
+ print_event_info->delimiter))
+ goto err;
break;
case INT_RESULT:
char int_buf[22];
longlong10_to_str(uint8korr(val), int_buf,
((flags & User_var_log_event::UNSIGNED_F) ? 10 : -10));
- my_b_printf(&cache, ":=%s%s\n", int_buf, print_event_info->delimiter);
+ if (my_b_printf(&cache, ":=%s%s\n", int_buf,
+ print_event_info->delimiter))
+ goto err;
break;
case DECIMAL_RESULT:
{
@@ -8810,7 +9241,9 @@ void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
bin2decimal((uchar*) val+2, &dec, precision, scale);
decimal2string(&dec, str_buf, &str_len, 0, 0, 0);
str_buf[str_len]= 0;
- my_b_printf(&cache, ":=%s%s\n", str_buf, print_event_info->delimiter);
+ if (my_b_printf(&cache, ":=%s%s\n", str_buf,
+ print_event_info->delimiter))
+ goto err;
break;
}
case STRING_RESULT:
@@ -8831,11 +9264,12 @@ void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
*/
char *hex_str;
CHARSET_INFO *cs;
+ bool error;
// 2 hex digits / byte
hex_str= (char *) my_malloc(2 * val_len + 1 + 3, MYF(MY_WME));
if (!hex_str)
- return;
+ goto err;
str_to_hex(hex_str, val, val_len);
/*
For proper behaviour when mysqlbinlog|mysql, we need to explicitly
@@ -8844,24 +9278,31 @@ void User_var_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
character set. But there's not much to do about this and it's unlikely.
*/
if (!(cs= get_charset(charset_number, MYF(0))))
- /*
+ { /*
Generate an unusable command (=> syntax error) is probably the best
thing we can do here.
*/
- my_b_printf(&cache, ":=???%s\n", print_event_info->delimiter);
+ error= my_b_printf(&cache, ":=???%s\n", print_event_info->delimiter);
+ }
else
- my_b_printf(&cache, ":=_%s %s COLLATE `%s`%s\n",
- cs->csname, hex_str, cs->name,
- print_event_info->delimiter);
+ error= my_b_printf(&cache, ":=_%s %s COLLATE `%s`%s\n",
+ cs->csname, hex_str, cs->name,
+ print_event_info->delimiter);
my_free(hex_str);
- }
+ if (error)
+ goto err;
break;
+ }
case ROW_RESULT:
default:
DBUG_ASSERT(0);
- return;
+ break;
}
}
+
+ return cache.flush_data();
+err:
+ return 1;
}
#endif
@@ -8984,19 +9425,25 @@ User_var_log_event::do_shall_skip(rpl_group_info *rgi)
#ifdef HAVE_REPLICATION
#ifdef MYSQL_CLIENT
-void Unknown_log_event::print(FILE* file_arg, PRINT_EVENT_INFO* print_event_info)
+bool Unknown_log_event::print(FILE* file_arg, PRINT_EVENT_INFO* print_event_info)
{
+ if (print_event_info->short_form)
+ return 0;
+
Write_on_release_cache cache(&print_event_info->head_cache, file_arg);
- if (print_event_info->short_form)
- return;
if (what != ENCRYPTED)
{
- print_header(&cache, print_event_info, FALSE);
- my_b_printf(&cache, "\n# Unknown event\n");
+ if (print_header(&cache, print_event_info, FALSE) ||
+ my_b_printf(&cache, "\n# Unknown event\n"))
+ goto err;
}
- else
- my_b_printf(&cache, "# Encrypted event\n");
+ else if (my_b_printf(&cache, "# Encrypted event\n"))
+ goto err;
+
+ return cache.flush_data();
+err:
+ return 1;
}
#endif
@@ -9009,16 +9456,18 @@ void Unknown_log_event::print(FILE* file_arg, PRINT_EVENT_INFO* print_event_info
*/
#ifdef MYSQL_CLIENT
-void Stop_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
+bool Stop_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
{
+ if (print_event_info->short_form)
+ return 0;
+
Write_on_release_cache cache(&print_event_info->head_cache, file,
Write_on_release_cache::FLUSH_F, this);
- if (print_event_info->short_form)
- return;
-
- print_header(&cache, print_event_info, FALSE);
- my_b_write_string(&cache, "\tStop\n");
+ if (print_header(&cache, print_event_info, FALSE) ||
+ my_b_write_string(&cache, "\tStop\n"))
+ return 1;
+ return cache.flush_data();
}
#endif /* MYSQL_CLIENT */
@@ -9200,22 +9649,25 @@ Create_file_log_event::Create_file_log_event(const char* buf, uint len,
*/
#ifdef MYSQL_CLIENT
-void Create_file_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info,
+bool Create_file_log_event::print(FILE* file,
+ PRINT_EVENT_INFO* print_event_info,
bool enable_local)
{
- Write_on_release_cache cache(&print_event_info->head_cache, file);
-
if (print_event_info->short_form)
{
if (enable_local && check_fname_outside_temp_buf())
- Load_log_event::print(file, print_event_info);
- return;
+ return Load_log_event::print(file, print_event_info);
+ return 0;
}
+ Write_on_release_cache cache(&print_event_info->head_cache, file);
+
if (enable_local)
{
- Load_log_event::print(file, print_event_info,
- !check_fname_outside_temp_buf());
+ if (Load_log_event::print(file, print_event_info,
+ !check_fname_outside_temp_buf()))
+ goto err;
+
/**
reduce the size of io cache so that the write function is called
for every call to my_b_printf().
@@ -9227,16 +9679,24 @@ void Create_file_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info
That one is for "file_id: etc" below: in mysqlbinlog we want the #, in
SHOW BINLOG EVENTS we don't.
*/
- my_b_write_byte(&cache, '#');
+ if (my_b_write_byte(&cache, '#'))
+ goto err;
}
- my_b_printf(&cache, " file_id: %d block_len: %d\n", file_id, block_len);
+ if (my_b_printf(&cache, " file_id: %d block_len: %d\n", file_id, block_len))
+ goto err;
+
+ return cache.flush_data();
+err:
+ return 1;
+
}
-void Create_file_log_event::print(FILE* file, PRINT_EVENT_INFO* print_event_info)
+bool Create_file_log_event::print(FILE* file,
+ PRINT_EVENT_INFO* print_event_info)
{
- print(file, print_event_info, 0);
+ return print(file, print_event_info, 0);
}
#endif /* MYSQL_CLIENT */
@@ -9302,7 +9762,7 @@ int Create_file_log_event::do_apply_event(rpl_group_info *rgi)
fname_buf);
goto err;
}
-
+
// a trick to avoid allocating another buffer
fname= fname_buf;
fname_len= (uint) (strmov(ext, ".data") - fname);
@@ -9317,7 +9777,7 @@ int Create_file_log_event::do_apply_event(rpl_group_info *rgi)
}
end_io_cache(&file);
mysql_file_close(fd, MYF(0));
-
+
// fname_buf now already has .data, not .info, because we did our trick
/* old copy may exist already */
mysql_file_delete(key_file_log_event_data, fname_buf, MYF(0));
@@ -9415,16 +9875,22 @@ bool Append_block_log_event::write()
*/
#ifdef MYSQL_CLIENT
-void Append_block_log_event::print(FILE* file,
+bool Append_block_log_event::print(FILE* file,
PRINT_EVENT_INFO* print_event_info)
{
+ if (print_event_info->short_form)
+ return 0;
+
Write_on_release_cache cache(&print_event_info->head_cache, file);
- if (print_event_info->short_form)
- return;
- print_header(&cache, print_event_info, FALSE);
- my_b_printf(&cache, "\n#%s: file_id: %d block_len: %d\n",
- get_type_str(), file_id, block_len);
+ if (print_header(&cache, print_event_info, FALSE) ||
+ my_b_printf(&cache, "\n#%s: file_id: %d block_len: %d\n",
+ get_type_str(), file_id, block_len))
+ goto err;
+
+ return cache.flush_data();
+err:
+ return 1;
}
#endif /* MYSQL_CLIENT */
@@ -9574,15 +10040,19 @@ bool Delete_file_log_event::write()
*/
#ifdef MYSQL_CLIENT
-void Delete_file_log_event::print(FILE* file,
+bool Delete_file_log_event::print(FILE* file,
PRINT_EVENT_INFO* print_event_info)
{
+ if (print_event_info->short_form)
+ return 0;
+
Write_on_release_cache cache(&print_event_info->head_cache, file);
- if (print_event_info->short_form)
- return;
- print_header(&cache, print_event_info, FALSE);
- my_b_printf(&cache, "\n#Delete_file: file_id=%u\n", file_id);
+ if (print_header(&cache, print_event_info, FALSE) ||
+ my_b_printf(&cache, "\n#Delete_file: file_id=%u\n", file_id))
+ return 1;
+
+ return cache.flush_data();
}
#endif /* MYSQL_CLIENT */
@@ -9674,16 +10144,20 @@ bool Execute_load_log_event::write()
*/
#ifdef MYSQL_CLIENT
-void Execute_load_log_event::print(FILE* file,
+bool Execute_load_log_event::print(FILE* file,
PRINT_EVENT_INFO* print_event_info)
{
+ if (print_event_info->short_form)
+ return 0;
+
Write_on_release_cache cache(&print_event_info->head_cache, file);
- if (print_event_info->short_form)
- return;
- print_header(&cache, print_event_info, FALSE);
- my_b_printf(&cache, "\n#Exec_load: file_id=%d\n",
- file_id);
+ if (print_header(&cache, print_event_info, FALSE) ||
+ my_b_printf(&cache, "\n#Exec_load: file_id=%d\n",
+ file_id))
+ return 1;
+
+ return cache.flush_data();
}
#endif
@@ -9905,22 +10379,24 @@ Execute_load_query_log_event::write_post_header_for_derived()
#ifdef MYSQL_CLIENT
-void Execute_load_query_log_event::print(FILE* file,
+bool Execute_load_query_log_event::print(FILE* file,
PRINT_EVENT_INFO* print_event_info)
{
- print(file, print_event_info, 0);
+ return print(file, print_event_info, 0);
}
/**
Prints the query as LOAD DATA LOCAL and with rewritten filename.
*/
-void Execute_load_query_log_event::print(FILE* file,
+bool Execute_load_query_log_event::print(FILE* file,
PRINT_EVENT_INFO* print_event_info,
const char *local_fname)
{
Write_on_release_cache cache(&print_event_info->head_cache, file);
- print_query_header(&cache, print_event_info);
+ if (print_query_header(&cache, print_event_info))
+ goto err;
+
/**
reduce the size of io cache so that the write function is called
for every call to my_b_printf().
@@ -9931,24 +10407,33 @@ void Execute_load_query_log_event::print(FILE* file,
if (local_fname)
{
- my_b_write(&cache, (uchar*) query, fn_pos_start);
- my_b_write_string(&cache, " LOCAL INFILE ");
- pretty_print_str(&cache, local_fname, strlen(local_fname));
+ if (my_b_write(&cache, (uchar*) query, fn_pos_start) ||
+ my_b_write_string(&cache, " LOCAL INFILE ") ||
+ pretty_print_str(&cache, local_fname, strlen(local_fname)))
+ goto err;
if (dup_handling == LOAD_DUP_REPLACE)
- my_b_write_string(&cache, " REPLACE");
- my_b_write_string(&cache, " INTO");
- my_b_write(&cache, (uchar*) query + fn_pos_end, q_len-fn_pos_end);
- my_b_printf(&cache, "\n%s\n", print_event_info->delimiter);
+ if (my_b_write_string(&cache, " REPLACE"))
+ goto err;
+
+ if (my_b_write_string(&cache, " INTO") ||
+ my_b_write(&cache, (uchar*) query + fn_pos_end, q_len-fn_pos_end) ||
+ my_b_printf(&cache, "\n%s\n", print_event_info->delimiter))
+ goto err;
}
else
{
- my_b_write(&cache, (uchar*) query, q_len);
- my_b_printf(&cache, "\n%s\n", print_event_info->delimiter);
+ if (my_b_write(&cache, (uchar*) query, q_len) ||
+ my_b_printf(&cache, "\n%s\n", print_event_info->delimiter))
+ goto err;
}
if (!print_event_info->short_form)
my_b_printf(&cache, "# file_id: %d \n", file_id);
+
+ return cache.flush_data();
+err:
+ return 1;
}
#endif
@@ -10928,7 +11413,7 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi)
if (global_system_variables.log_warnings)
slave_rows_error_report(WARNING_LEVEL, error, rgi, thd, table,
get_type_str(),
- RPL_LOG_NAME, (ulong) log_pos);
+ RPL_LOG_NAME, log_pos);
thd->clear_error(1);
error= 0;
if (idempotent_error == 0)
@@ -10980,7 +11465,7 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi)
if (global_system_variables.log_warnings)
slave_rows_error_report(WARNING_LEVEL, error, rgi, thd, table,
get_type_str(),
- RPL_LOG_NAME, (ulong) log_pos);
+ RPL_LOG_NAME, log_pos);
thd->clear_error(1);
error= 0;
}
@@ -10991,7 +11476,7 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi)
{
slave_rows_error_report(ERROR_LEVEL, error, rgi, thd, table,
get_type_str(),
- RPL_LOG_NAME, (ulong) log_pos);
+ RPL_LOG_NAME, log_pos);
/*
@todo We should probably not call
reset_current_stmt_binlog_format_row() from here.
@@ -11021,7 +11506,7 @@ int Rows_log_event::do_apply_event(rpl_group_info *rgi)
thd->is_error() ? 0 : error,
rgi, thd, table,
get_type_str(),
- RPL_LOG_NAME, (ulong) log_pos);
+ RPL_LOG_NAME, log_pos);
DBUG_RETURN(error);
err:
@@ -11261,7 +11746,7 @@ void Rows_log_event::pack_info(Protocol *protocol)
#endif
#ifdef MYSQL_CLIENT
-void Rows_log_event::print_helper(FILE *file,
+bool Rows_log_event::print_helper(FILE *file,
PRINT_EVENT_INFO *print_event_info,
char const *const name)
{
@@ -11270,33 +11755,51 @@ void Rows_log_event::print_helper(FILE *file,
#ifdef WHEN_FLASHBACK_REVIEW_READY
IO_CACHE *const sql= &print_event_info->review_sql_cache;
#endif
+ bool const last_stmt_event= get_flags(STMT_END_F);
if (!print_event_info->short_form)
{
- bool const last_stmt_event= get_flags(STMT_END_F);
print_header(head, print_event_info, !last_stmt_event);
- my_b_printf(head, "\t%s: table id %lu%s\n",
- name, m_table_id,
- last_stmt_event ? " flags: STMT_END_F" : "");
- print_base64(body, print_event_info, !last_stmt_event);
+ if (my_b_printf(head, "\t%s: table id %lu%s\n",
+ name, m_table_id,
+ last_stmt_event ? " flags: STMT_END_F" : ""))
+ goto err;
}
+ if (!print_event_info->short_form || print_event_info->print_row_count)
+ if (print_base64(body, print_event_info, !last_stmt_event))
+ goto err;
- if (get_flags(STMT_END_F))
+ if (last_stmt_event)
{
- LEX_STRING tmp_str;
-
- copy_event_cache_to_string_and_reinit(head, &tmp_str);
- output_buf.append(&tmp_str);
- my_free(tmp_str.str);
- copy_event_cache_to_string_and_reinit(body, &tmp_str);
- output_buf.append(&tmp_str);
- my_free(tmp_str.str);
+ if (!is_flashback)
+ {
+ if (copy_event_cache_to_file_and_reinit(head, file) ||
+ copy_event_cache_to_file_and_reinit(body, file))
+ goto err;
+ }
+ else
+ {
+ LEX_STRING tmp_str;
+ if (copy_event_cache_to_string_and_reinit(head, &tmp_str))
+ return 1;
+ output_buf.append(&tmp_str);
+ my_free(tmp_str.str);
+ if (copy_event_cache_to_string_and_reinit(body, &tmp_str))
+ return 1;
+ output_buf.append(&tmp_str);
+ my_free(tmp_str.str);
#ifdef WHEN_FLASHBACK_REVIEW_READY
- copy_event_cache_to_string_and_reinit(sql, &tmp_str);
- output_buf.append(&tmp_str);
- my_free(tmp_str.str);
+ if (copy_event_cache_to_string_and_reinit(sql, &tmp_str))
+ return 1;
+ output_buf.append(&tmp_str);
+ my_free(tmp_str.str);
#endif
+ }
}
+
+ return 0;
+err:
+ return 1;
}
#endif
@@ -11384,25 +11887,28 @@ void Annotate_rows_log_event::pack_info(Protocol* protocol)
#endif
#ifdef MYSQL_CLIENT
-void Annotate_rows_log_event::print(FILE *file, PRINT_EVENT_INFO *pinfo)
+bool Annotate_rows_log_event::print(FILE *file, PRINT_EVENT_INFO *pinfo)
{
- if (pinfo->short_form)
- return;
-
- print_header(&pinfo->head_cache, pinfo, TRUE);
- my_b_printf(&pinfo->head_cache, "\tAnnotate_rows:\n");
-
char *pbeg; // beginning of the next line
char *pend; // end of the next line
uint cnt= 0; // characters counter
+ if (!pinfo->short_form)
+ {
+ if (print_header(&pinfo->head_cache, pinfo, TRUE) ||
+ my_b_printf(&pinfo->head_cache, "\tAnnotate_rows:\n"))
+ goto err;
+ }
+ else if (my_b_printf(&pinfo->head_cache, "# Annotate_rows:\n"))
+ goto err;
+
for (pbeg= m_query_txt; ; pbeg= pend)
{
// skip all \r's and \n's at the beginning of the next line
for (;; pbeg++)
{
if (++cnt > m_query_len)
- return;
+ return 0;
if (*pbeg != '\r' && *pbeg != '\n')
break;
@@ -11415,10 +11921,15 @@ void Annotate_rows_log_event::print(FILE *file, PRINT_EVENT_INFO *pinfo)
;
// print next line
- my_b_write(&pinfo->head_cache, (const uchar*) "#Q> ", 4);
- my_b_write(&pinfo->head_cache, (const uchar*) pbeg, pend - pbeg);
- my_b_write(&pinfo->head_cache, (const uchar*) "\n", 1);
+ if (my_b_write(&pinfo->head_cache, (const uchar*) "#Q> ", 4) ||
+ my_b_write(&pinfo->head_cache, (const uchar*) pbeg, pend - pbeg) ||
+ my_b_write(&pinfo->head_cache, (const uchar*) "\n", 1))
+ goto err;
}
+
+ return 0;
+err:
+ return 1;
}
#endif
@@ -11715,7 +12226,7 @@ Table_map_log_event::Table_map_log_event(const char *buf, uint event_len,
ptr_after_colcnt= ptr_after_colcnt + m_colcnt;
bytes_read= (uint) (ptr_after_colcnt - (uchar *)buf);
- DBUG_PRINT("info", ("Bytes read: %d.\n", bytes_read));
+ DBUG_PRINT("info", ("Bytes read: %d", bytes_read));
if (bytes_read < event_len)
{
m_field_metadata_size= net_field_length(&ptr_after_colcnt);
@@ -12153,19 +12664,29 @@ void Table_map_log_event::pack_info(Protocol *protocol)
#ifdef MYSQL_CLIENT
-void Table_map_log_event::print(FILE *file, PRINT_EVENT_INFO *print_event_info)
+bool Table_map_log_event::print(FILE *file, PRINT_EVENT_INFO *print_event_info)
{
if (!print_event_info->short_form)
{
print_header(&print_event_info->head_cache, print_event_info, TRUE);
- my_b_printf(&print_event_info->head_cache,
- "\tTable_map: %`s.%`s mapped to number %lu%s\n",
- m_dbnam, m_tblnam, m_table_id,
- ((m_flags & TM_BIT_HAS_TRIGGERS_F) ?
- " (has triggers)" : ""));
- print_base64(&print_event_info->body_cache, print_event_info, TRUE);
- copy_event_cache_to_file_and_reinit(&print_event_info->head_cache, file);
+ if (my_b_printf(&print_event_info->head_cache,
+ "\tTable_map: %`s.%`s mapped to number %lu%s\n",
+ m_dbnam, m_tblnam, m_table_id,
+ ((m_flags & TM_BIT_HAS_TRIGGERS_F) ?
+ " (has triggers)" : "")))
+ goto err;
+ }
+ if (!print_event_info->short_form || print_event_info->print_row_count)
+ {
+ if (print_base64(&print_event_info->body_cache, print_event_info, TRUE) ||
+ copy_event_cache_to_file_and_reinit(&print_event_info->head_cache,
+ file))
+ goto err;
}
+
+ return 0;
+err:
+ return 1;
}
#endif
@@ -12735,14 +13256,14 @@ Write_rows_log_event::do_exec_row(rpl_group_info *rgi)
#endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */
#ifdef MYSQL_CLIENT
-void Write_rows_log_event::print(FILE *file, PRINT_EVENT_INFO* print_event_info)
+bool Write_rows_log_event::print(FILE *file, PRINT_EVENT_INFO* print_event_info)
{
DBUG_EXECUTE_IF("simulate_cache_read_error",
{DBUG_SET("+d,simulate_my_b_fill_error");});
- Rows_log_event::print_helper(file, print_event_info, is_flashback ? "Delete_rows" : "Write_rows");
+ return Rows_log_event::print_helper(file, print_event_info, is_flashback ? "Delete_rows" : "Write_rows");
}
-void Write_rows_compressed_log_event::print(FILE *file,
+bool Write_rows_compressed_log_event::print(FILE *file,
PRINT_EVENT_INFO* print_event_info)
{
char *new_buf;
@@ -12754,14 +13275,20 @@ void Write_rows_compressed_log_event::print(FILE *file,
{
free_temp_buf();
register_temp_buf(new_buf, true);
- Rows_log_event::print_helper(file, print_event_info,
- "Write_compressed_rows");
+ if (Rows_log_event::print_helper(file, print_event_info,
+ "Write_compressed_rows"))
+ goto err;
}
else
{
- my_b_printf(&print_event_info->head_cache,
- "ERROR: uncompress write_compressed_rows failed\n");
+ if (my_b_printf(&print_event_info->head_cache,
+ "ERROR: uncompress write_compressed_rows failed\n"))
+ goto err;
}
+
+ return 0;
+err:
+ return 1;
}
#endif
@@ -13409,13 +13936,13 @@ int Delete_rows_log_event::do_exec_row(rpl_group_info *rgi)
#endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */
#ifdef MYSQL_CLIENT
-void Delete_rows_log_event::print(FILE *file,
+bool Delete_rows_log_event::print(FILE *file,
PRINT_EVENT_INFO* print_event_info)
{
- Rows_log_event::print_helper(file, print_event_info, is_flashback ? "Write_rows" : "Delete_rows");
+ return Rows_log_event::print_helper(file, print_event_info, is_flashback ? "Write_rows" : "Delete_rows");
}
-void Delete_rows_compressed_log_event::print(FILE *file,
+bool Delete_rows_compressed_log_event::print(FILE *file,
PRINT_EVENT_INFO* print_event_info)
{
char *new_buf;
@@ -13427,14 +13954,20 @@ void Delete_rows_compressed_log_event::print(FILE *file,
{
free_temp_buf();
register_temp_buf(new_buf, true);
- Rows_log_event::print_helper(file, print_event_info,
- "Delete_compressed_rows");
+ if (Rows_log_event::print_helper(file, print_event_info,
+ "Delete_compressed_rows"))
+ goto err;
}
else
{
- my_b_printf(&print_event_info->head_cache,
- "ERROR: uncompress delete_compressed_rows failed\n");
+ if (my_b_printf(&print_event_info->head_cache,
+ "ERROR: uncompress delete_compressed_rows failed\n"))
+ goto err;
}
+
+ return 0;
+err:
+ return 1;
}
#endif
@@ -13670,13 +14203,15 @@ err:
#endif /* !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION) */
#ifdef MYSQL_CLIENT
-void Update_rows_log_event::print(FILE *file,
+bool Update_rows_log_event::print(FILE *file,
PRINT_EVENT_INFO* print_event_info)
{
- Rows_log_event::print_helper(file, print_event_info, "Update_rows");
+ return Rows_log_event::print_helper(file, print_event_info, "Update_rows");
}
-void Update_rows_compressed_log_event::print(FILE *file, PRINT_EVENT_INFO *print_event_info)
+bool
+Update_rows_compressed_log_event::print(FILE *file,
+ PRINT_EVENT_INFO *print_event_info)
{
char *new_buf;
ulong len;
@@ -13687,14 +14222,20 @@ void Update_rows_compressed_log_event::print(FILE *file, PRINT_EVENT_INFO *print
{
free_temp_buf();
register_temp_buf(new_buf, true);
- Rows_log_event::print_helper(file, print_event_info,
- "Update_compressed_rows");
+ if (Rows_log_event::print_helper(file, print_event_info,
+ "Update_compressed_rows"))
+ goto err;
}
else
{
- my_b_printf(&print_event_info->head_cache,
- "ERROR: uncompress update_compressed_rows failed\n");
+ if (my_b_printf(&print_event_info->head_cache,
+ "ERROR: uncompress update_compressed_rows failed\n"))
+ goto err;
}
+
+ return 0;
+err:
+ return 1;
}
#endif
@@ -13833,16 +14374,18 @@ err:
#ifdef MYSQL_CLIENT
-void
-Incident_log_event::print(FILE *file,
- PRINT_EVENT_INFO *print_event_info)
+bool Incident_log_event::print(FILE *file,
+ PRINT_EVENT_INFO *print_event_info)
{
if (print_event_info->short_form)
- return;
+ return 0;
Write_on_release_cache cache(&print_event_info->head_cache, file);
- print_header(&cache, print_event_info, FALSE);
- my_b_printf(&cache, "\n# Incident: %s\nRELOAD DATABASE; # Shall generate syntax error\n", description());
+
+ if (print_header(&cache, print_event_info, FALSE) ||
+ my_b_printf(&cache, "\n# Incident: %s\nRELOAD DATABASE; # Shall generate syntax error\n", description()))
+ return 1;
+ return cache.flush_data();
}
#endif
@@ -13918,19 +14461,20 @@ void Ignorable_log_event::pack_info(Protocol *protocol)
#ifdef MYSQL_CLIENT
/* Print for its unrecognized ignorable event */
-void
-Ignorable_log_event::print(FILE *file,
- PRINT_EVENT_INFO *print_event_info)
+bool Ignorable_log_event::print(FILE *file,
+ PRINT_EVENT_INFO *print_event_info)
{
if (print_event_info->short_form)
- return;
+ return 0;
- print_header(&print_event_info->head_cache, print_event_info, FALSE);
- my_b_printf(&print_event_info->head_cache, "\tIgnorable\n");
- my_b_printf(&print_event_info->head_cache,
- "# Ignorable event type %d (%s)\n", number, description);
- copy_event_cache_to_file_and_reinit(&print_event_info->head_cache,
- file);
+ if (print_header(&print_event_info->head_cache, print_event_info, FALSE) ||
+ my_b_printf(&print_event_info->head_cache, "\tIgnorable\n") ||
+ my_b_printf(&print_event_info->head_cache,
+ "# Ignorable event type %d (%s)\n", number, description) ||
+ copy_event_cache_to_file_and_reinit(&print_event_info->head_cache,
+ file))
+ return 1;
+ return 0;
}
#endif
@@ -13942,15 +14486,8 @@ Ignorable_log_event::print(FILE *file,
they will always be printed for the first event.
*/
st_print_event_info::st_print_event_info()
- :flags2_inited(0), sql_mode_inited(0), sql_mode(0),
- auto_increment_increment(0),auto_increment_offset(0), charset_inited(0),
- lc_time_names_number(~0),
- charset_database_number(ILLEGAL_CHARSET_INFO_NUMBER),
- thread_id(0), thread_id_printed(false), server_id(0),
- server_id_printed(false), domain_id(0), domain_id_printed(false),
- allow_parallel(true), allow_parallel_printed(false), skip_replication(0),
- base64_output_mode(BASE64_OUTPUT_UNSPEC), printed_fd_event(FALSE)
{
+ myf const flags = MYF(MY_WME | MY_NABP);
/*
Currently we only use static PRINT_EVENT_INFO objects, so zeroed at
program's startup, but these explicit bzero() is for the day someone
@@ -13961,14 +14498,67 @@ st_print_event_info::st_print_event_info()
bzero(time_zone_str, sizeof(time_zone_str));
delimiter[0]= ';';
delimiter[1]= 0;
- myf const flags = MYF(MY_WME | MY_NABP);
+ flags2_inited= 0;
+ sql_mode_inited= 0;
+ row_events= 0;
+ sql_mode= 0;
+ auto_increment_increment= 0;
+ auto_increment_offset= 0;
+ charset_inited= 0;
+ lc_time_names_number= ~0;
+ charset_database_number= ILLEGAL_CHARSET_INFO_NUMBER;
+ thread_id= 0;
+ server_id= 0;
+ domain_id= 0;
+ thread_id_printed= false;
+ server_id_printed= false;
+ domain_id_printed= false;
+ allow_parallel= true;
+ allow_parallel_printed= false;
+ found_row_event= false;
+ print_row_count= false;
+ short_form= false;
+ skip_replication= 0;
+ printed_fd_event=FALSE;
+ file= 0;
+ base64_output_mode=BASE64_OUTPUT_UNSPEC;
open_cached_file(&head_cache, NULL, NULL, 0, flags);
open_cached_file(&body_cache, NULL, NULL, 0, flags);
#ifdef WHEN_FLASHBACK_REVIEW_READY
open_cached_file(&review_sql_cache, NULL, NULL, 0, flags);
#endif
}
-#endif
+
+
+bool copy_event_cache_to_string_and_reinit(IO_CACHE *cache, LEX_STRING *to)
+{
+ reinit_io_cache(cache, READ_CACHE, 0L, FALSE, FALSE);
+ if (!(to->str= (char*) my_malloc((to->length= cache->end_of_file), MYF(0))))
+ {
+ perror("Out of memory: can't allocate memory in copy_event_cache_to_string_and_reinit().");
+ goto err;
+ }
+ if (my_b_read(cache, (uchar*) to->str, to->length))
+ {
+ my_free(to->str);
+ perror("Can't read data from IO_CACHE");
+ return true;
+ }
+ reinit_io_cache(cache, WRITE_CACHE, 0, FALSE, TRUE);
+ return false;
+
+err:
+ to->str= 0;
+ to->length= 0;
+ return true;
+}
+#endif /* MYSQL_CLIENT */
+
+bool copy_event_cache_to_file_and_reinit(IO_CACHE *cache, FILE *file)
+{
+ return (my_b_copy_to_file(cache, file) ||
+ reinit_io_cache(cache, WRITE_CACHE, 0, FALSE, TRUE));
+}
#if defined(HAVE_REPLICATION) && !defined(MYSQL_CLIENT)
Heartbeat_log_event::Heartbeat_log_event(const char* buf, uint event_len,
@@ -14006,4 +14596,4 @@ bool event_that_should_be_ignored(const char *buf)
return 1;
return 0;
}
-#endif
+#endif /* MYSQL_SERVER */
diff --git a/sql/log_event.h b/sql/log_event.h
index 9fb14f0eae1..1feaee86ec7 100644
--- a/sql/log_event.h
+++ b/sql/log_event.h
@@ -802,6 +802,8 @@ class Format_description_log_event;
class Relay_log_info;
class binlog_cache_data;
+bool copy_event_cache_to_file_and_reinit(IO_CACHE *cache, FILE *file);
+
#ifdef MYSQL_CLIENT
enum enum_base64_output_mode {
BASE64_OUTPUT_NEVER= 0,
@@ -813,6 +815,8 @@ enum enum_base64_output_mode {
BASE64_OUTPUT_MODE_COUNT
};
+bool copy_event_cache_to_string_and_reinit(IO_CACHE *cache, LEX_STRING *to);
+
/*
A structure for mysqlbinlog to know how to print events
@@ -832,53 +836,38 @@ typedef struct st_print_event_info
that was printed. We cache these so that we don't have to print
them if they are unchanged.
*/
- // TODO: have the last catalog here ??
char db[FN_REFLEN+1]; // TODO: make this a LEX_STRING when thd->db is
- bool flags2_inited;
- uint32 flags2;
- bool sql_mode_inited;
- sql_mode_t sql_mode; /* must be same as THD.variables.sql_mode */
- ulong auto_increment_increment, auto_increment_offset;
- bool charset_inited;
char charset[6]; // 3 variables, each of them storable in 2 bytes
char time_zone_str[MAX_TIME_ZONE_NAME_LENGTH];
+ char delimiter[16];
+ sql_mode_t sql_mode; /* must be same as THD.variables.sql_mode */
+ my_thread_id thread_id;
+ ulonglong row_events;
+ ulong auto_increment_increment, auto_increment_offset;
uint lc_time_names_number;
uint charset_database_number;
- my_thread_id thread_id;
- bool thread_id_printed;
+ uint verbose;
+ uint32 flags2;
uint32 server_id;
- bool server_id_printed;
uint32 domain_id;
+ uint8 common_header_len;
+ enum_base64_output_mode base64_output_mode;
+ my_off_t hexdump_from;
+
+ table_mapping m_table_map;
+ table_mapping m_table_map_ignored;
+ bool flags2_inited;
+ bool sql_mode_inited;
+ bool charset_inited;
+ bool thread_id_printed;
+ bool server_id_printed;
bool domain_id_printed;
bool allow_parallel;
bool allow_parallel_printed;
-
- /*
- Track when @@skip_replication changes so we need to output a SET
- statement for it.
- */
- int skip_replication;
-
- st_print_event_info();
-
- ~st_print_event_info() {
- close_cached_file(&head_cache);
- close_cached_file(&body_cache);
-#ifdef WHEN_FLASHBACK_REVIEW_READY
- close_cached_file(&review_sql_cache);
-#endif
- }
- bool init_ok() /* tells if construction was successful */
- { return my_b_inited(&head_cache) && my_b_inited(&body_cache)
-#ifdef WHEN_FLASHBACK_REVIEW_READY
- && my_b_inited(&review_sql_cache)
-#endif
- ; }
-
-
+ bool found_row_event;
+ bool print_row_count;
/* Settings on how to print the events */
bool short_form;
- enum_base64_output_mode base64_output_mode;
/*
This is set whenever a Format_description_event is printed.
Later, when an event is printed in base64, this flag is tested: if
@@ -886,13 +875,11 @@ typedef struct st_print_event_info
the base64 event, so an error message is generated.
*/
bool printed_fd_event;
- my_off_t hexdump_from;
- uint8 common_header_len;
- char delimiter[16];
-
- uint verbose;
- table_mapping m_table_map;
- table_mapping m_table_map_ignored;
+ /*
+ Track when @@skip_replication changes so we need to output a SET
+ statement for it.
+ */
+ bool skip_replication;
/*
These two caches are used by the row-based replication events to
@@ -905,6 +892,28 @@ typedef struct st_print_event_info
/* Storing the SQL for reviewing */
IO_CACHE review_sql_cache;
#endif
+ FILE *file;
+ st_print_event_info();
+
+ ~st_print_event_info() {
+ close_cached_file(&head_cache);
+ close_cached_file(&body_cache);
+#ifdef WHEN_FLASHBACK_REVIEW_READY
+ close_cached_file(&review_sql_cache);
+#endif
+ }
+ bool init_ok() /* tells if construction was successful */
+ { return my_b_inited(&head_cache) && my_b_inited(&body_cache)
+#ifdef WHEN_FLASHBACK_REVIEW_READY
+ && my_b_inited(&review_sql_cache)
+#endif
+ ; }
+ void flush_for_error()
+ {
+ if (!copy_event_cache_to_file_and_reinit(&head_cache, file))
+ copy_event_cache_to_file_and_reinit(&body_cache, file);
+ fflush(file);
+ }
} PRINT_EVENT_INFO;
#endif
@@ -1250,11 +1259,11 @@ public:
Log_event() : temp_buf(0), when(0), flags(0) {}
ha_checksum crc;
/* print*() functions are used by mysqlbinlog */
- virtual void print(FILE* file, PRINT_EVENT_INFO* print_event_info) = 0;
- void print_timestamp(IO_CACHE* file, time_t *ts = 0);
- void print_header(IO_CACHE* file, PRINT_EVENT_INFO* print_event_info,
+ virtual bool print(FILE* file, PRINT_EVENT_INFO* print_event_info) = 0;
+ bool print_timestamp(IO_CACHE* file, time_t *ts = 0);
+ bool print_header(IO_CACHE* file, PRINT_EVENT_INFO* print_event_info,
bool is_more);
- void print_base64(IO_CACHE* file, PRINT_EVENT_INFO* print_event_info,
+ bool print_base64(IO_CACHE* file, PRINT_EVENT_INFO* print_event_info,
bool is_more);
#endif /* MYSQL_SERVER */
@@ -2112,8 +2121,8 @@ public:
void pack_info(Protocol* protocol);
#endif /* HAVE_REPLICATION */
#else
- void print_query_header(IO_CACHE* file, PRINT_EVENT_INFO* print_event_info);
- void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
+ bool print_query_header(IO_CACHE* file, PRINT_EVENT_INFO* print_event_info);
+ bool print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
Query_log_event();
@@ -2452,7 +2461,7 @@ protected:
const Format_description_log_event* description_event);
public:
- void print_query(THD *thd, bool need_db, const char *cs, String *buf,
+ bool print_query(THD *thd, bool need_db, const char *cs, String *buf,
my_off_t *fn_start, my_off_t *fn_end,
const char *qualify_db);
my_thread_id thread_id;
@@ -2518,8 +2527,8 @@ public:
void pack_info(Protocol* protocol);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
- void print(FILE* file, PRINT_EVENT_INFO* print_event_info, bool commented);
+ bool print(FILE* file, PRINT_EVENT_INFO* print_event_info);
+ bool print(FILE* file, PRINT_EVENT_INFO* print_event_info, bool commented);
#endif
/*
@@ -2616,7 +2625,7 @@ public:
#endif /* HAVE_REPLICATION */
#else
Start_log_event_v3() {}
- void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
+ bool print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
Start_log_event_v3(const char* buf, uint event_len,
@@ -2685,7 +2694,7 @@ public:
write_data(nonce, BINLOG_NONCE_LENGTH);
}
#else
- void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
+ bool print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
Start_encryption_log_event(
@@ -2873,7 +2882,7 @@ Intvar_log_event(THD* thd_arg,uchar type_arg, ulonglong val_arg,
void pack_info(Protocol* protocol);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
+ bool print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
Intvar_log_event(const char* buf,
@@ -2954,7 +2963,7 @@ class Rand_log_event: public Log_event
void pack_info(Protocol* protocol);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
+ bool print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
Rand_log_event(const char* buf,
@@ -3004,7 +3013,7 @@ class Xid_log_event: public Log_event
void pack_info(Protocol* protocol);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
+ bool print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
Xid_log_event(const char* buf,
@@ -3066,7 +3075,7 @@ public:
}
void pack_info(Protocol* protocol);
#else
- void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
+ bool print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
User_var_log_event(const char* buf, uint event_len,
@@ -3114,7 +3123,7 @@ public:
Stop_log_event() :Log_event()
{}
#else
- void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
+ bool print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
Stop_log_event(const char* buf,
@@ -3210,7 +3219,7 @@ public:
void pack_info(Protocol* protocol);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
+ bool print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
Rotate_log_event(const char* buf, uint event_len,
@@ -3250,7 +3259,7 @@ public:
void pack_info(Protocol *protocol);
#endif
#else
- void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
+ bool print(FILE *file, PRINT_EVENT_INFO *print_event_info);
#endif
Binlog_checkpoint_log_event(const char *buf, uint event_len,
const Format_description_log_event *description_event);
@@ -3375,7 +3384,7 @@ public:
virtual enum_skip_reason do_shall_skip(rpl_group_info *rgi);
#endif
#else
- void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
+ bool print(FILE *file, PRINT_EVENT_INFO *print_event_info);
#endif
Gtid_log_event(const char *buf, uint event_len,
const Format_description_log_event *description_event);
@@ -3489,7 +3498,7 @@ public:
void pack_info(Protocol *protocol);
#endif
#else
- void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
+ bool print(FILE *file, PRINT_EVENT_INFO *print_event_info);
#endif
Gtid_list_log_event(const char *buf, uint event_len,
const Format_description_log_event *description_event);
@@ -3553,8 +3562,8 @@ public:
void pack_info(Protocol* protocol);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
- void print(FILE* file, PRINT_EVENT_INFO* print_event_info,
+ bool print(FILE* file, PRINT_EVENT_INFO* print_event_info);
+ bool print(FILE* file, PRINT_EVENT_INFO* print_event_info,
bool enable_local);
#endif
@@ -3626,7 +3635,7 @@ public:
virtual int get_create_or_append() const;
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
+ bool print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
Append_block_log_event(const char* buf, uint event_len,
@@ -3666,8 +3675,8 @@ public:
void pack_info(Protocol* protocol);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
- void print(FILE* file, PRINT_EVENT_INFO* print_event_info,
+ bool print(FILE* file, PRINT_EVENT_INFO* print_event_info);
+ bool print(FILE* file, PRINT_EVENT_INFO* print_event_info,
bool enable_local);
#endif
@@ -3707,7 +3716,7 @@ public:
void pack_info(Protocol* protocol);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
+ bool print(FILE* file, PRINT_EVENT_INFO* print_event_info);
#endif
Execute_load_log_event(const char* buf, uint event_len,
@@ -3803,9 +3812,9 @@ public:
void pack_info(Protocol* protocol);
#endif /* HAVE_REPLICATION */
#else
- void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
+ bool print(FILE* file, PRINT_EVENT_INFO* print_event_info);
/* Prints the query as LOAD DATA LOCAL and with rewritten filename */
- void print(FILE* file, PRINT_EVENT_INFO* print_event_info,
+ bool print(FILE* file, PRINT_EVENT_INFO* print_event_info,
const char *local_fname);
#endif
Execute_load_query_log_event(const char* buf, uint event_len,
@@ -3850,7 +3859,7 @@ public:
/* constructor for hopelessly corrupted events */
Unknown_log_event(): Log_event(), what(ENCRYPTED) {}
~Unknown_log_event() {}
- void print(FILE* file, PRINT_EVENT_INFO* print_event_info);
+ bool print(FILE* file, PRINT_EVENT_INFO* print_event_info);
Log_event_type get_type_code() { return UNKNOWN_EVENT;}
bool is_valid() const { return 1; }
};
@@ -3895,7 +3904,7 @@ public:
#endif
#ifdef MYSQL_CLIENT
- virtual void print(FILE*, PRINT_EVENT_INFO*);
+ virtual bool print(FILE*, PRINT_EVENT_INFO*);
#endif
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
@@ -4315,7 +4324,7 @@ public:
#endif
#ifdef MYSQL_CLIENT
- virtual void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
+ virtual bool print(FILE *file, PRINT_EVENT_INFO *print_event_info);
#endif
@@ -4436,15 +4445,21 @@ public:
#ifdef MYSQL_CLIENT
/* not for direct call, each derived has its own ::print() */
- virtual void print(FILE *file, PRINT_EVENT_INFO *print_event_info)= 0;
+ virtual bool print(FILE *file, PRINT_EVENT_INFO *print_event_info)= 0;
void change_to_flashback_event(PRINT_EVENT_INFO *print_event_info, uchar *rows_buff, Log_event_type ev_type);
- void print_verbose(IO_CACHE *file,
+ bool print_verbose(IO_CACHE *file,
PRINT_EVENT_INFO *print_event_info);
size_t print_verbose_one_row(IO_CACHE *file, table_def *td,
PRINT_EVENT_INFO *print_event_info,
MY_BITMAP *cols_bitmap,
const uchar *ptr, const uchar *prefix,
const my_bool no_fill_output= 0); // if no_fill_output=1, then print result is unnecessary
+ size_t calc_row_event_length(table_def *td,
+ PRINT_EVENT_INFO *print_event_info,
+ MY_BITMAP *cols_bitmap,
+ const uchar *value);
+ void count_row_events(PRINT_EVENT_INFO *print_event_info);
+
#endif
#ifdef MYSQL_SERVER
@@ -4551,7 +4566,7 @@ protected:
void uncompress_buf();
#ifdef MYSQL_CLIENT
- void print_helper(FILE *, PRINT_EVENT_INFO *, char const *const name);
+ bool print_helper(FILE *, PRINT_EVENT_INFO *, char const *const name);
#endif
#ifdef MYSQL_SERVER
@@ -4755,7 +4770,7 @@ private:
virtual Log_event_type get_general_type_code() { return (Log_event_type)TYPE_CODE; }
#ifdef MYSQL_CLIENT
- void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
+ bool print(FILE *file, PRINT_EVENT_INFO *print_event_info);
#endif
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
@@ -4779,7 +4794,7 @@ public:
#endif
private:
#if defined(MYSQL_CLIENT)
- void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
+ bool print(FILE *file, PRINT_EVENT_INFO *print_event_info);
#endif
};
@@ -4842,7 +4857,7 @@ protected:
virtual Log_event_type get_general_type_code() { return (Log_event_type)TYPE_CODE; }
#ifdef MYSQL_CLIENT
- void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
+ bool print(FILE *file, PRINT_EVENT_INFO *print_event_info);
#endif
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
@@ -4866,7 +4881,7 @@ public:
#endif
private:
#if defined(MYSQL_CLIENT)
- void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
+ bool print(FILE *file, PRINT_EVENT_INFO *print_event_info);
#endif
};
@@ -4926,7 +4941,7 @@ protected:
virtual Log_event_type get_general_type_code() { return (Log_event_type)TYPE_CODE; }
#ifdef MYSQL_CLIENT
- void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
+ bool print(FILE *file, PRINT_EVENT_INFO *print_event_info);
#endif
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
@@ -4949,7 +4964,7 @@ public:
#endif
private:
#if defined(MYSQL_CLIENT)
- void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
+ bool print(FILE *file, PRINT_EVENT_INFO *print_event_info);
#endif
};
@@ -5043,7 +5058,7 @@ public:
virtual ~Incident_log_event();
#ifdef MYSQL_CLIENT
- virtual void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
+ virtual bool print(FILE *file, PRINT_EVENT_INFO *print_event_info);
#endif
#if defined(MYSQL_SERVER) && defined(HAVE_REPLICATION)
@@ -5110,7 +5125,7 @@ public:
#endif
#ifdef MYSQL_CLIENT
- virtual void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
+ virtual bool print(FILE *file, PRINT_EVENT_INFO *print_event_info);
#endif
virtual Log_event_type get_type_code() { return IGNORABLE_LOG_EVENT; }
@@ -5120,38 +5135,6 @@ public:
virtual int get_data_size() { return IGNORABLE_HEADER_LEN; }
};
-
-static inline bool copy_event_cache_to_string_and_reinit(IO_CACHE *cache, LEX_STRING *to)
-{
- String tmp;
-
- reinit_io_cache(cache, READ_CACHE, 0L, FALSE, FALSE);
- if (tmp.append(cache, (uint32)cache->end_of_file))
- goto err;
- reinit_io_cache(cache, WRITE_CACHE, 0, FALSE, TRUE);
-
- /*
- Can't change the order, because the String::release() will clear the
- length.
- */
- to->length= tmp.length();
- to->str= tmp.release();
-
- return false;
-
-err:
- perror("Out of memory: can't allocate memory in copy_event_cache_to_string_and_reinit().");
- return true;
-}
-
-static inline bool copy_event_cache_to_file_and_reinit(IO_CACHE *cache,
- FILE *file)
-{
- return
- my_b_copy_to_file(cache, file) ||
- reinit_io_cache(cache, WRITE_CACHE, 0, FALSE, TRUE);
-}
-
#ifdef MYSQL_SERVER
/*****************************************************************************
diff --git a/sql/log_event_old.cc b/sql/log_event_old.cc
index 2c079a34d56..20986050203 100644
--- a/sql/log_event_old.cc
+++ b/sql/log_event_old.cc
@@ -1845,7 +1845,7 @@ void Old_rows_log_event::pack_info(Protocol *protocol)
#ifdef MYSQL_CLIENT
-void Old_rows_log_event::print_helper(FILE *file,
+bool Old_rows_log_event::print_helper(FILE *file,
PRINT_EVENT_INFO *print_event_info,
char const *const name)
{
@@ -1854,18 +1854,23 @@ void Old_rows_log_event::print_helper(FILE *file,
if (!print_event_info->short_form)
{
bool const last_stmt_event= get_flags(STMT_END_F);
- print_header(head, print_event_info, !last_stmt_event);
- my_b_printf(head, "\t%s: table id %lu%s\n",
- name, m_table_id,
- last_stmt_event ? " flags: STMT_END_F" : "");
- print_base64(body, print_event_info, !last_stmt_event);
+ if (print_header(head, print_event_info, !last_stmt_event) ||
+ my_b_printf(head, "\t%s: table id %lu%s\n",
+ name, m_table_id,
+ last_stmt_event ? " flags: STMT_END_F" : "") ||
+ print_base64(body, print_event_info, !last_stmt_event))
+ goto err;
}
if (get_flags(STMT_END_F))
{
- copy_event_cache_to_file_and_reinit(head, file);
- copy_event_cache_to_file_and_reinit(body, file);
+ if (copy_event_cache_to_file_and_reinit(head, file) ||
+ copy_event_cache_to_file_and_reinit(body, file))
+ goto err;
}
+ return 0;
+err:
+ return 1;
}
#endif
@@ -2491,10 +2496,11 @@ Write_rows_log_event_old::do_exec_row(rpl_group_info *rgi)
#ifdef MYSQL_CLIENT
-void Write_rows_log_event_old::print(FILE *file,
+bool Write_rows_log_event_old::print(FILE *file,
PRINT_EVENT_INFO* print_event_info)
{
- Old_rows_log_event::print_helper(file, print_event_info, "Write_rows_old");
+ return Old_rows_log_event::print_helper(file, print_event_info,
+ "Write_rows_old");
}
#endif
@@ -2598,10 +2604,11 @@ int Delete_rows_log_event_old::do_exec_row(rpl_group_info *rgi)
#ifdef MYSQL_CLIENT
-void Delete_rows_log_event_old::print(FILE *file,
+bool Delete_rows_log_event_old::print(FILE *file,
PRINT_EVENT_INFO* print_event_info)
{
- Old_rows_log_event::print_helper(file, print_event_info, "Delete_rows_old");
+ return Old_rows_log_event::print_helper(file, print_event_info,
+ "Delete_rows_old");
}
#endif
@@ -2736,9 +2743,10 @@ Update_rows_log_event_old::do_exec_row(rpl_group_info *rgi)
#ifdef MYSQL_CLIENT
-void Update_rows_log_event_old::print(FILE *file,
+bool Update_rows_log_event_old::print(FILE *file,
PRINT_EVENT_INFO* print_event_info)
{
- Old_rows_log_event::print_helper(file, print_event_info, "Update_rows_old");
+ return Old_rows_log_event::print_helper(file, print_event_info,
+ "Update_rows_old");
}
#endif
diff --git a/sql/log_event_old.h b/sql/log_event_old.h
index 40e01d37318..d18c980bdfe 100644
--- a/sql/log_event_old.h
+++ b/sql/log_event_old.h
@@ -116,7 +116,7 @@ public:
#ifdef MYSQL_CLIENT
/* not for direct call, each derived has its own ::print() */
- virtual void print(FILE *file, PRINT_EVENT_INFO *print_event_info)= 0;
+ virtual bool print(FILE *file, PRINT_EVENT_INFO *print_event_info)= 0;
#endif
#ifndef MYSQL_CLIENT
@@ -166,7 +166,7 @@ protected:
const Format_description_log_event *description_event);
#ifdef MYSQL_CLIENT
- void print_helper(FILE *, PRINT_EVENT_INFO *, char const *const name);
+ bool print_helper(FILE *, PRINT_EVENT_INFO *, char const *const name);
#endif
#ifndef MYSQL_CLIENT
@@ -379,7 +379,7 @@ public:
private:
#ifdef MYSQL_CLIENT
- void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
+ bool print(FILE *file, PRINT_EVENT_INFO *print_event_info);
#endif
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
@@ -455,7 +455,7 @@ public:
protected:
#ifdef MYSQL_CLIENT
- void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
+ bool print(FILE *file, PRINT_EVENT_INFO *print_event_info);
#endif
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
@@ -529,7 +529,7 @@ public:
protected:
#ifdef MYSQL_CLIENT
- void print(FILE *file, PRINT_EVENT_INFO *print_event_info);
+ bool print(FILE *file, PRINT_EVENT_INFO *print_event_info);
#endif
#if !defined(MYSQL_CLIENT) && defined(HAVE_REPLICATION)
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index d0a7bdd83a6..0ec99d6eb96 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -3678,8 +3678,6 @@ void my_message_sql(uint error, const char *str, myf MyFlags)
extern "C" void *my_str_malloc_mysqld(size_t size);
-extern "C" void my_str_free_mysqld(void *ptr);
-extern "C" void *my_str_realloc_mysqld(void *ptr, size_t size);
void *my_str_malloc_mysqld(size_t size)
{
@@ -3687,17 +3685,6 @@ void *my_str_malloc_mysqld(size_t size)
}
-void my_str_free_mysqld(void *ptr)
-{
- my_free(ptr);
-}
-
-void *my_str_realloc_mysqld(void *ptr, size_t size)
-{
- return my_realloc(ptr, size, MYF(MY_FAE));
-}
-
-
#ifdef __WIN__
pthread_handler_t handle_shutdown(void *arg)
@@ -3753,14 +3740,8 @@ check_enough_stack_size(int recurse_level)
}
-/*
- Initialize my_str_malloc() and my_str_free()
-*/
static void init_libstrings()
{
- my_str_malloc= &my_str_malloc_mysqld;
- my_str_free= &my_str_free_mysqld;
- my_str_realloc= &my_str_realloc_mysqld;
#ifndef EMBEDDED_LIBRARY
my_string_stack_guard= check_enough_stack_size;
#endif
@@ -3771,7 +3752,7 @@ ulonglong my_pcre_frame_size;
static void init_pcre()
{
pcre_malloc= pcre_stack_malloc= my_str_malloc_mysqld;
- pcre_free= pcre_stack_free= my_str_free_mysqld;
+ pcre_free= pcre_stack_free= my_free;
pcre_stack_guard= check_enough_stack_size_slow;
/* See http://pcre.org/original/doc/html/pcrestack.html */
my_pcre_frame_size= -pcre_exec(NULL, NULL, NULL, -999, -999, 0, NULL, 0);
@@ -7336,7 +7317,7 @@ struct my_option my_long_options[]=
"The value has to be a multiple of 256.",
&opt_binlog_rows_event_max_size, &opt_binlog_rows_event_max_size,
0, GET_ULONG, REQUIRED_ARG,
- /* def_value */ 8192, /* min_value */ 256, /* max_value */ ULONG_MAX,
+ /* def_value */ 8192, /* min_value */ 256, /* max_value */ UINT_MAX32-1,
/* sub_size */ 0, /* block_size */ 256,
/* app_type */ 0
},
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 3a13a77ade0..24d69701c72 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -1541,7 +1541,7 @@ end:
head->file= org_file;
/* Restore head->read_set (and write_set) to what they had before the call */
- head->column_bitmaps_set(save_read_set, save_write_set);
+ head->column_bitmaps_set(save_read_set, save_write_set, save_vcol_set);
if (reset())
{
@@ -6730,7 +6730,7 @@ static TRP_RANGE *get_key_scans_params(PARAM *param, SEL_TREE *tree,
bool update_tbl_stats,
double read_time)
{
- uint idx, best_idx;
+ uint idx, UNINIT_VAR(best_idx);
SEL_ARG *key_to_read= NULL;
ha_rows UNINIT_VAR(best_records); /* protected by key_to_read */
uint UNINIT_VAR(best_mrr_flags), /* protected by key_to_read */
@@ -11387,7 +11387,10 @@ int QUICK_RANGE_SELECT::reset()
buf_size/= 2;
}
if (!mrr_buf_desc)
- DBUG_RETURN(HA_ERR_OUT_OF_MEM);
+ {
+ error= HA_ERR_OUT_OF_MEM;
+ goto err;
+ }
/* Initialize the handler buffer. */
mrr_buf_desc->buffer= mrange_buff;
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index 0dc9a2638eb..c47c7fc8de9 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -2383,6 +2383,24 @@ end:
DBUG_RETURN(result);
}
+
+bool partition_info::error_if_requires_values() const
+{
+ switch (part_type) {
+ case NOT_A_PARTITION:
+ case HASH_PARTITION:
+ break;
+ case RANGE_PARTITION:
+ my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0), "RANGE", "LESS THAN");
+ return true;
+ case LIST_PARTITION:
+ my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0), "LIST", "IN");
+ return true;
+ }
+ return false;
+}
+
+
/**
Fix partition data from parser.
@@ -2473,6 +2491,8 @@ bool partition_info::fix_parser_data(THD *thd)
part_elem= it++;
List_iterator<part_elem_value> list_val_it(part_elem->list_val_list);
num_elements= part_elem->list_val_list.elements;
+ if (!num_elements && error_if_requires_values())
+ DBUG_RETURN(true);
DBUG_ASSERT(part_type == RANGE_PARTITION ?
num_elements == 1U : TRUE);
diff --git a/sql/partition_info.h b/sql/partition_info.h
index 38a353c8507..fc13d48e5ee 100644
--- a/sql/partition_info.h
+++ b/sql/partition_info.h
@@ -332,6 +332,7 @@ public:
size_t file_name_size, uint32 *part_id);
void report_part_expr_error(bool use_subpart_expr);
bool has_same_partitioning(partition_info *new_part_info);
+ bool error_if_requires_values() const;
private:
static int list_part_cmp(const void* a, const void* b);
bool set_up_default_partitions(THD *thd, handler *file, HA_CREATE_INFO *info,
diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc
index 369b072ab47..6d6211e4741 100644
--- a/sql/rpl_gtid.cc
+++ b/sql/rpl_gtid.cc
@@ -1673,7 +1673,6 @@ rpl_binlog_state::write_to_iocache(IO_CACHE *dest)
mysql_mutex_lock(&LOCK_binlog_state);
for (i= 0; i < hash.records; ++i)
{
- size_t res;
element *e= (element *)my_hash_element(&hash, i);
if (!e->last_gtid)
{
@@ -1693,8 +1692,8 @@ rpl_binlog_state::write_to_iocache(IO_CACHE *dest)
gtid= e->last_gtid;
longlong10_to_str(gtid->seq_no, buf, 10);
- res= my_b_printf(dest, "%u-%u-%s\n", gtid->domain_id, gtid->server_id, buf);
- if (res == (size_t) -1)
+ if (my_b_printf(dest, "%u-%u-%s\n", gtid->domain_id, gtid->server_id,
+ buf))
{
res= 1;
goto end;
diff --git a/sql/share/errmsg-utf8.txt b/sql/share/errmsg-utf8.txt
index 061e313c494..349e8f2c533 100644
--- a/sql/share/errmsg-utf8.txt
+++ b/sql/share/errmsg-utf8.txt
@@ -1804,30 +1804,30 @@ ER_WRONG_AUTO_KEY 42000 S1009
ER_BINLOG_CANT_DELETE_GTID_DOMAIN
eng "Could not delete gtid domain. Reason: %s."
ER_NORMAL_SHUTDOWN
- cze "%s (%s): normální ukonÄení\n"
- dan "%s (%s): Normal nedlukning\n"
- nla "%s (%s): Normaal afgesloten \n"
- eng "%s (%s): Normal shutdown\n"
- est "%s (%s): MariaDB lõpetas\n"
- fre "%s (%s): Arrêt normal du serveur\n"
- ger "%s (%s): Normal heruntergefahren\n"
- greek "%s (%s): Φυσιολογική διαδικασία shutdown\n"
- hindi "%s (%s): सामानà¥à¤¯ शटडाउन\n"
- hun "%s (%s): Normal leallitas\n"
- ita "%s (%s): Shutdown normale\n"
- jpn "%s (%s): 通常シャットダウン\n"
- kor "%s (%s): ì •ìƒì ì¸ shutdown\n"
- nor "%s (%s): Normal avslutning\n"
- norwegian-ny "%s (%s): Normal nedkopling\n"
- pol "%s (%s): Standardowe zakończenie działania\n"
- por "%s (%s): 'Shutdown' normal\n"
- rum "%s (%s): Terminare normala\n"
- rus "%s (%s): ÐšÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ð°Ñ Ð¾Ñтановка\n"
- serbian "%s (%s): Normalno gašenje\n"
- slo "%s (%s): normálne ukonÄenie\n"
- spa "%s (%s): Apagado normal\n"
- swe "%s (%s): Normal avslutning\n"
- ukr "%s (%s): Ðормальне завершеннÑ\n"
+ cze "%s (%s): normální ukonÄení"
+ dan "%s (%s): Normal nedlukning"
+ nla "%s (%s): Normaal afgesloten "
+ eng "%s (%s): Normal shutdown"
+ est "%s (%s): MariaDB lõpetas"
+ fre "%s (%s): Arrêt normal du serveur"
+ ger "%s (%s): Normal heruntergefahren"
+ greek "%s (%s): Φυσιολογική διαδικασία shutdown"
+ hindi "%s (%s): सामानà¥à¤¯ शटडाउन"
+ hun "%s (%s): Normal leallitas"
+ ita "%s (%s): Shutdown normale"
+ jpn "%s (%s): 通常シャットダウン"
+ kor "%s (%s): ì •ìƒì ì¸ shutdown"
+ nor "%s (%s): Normal avslutning"
+ norwegian-ny "%s (%s): Normal nedkopling"
+ pol "%s (%s): Standardowe zakończenie działania"
+ por "%s (%s): 'Shutdown' normal"
+ rum "%s (%s): Terminare normala"
+ rus "%s (%s): ÐšÐ¾Ñ€Ñ€ÐµÐºÑ‚Ð½Ð°Ñ Ð¾Ñтановка"
+ serbian "%s (%s): Normalno gašenje"
+ slo "%s (%s): normálne ukonÄenie"
+ spa "%s (%s): Apagado normal"
+ swe "%s (%s): Normal avslutning"
+ ukr "%s (%s): Ðормальне завершеннÑ"
ER_GOT_SIGNAL
cze "%s: pÅ™ijat signal %d, konÄím\n"
dan "%s: Fangede signal %d. Afslutter!!\n"
diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc
index c99ad088e9f..0452e181e22 100644
--- a/sql/signal_handler.cc
+++ b/sql/signal_handler.cc
@@ -298,7 +298,9 @@ extern "C" sig_handler handle_fatal_signal(int sig)
#ifdef HAVE_WRITE_CORE
if (test_flags & TEST_CORE_ON_SIGNAL)
{
- my_safe_printf_stderr("%s", "Writing a core file\n");
+ char buff[80];
+ my_getwd(buff, sizeof(buff), 0);
+ my_safe_printf_stderr("Writing a core file at %s\n", buff);
fflush(stderr);
my_write_core(sig);
}
diff --git a/sql/slave.h b/sql/slave.h
index 74bb4356dfb..649d55b45b9 100644
--- a/sql/slave.h
+++ b/sql/slave.h
@@ -52,7 +52,7 @@
#define SLAVE_NET_TIMEOUT 60
-#define MAX_SLAVE_ERROR 2000
+#define MAX_SLAVE_ERROR ER_ERROR_LAST+1
#define MAX_REPLICATION_THREAD 64
diff --git a/sql/sp.cc b/sql/sp.cc
index 58dd8cfee3d..843c40cf2b6 100644
--- a/sql/sp.cc
+++ b/sql/sp.cc
@@ -1345,8 +1345,8 @@ log:
{
thd->clear_error();
- String log_query;
- log_query.set_charset(system_charset_info);
+ StringBuffer<128> log_query(thd->variables.character_set_client);
+ DBUG_ASSERT(log_query.charset()->mbminlen == 1);
if (show_create_sp(thd, &log_query,
sp->m_explicit_name ? sp->m_db : null_clex_str,
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 9d3299a63d4..e4b6fe65f06 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -2861,37 +2861,42 @@ static void acl_insert_user(const char *user, const char *host,
}
-static void acl_update_db(const char *user, const char *host, const char *db,
+static bool acl_update_db(const char *user, const char *host, const char *db,
ulong privileges)
{
mysql_mutex_assert_owner(&acl_cache->lock);
+ bool updated= false;
+
for (uint i=0 ; i < acl_dbs.elements ; i++)
{
ACL_DB *acl_db=dynamic_element(&acl_dbs,i,ACL_DB*);
if ((!acl_db->user && !user[0]) ||
- (acl_db->user &&
- !strcmp(user,acl_db->user)))
+ (acl_db->user &&
+ !strcmp(user,acl_db->user)))
{
if ((!acl_db->host.hostname && !host[0]) ||
- (acl_db->host.hostname &&
- !strcmp(host, acl_db->host.hostname)))
+ (acl_db->host.hostname &&
+ !strcmp(host, acl_db->host.hostname)))
{
- if ((!acl_db->db && !db[0]) ||
- (acl_db->db && !strcmp(db,acl_db->db)))
+ if ((!acl_db->db && !db[0]) ||
+ (acl_db->db && !strcmp(db,acl_db->db)))
- {
- if (privileges)
+ {
+ if (privileges)
{
acl_db->access= privileges;
acl_db->initial_access= acl_db->access;
}
- else
- delete_dynamic_element(&acl_dbs,i);
- }
+ else
+ delete_dynamic_element(&acl_dbs,i);
+ updated= true;
+ }
}
}
}
+
+ return updated;
}
@@ -4383,9 +4388,21 @@ static int replace_db_table(TABLE *table, const char *db,
acl_cache->clear(1); // Clear privilege cache
if (old_row_exists)
acl_update_db(combo.user.str,combo.host.str,db,rights);
- else
- if (rights)
- acl_insert_db(combo.user.str,combo.host.str,db,rights);
+ else if (rights)
+ {
+ /*
+ If we did not have an already existing row, for users, we must always
+ insert an ACL_DB entry. For roles however, it is possible that one was
+ already created when DB privileges were propagated from other granted
+ roles onto the current role. For this case, first try to update the
+ existing entry, otherwise insert a new one.
+ */
+ if (!combo.is_role() ||
+ !acl_update_db(combo.user.str, combo.host.str, db, rights))
+ {
+ acl_insert_db(combo.user.str,combo.host.str,db,rights);
+ }
+ }
DBUG_RETURN(0);
/* This could only happen if the grant tables got corrupted */
@@ -6308,9 +6325,12 @@ static int merge_role_privileges(ACL_ROLE *role __attribute__((unused)),
{
PRIVS_TO_MERGE *data= (PRIVS_TO_MERGE *)context;
+ DBUG_ASSERT(grantee->counter > 0);
if (--grantee->counter)
return 1; // don't recurse into grantee just yet
+ grantee->counter= 1; // Mark the grantee as merged.
+
/* if we'll do db/table/routine privileges, create a hash of role names */
role_hash_t role_hash(role_key);
if (data->what != PRIVS_TO_MERGE::GLOBAL)
@@ -7402,11 +7422,10 @@ end_index_init:
DBUG_RETURN(return_val);
}
-
-static my_bool role_propagate_grants_action(void *ptr,
- void *unused __attribute__((unused)))
+static my_bool propagate_role_grants_action(void *role_ptr,
+ void *ptr __attribute__((unused)))
{
- ACL_ROLE *role= (ACL_ROLE *)ptr;
+ ACL_ROLE *role= static_cast<ACL_ROLE *>(role_ptr);
if (role->counter)
return 0;
@@ -7482,7 +7501,7 @@ bool grant_reload(THD *thd)
}
mysql_mutex_lock(&acl_cache->lock);
- my_hash_iterate(&acl_roles, role_propagate_grants_action, NULL);
+ my_hash_iterate(&acl_roles, propagate_role_grants_action, NULL);
mysql_mutex_unlock(&acl_cache->lock);
mysql_rwlock_unlock(&LOCK_grant);
@@ -10224,13 +10243,13 @@ bool mysql_create_user(THD *thd, List <LEX_USER> &list, bool handle_as_role)
}
}
- binlog= true;
if (replace_user_table(thd, tables.user_table(), *user_name, 0, 0, 1, 0))
{
append_user(thd, &wrong_users, user_name);
result= TRUE;
continue;
}
+ binlog= true;
// every created role is automatically granted to its creator-admin
if (handle_as_role)
diff --git a/sql/sql_cache.cc b/sql/sql_cache.cc
index 2dc977c9b5d..766aa8099ba 100644
--- a/sql/sql_cache.cc
+++ b/sql/sql_cache.cc
@@ -1814,7 +1814,7 @@ Query_cache::send_result_to_client(THD *thd, char *org_sql, uint query_length)
sql++;
continue;
}
- /* fall trough */
+ /* fall through */
default:
break;
}
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 40cf0f2557f..9d83e467c82 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -2751,6 +2751,8 @@ void THD::nocheck_register_item_tree_change(Item **place, Item *old_value,
MEM_ROOT *runtime_memroot)
{
Item_change_record *change;
+ DBUG_ENTER("THD::nocheck_register_item_tree_change");
+ DBUG_PRINT("enter", ("Register %p <- %p", old_value, (*place)));
/*
Now we use one node per change, which adds some memory overhead,
but still is rather fast as we use alloc_root for allocations.
@@ -2763,12 +2765,13 @@ void THD::nocheck_register_item_tree_change(Item **place, Item *old_value,
OOM, thd->fatal_error() is called by the error handler of the
memroot. Just return.
*/
- return;
+ DBUG_VOID_RETURN;
}
change= new (change_mem) Item_change_record;
change->place= place;
change->old_value= old_value;
change_list.append(change);
+ DBUG_VOID_RETURN;
}
/**
@@ -2809,7 +2812,11 @@ void THD::rollback_item_tree_changes()
DBUG_ENTER("rollback_item_tree_changes");
while ((change= it++))
+ {
+ DBUG_PRINT("info", ("revert %p -> %p",
+ change->old_value, (*change->place)));
*change->place= change->old_value;
+ }
/* We can forget about changes memory: it's allocated in runtime memroot */
change_list.empty();
DBUG_VOID_RETURN;
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index e428d969db0..1e3994dea66 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -316,13 +316,9 @@ extern "C" void free_user(struct user_conn *uc)
void init_max_user_conn(void)
{
#ifndef NO_EMBEDDED_ACCESS_CHECKS
- if (my_hash_init(&hash_user_connections,system_charset_info,max_connections,
- 0,0, (my_hash_get_key) get_key_conn,
- (my_hash_free_key) free_user, 0))
- {
- sql_print_error("Initializing hash_user_connections failed.");
- exit(1);
- }
+ my_hash_init(&hash_user_connections, system_charset_info, max_connections,
+ 0, 0, (my_hash_get_key) get_key_conn,
+ (my_hash_free_key) free_user, 0);
#endif
}
@@ -481,24 +477,16 @@ void init_user_stats(USER_STATS *user_stats,
void init_global_user_stats(void)
{
- if (my_hash_init(&global_user_stats, system_charset_info, max_connections,
- 0, 0, (my_hash_get_key) get_key_user_stats,
- (my_hash_free_key)free_user_stats, 0))
- {
- sql_print_error("Initializing global_user_stats failed.");
- exit(1);
- }
+ my_hash_init(&global_user_stats, system_charset_info, max_connections,
+ 0, 0, (my_hash_get_key) get_key_user_stats,
+ (my_hash_free_key) free_user_stats, 0);
}
void init_global_client_stats(void)
{
- if (my_hash_init(&global_client_stats, system_charset_info, max_connections,
- 0, 0, (my_hash_get_key) get_key_user_stats,
- (my_hash_free_key)free_user_stats, 0))
- {
- sql_print_error("Initializing global_client_stats failed.");
- exit(1);
- }
+ my_hash_init(&global_client_stats, system_charset_info, max_connections,
+ 0, 0, (my_hash_get_key) get_key_user_stats,
+ (my_hash_free_key) free_user_stats, 0);
}
extern "C" uchar *get_key_table_stats(TABLE_STATS *table_stats, size_t *length,
@@ -515,12 +503,9 @@ extern "C" void free_table_stats(TABLE_STATS* table_stats)
void init_global_table_stats(void)
{
- if (my_hash_init(&global_table_stats, system_charset_info, max_connections,
- 0, 0, (my_hash_get_key) get_key_table_stats,
- (my_hash_free_key)free_table_stats, 0)) {
- sql_print_error("Initializing global_table_stats failed.");
- exit(1);
- }
+ my_hash_init(&global_table_stats, system_charset_info, max_connections,
+ 0, 0, (my_hash_get_key) get_key_table_stats,
+ (my_hash_free_key) free_table_stats, 0);
}
extern "C" uchar *get_key_index_stats(INDEX_STATS *index_stats, size_t *length,
@@ -537,13 +522,9 @@ extern "C" void free_index_stats(INDEX_STATS* index_stats)
void init_global_index_stats(void)
{
- if (my_hash_init(&global_index_stats, system_charset_info, max_connections,
- 0, 0, (my_hash_get_key) get_key_index_stats,
- (my_hash_free_key)free_index_stats, 0))
- {
- sql_print_error("Initializing global_index_stats failed.");
- exit(1);
- }
+ my_hash_init(&global_index_stats, system_charset_info, max_connections,
+ 0, 0, (my_hash_get_key) get_key_index_stats,
+ (my_hash_free_key) free_index_stats, 0);
}
diff --git a/sql/sql_cte.cc b/sql/sql_cte.cc
index ff80e198023..9608436226c 100644
--- a/sql/sql_cte.cc
+++ b/sql/sql_cte.cc
@@ -681,7 +681,7 @@ void With_element::move_anchors_ahead()
{
st_select_lex *next_sl;
st_select_lex *new_pos= spec->first_select();
- st_select_lex *last_sl;
+ st_select_lex *UNINIT_VAR(last_sl);
new_pos->linkage= UNION_TYPE;
for (st_select_lex *sl= new_pos; sl; sl= next_sl)
{
diff --git a/sql/sql_derived.cc b/sql/sql_derived.cc
index 0d237b94af2..f9801d2bf36 100644
--- a/sql/sql_derived.cc
+++ b/sql/sql_derived.cc
@@ -364,6 +364,9 @@ bool mysql_derived_merge(THD *thd, LEX *lex, TABLE_LIST *derived)
SELECT_LEX *parent_lex= derived->select_lex;
Query_arena *arena, backup;
DBUG_ENTER("mysql_derived_merge");
+ DBUG_PRINT("enter", ("Alias: '%s' Unit: %p",
+ (derived->alias ? derived->alias : "<NULL>"),
+ derived->get_unit()));
if (derived->merged)
DBUG_RETURN(FALSE);
@@ -510,7 +513,9 @@ unconditional_materialization:
bool mysql_derived_merge_for_insert(THD *thd, LEX *lex, TABLE_LIST *derived)
{
DBUG_ENTER("mysql_derived_merge_for_insert");
- DBUG_PRINT("enter", ("derived: %p", derived));
+ DBUG_PRINT("enter", ("Alias: '%s' Unit: %p",
+ (derived->alias ? derived->alias : "<NULL>"),
+ derived->get_unit()));
DBUG_PRINT("info", ("merged_for_insert: %d is_materialized_derived: %d "
"is_multitable: %d single_table_updatable: %d "
"merge_underlying_list: %d",
@@ -566,7 +571,9 @@ bool mysql_derived_init(THD *thd, LEX *lex, TABLE_LIST *derived)
{
SELECT_LEX_UNIT *unit= derived->get_unit();
DBUG_ENTER("mysql_derived_init");
- DBUG_PRINT("enter", ("derived: %p", derived));
+ DBUG_PRINT("enter", ("Alias: '%s' Unit: %p",
+ (derived->alias ? derived->alias : "<NULL>"),
+ derived->get_unit()));
// Skip already prepared views/DT
if (!unit || unit->prepared)
@@ -642,8 +649,9 @@ bool mysql_derived_prepare(THD *thd, LEX *lex, TABLE_LIST *derived)
SELECT_LEX_UNIT *unit= derived->get_unit();
DBUG_ENTER("mysql_derived_prepare");
bool res= FALSE;
- DBUG_PRINT("enter", ("unit: %p table_list: %p Alias '%s'",
- unit, derived, derived->alias));
+ DBUG_PRINT("enter", ("Alias: '%s' Unit: %p",
+ (derived->alias ? derived->alias : "<NULL>"),
+ unit));
if (!unit)
DBUG_RETURN(FALSE);
@@ -876,6 +884,9 @@ bool mysql_derived_optimize(THD *thd, LEX *lex, TABLE_LIST *derived)
bool res= FALSE;
DBUG_ENTER("mysql_derived_optimize");
+ DBUG_PRINT("enter", ("Alias: '%s' Unit: %p",
+ (derived->alias ? derived->alias : "<NULL>"),
+ derived->get_unit()));
lex->current_select= first_select;
@@ -954,6 +965,9 @@ err:
bool mysql_derived_create(THD *thd, LEX *lex, TABLE_LIST *derived)
{
DBUG_ENTER("mysql_derived_create");
+ DBUG_PRINT("enter", ("Alias: '%s' Unit: %p",
+ (derived->alias ? derived->alias : "<NULL>"),
+ derived->get_unit()));
TABLE *table= derived->table;
SELECT_LEX_UNIT *unit= derived->get_unit();
@@ -1047,10 +1061,14 @@ bool TABLE_LIST::fill_recursive(THD *thd)
bool mysql_derived_fill(THD *thd, LEX *lex, TABLE_LIST *derived)
{
- DBUG_ENTER("mysql_derived_fill");
+ Field_iterator_table field_iterator;
SELECT_LEX_UNIT *unit= derived->get_unit();
bool derived_is_recursive= derived->is_recursive_with_table();
bool res= FALSE;
+ DBUG_ENTER("mysql_derived_fill");
+ DBUG_PRINT("enter", ("Alias: '%s' Unit: %p",
+ (derived->alias ? derived->alias : "<NULL>"),
+ derived->get_unit()));
if (unit->executed && !unit->uncacheable && !unit->describe &&
!derived_is_recursive)
@@ -1121,9 +1139,28 @@ bool mysql_derived_fill(THD *thd, LEX *lex, TABLE_LIST *derived)
if (derived_result->flush())
res= TRUE;
unit->executed= TRUE;
+
+ if (derived->field_translation)
+ {
+ /* reset translation table to materialized table */
+ field_iterator.set_table(derived->table);
+ for (uint i= 0;
+ !field_iterator.end_of_fields();
+ field_iterator.next(), i= i + 1)
+ {
+ Item *item;
+
+ if (!(item= field_iterator.create_item(thd)))
+ {
+ res= TRUE;
+ break;
+ }
+ thd->change_item_tree(&derived->field_translation[i].item, item);
+ }
+ }
}
err:
- if (res || (!lex->describe && !derived_is_recursive && !unit->uncacheable))
+ if (res || (!lex->describe && !derived_is_recursive && !unit->uncacheable))
unit->cleanup();
lex->current_select= save_current_select;
@@ -1151,6 +1188,9 @@ err:
bool mysql_derived_reinit(THD *thd, LEX *lex, TABLE_LIST *derived)
{
DBUG_ENTER("mysql_derived_reinit");
+ DBUG_PRINT("enter", ("Alias: '%s' Unit: %p",
+ (derived->alias ? derived->alias : "<NULL>"),
+ derived->get_unit()));
st_select_lex_unit *unit= derived->get_unit();
derived->merged_for_insert= FALSE;
diff --git a/sql/sql_explain.cc b/sql/sql_explain.cc
index fed38a5f4f4..ad80303e1b3 100644
--- a/sql/sql_explain.cc
+++ b/sql/sql_explain.cc
@@ -974,6 +974,7 @@ Explain_aggr_filesort::Explain_aggr_filesort(MEM_ROOT *mem_root,
for (ORDER *ord= filesort->order; ord; ord= ord->next)
{
sort_items.push_back(ord->item[0], mem_root);
+ sort_directions.push_back(&ord->direction, mem_root);
}
filesort->tracker= &tracker;
}
@@ -987,10 +988,13 @@ void Explain_aggr_filesort::print_json_members(Json_writer *writer,
str.length(0);
List_iterator_fast<Item> it(sort_items);
- Item *item;
+ List_iterator_fast<ORDER::enum_order> it_dir(sort_directions);
+ Item* item;
+ ORDER::enum_order *direction;
bool first= true;
while ((item= it++))
{
+ direction= it_dir++;
if (first)
first= false;
else
@@ -998,6 +1002,8 @@ void Explain_aggr_filesort::print_json_members(Json_writer *writer,
str.append(", ");
}
append_item_to_str(&str, item);
+ if (*direction == ORDER::ORDER_DESC)
+ str.append(" desc");
}
writer->add_member("sort_key").add_str(str.c_ptr_safe());
diff --git a/sql/sql_explain.h b/sql/sql_explain.h
index 895c059f1b0..7fb50a6cb04 100644
--- a/sql/sql_explain.h
+++ b/sql/sql_explain.h
@@ -286,6 +286,7 @@ public:
class Explain_aggr_filesort : public Explain_aggr_node
{
List<Item> sort_items;
+ List<ORDER::enum_order> sort_directions;
public:
enum_explain_aggr_node_type get_type() { return AGGR_OP_FILESORT; }
Filesort_tracker tracker;
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index b40a44b7541..c86bdb94bd9 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -2428,10 +2428,8 @@ void st_select_lex_node::move_as_slave(st_select_lex_node *new_master)
prev= &curr->next;
}
else
- {
prev= &new_master->slave;
- new_master->slave= this;
- }
+ *prev= this;
next= 0;
master= new_master;
}
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc
index e47a0e925a6..1080f9d9de2 100644
--- a/sql/sql_partition.cc
+++ b/sql/sql_partition.cc
@@ -4602,16 +4602,11 @@ uint prep_alter_part_table(THD *thd, TABLE *table, Alter_info *alter_info,
my_error(ER_PARTITION_WRONG_VALUES_ERROR, MYF(0),
"LIST", "IN");
}
- else if (tab_part_info->part_type == RANGE_PARTITION)
- {
- my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0),
- "RANGE", "LESS THAN");
- }
else
{
- DBUG_ASSERT(tab_part_info->part_type == LIST_PARTITION);
- my_error(ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0),
- "LIST", "IN");
+ DBUG_ASSERT(tab_part_info->part_type == RANGE_PARTITION ||
+ tab_part_info->part_type == LIST_PARTITION);
+ (void) tab_part_info->error_if_requires_values();
}
goto err;
}
@@ -8076,8 +8071,11 @@ int create_partition_name(char *out, size_t outlen, const char *in1,
end= strxnmov(out, outlen-1, in1, "#P#", transl_part, NullS);
else if (name_variant == TEMP_PART_NAME)
end= strxnmov(out, outlen-1, in1, "#P#", transl_part, "#TMP#", NullS);
- else if (name_variant == RENAMED_PART_NAME)
+ else
+ {
+ DBUG_ASSERT(name_variant == RENAMED_PART_NAME);
end= strxnmov(out, outlen-1, in1, "#P#", transl_part, "#REN#", NullS);
+ }
if (end - out == static_cast<ptrdiff_t>(outlen-1))
{
my_error(ER_PATH_LENGTH, MYF(0), longest_str(in1, transl_part));
@@ -8117,9 +8115,12 @@ int create_subpartition_name(char *out, size_t outlen,
else if (name_variant == TEMP_PART_NAME)
end= strxnmov(out, outlen-1, in1, "#P#", transl_part_name,
"#SP#", transl_subpart_name, "#TMP#", NullS);
- else if (name_variant == RENAMED_PART_NAME)
+ else
+ {
+ DBUG_ASSERT(name_variant == RENAMED_PART_NAME);
end= strxnmov(out, outlen-1, in1, "#P#", transl_part_name,
"#SP#", transl_subpart_name, "#REN#", NullS);
+ }
if (end - out == static_cast<ptrdiff_t>(outlen-1))
{
my_error(ER_PATH_LENGTH, MYF(0),
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 243d9d524c2..bea6dc06134 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -4732,7 +4732,19 @@ bool Prepared_statement::execute(String *expanded_query, bool open_cursor)
if (error == 0 && this->lex->sql_command == SQLCOM_CALL)
{
if (is_sql_prepare())
+ {
+ /*
+ Here we have the diagnostics area status already set to DA_OK.
+ sent_out_parameters() can raise errors when assigning OUT parameters:
+ DECLARE a DATETIME;
+ EXECUTE IMMEDIATE 'CALL p1(?)' USING a;
+ when the procedure p1 assigns a DATETIME-incompatible value (e.g. 10)
+ to the out parameter. Allow to overwrite status (to DA_ERROR).
+ */
+ thd->get_stmt_da()->set_overwrite_status(true);
thd->protocol_text.send_out_parameters(&this->lex->param_list);
+ thd->get_stmt_da()->set_overwrite_status(false);
+ }
else
thd->protocol->send_out_parameters(&this->lex->param_list);
}
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 82539865d41..8aed093af7f 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -861,6 +861,22 @@ JOIN::prepare(TABLE_LIST *tables_init,
}
}
+ /*
+ After setting up window functions, we may have discovered additional
+ used tables from the PARTITION BY and ORDER BY list. Update all items
+ that contain window functions.
+ */
+ if (select_lex->have_window_funcs())
+ {
+ List_iterator_fast<Item> it(select_lex->item_list);
+ Item *item;
+ while ((item= it++))
+ {
+ if (item->with_window_func)
+ item->update_used_tables();
+ }
+ }
+
With_clause *with_clause=select_lex->get_with_clause();
if (with_clause && with_clause->prepare_unreferenced_elements(thd))
DBUG_RETURN(1);
diff --git a/sql/sql_string.cc b/sql/sql_string.cc
index 70ddf7b1241..d0d0e35000d 100644
--- a/sql/sql_string.cc
+++ b/sql/sql_string.cc
@@ -606,7 +606,7 @@ bool String::append(IO_CACHE* file, uint32 arg_length)
return TRUE;
if (my_b_read(file, (uchar*) Ptr + str_length, arg_length))
{
- shrink(str_length);
+ shrink(str_length ? str_length : 1);
return TRUE;
}
str_length+=arg_length;
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 3f49d094cf0..6f5d918e0f9 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -5115,7 +5115,7 @@ err:
/* Write log if no error or if we already deleted a table */
if (!result || thd->log_current_statement)
{
- if (result && create_info->table_was_deleted)
+ if (result && create_info->table_was_deleted && pos_in_locked_tables)
{
/*
Possible locked table was dropped. We should remove meta data locks
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index d6c722246e7..be85fb892b0 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -1601,7 +1601,7 @@ err_with_lex_cleanup:
thd->spcont= save_spcont;
thd->variables.sql_mode= save_sql_mode;
thd->reset_db(save_db.str, save_db.length);
- /* Fall trough to error */
+ /* Fall through to error */
}
}
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index e1225878905..b2be437965e 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -643,7 +643,8 @@ bool mysql_create_view(THD *thd, TABLE_LIST *views,
if (!res && mysql_bin_log.is_open())
{
- String buff;
+ StringBuffer<128> buff(thd->variables.character_set_client);
+ DBUG_ASSERT(buff.charset()->mbminlen == 1);
const LEX_STRING command[3]=
{{ C_STRING_WITH_LEN("CREATE ") },
{ C_STRING_WITH_LEN("ALTER ") },
diff --git a/sql/sql_window.cc b/sql/sql_window.cc
index bf393ab1c4d..db34b77ddcb 100644
--- a/sql/sql_window.cc
+++ b/sql/sql_window.cc
@@ -315,14 +315,7 @@ setup_windows(THD *thd, Ref_ptr_array ref_pointer_array, TABLE_LIST *tables,
}
List_iterator_fast<Item_window_func> li(win_funcs);
- Item_window_func *win_func_item;
- while ((win_func_item= li++))
- {
- win_func_item->update_used_tables();
- }
-
- li.rewind();
- while ((win_func_item= li++))
+ while (Item_window_func * win_func_item= li++)
{
if (win_func_item->check_result_type_of_order_item())
DBUG_RETURN(1);
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 158c09dded1..63194e9d097 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -5381,12 +5381,8 @@ opt_part_values:
partition_info *part_info= lex->part_info;
if (! lex->is_partition_management())
{
- if (part_info->part_type == RANGE_PARTITION)
- my_yyabort_error((ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0),
- "RANGE", "LESS THAN"));
- if (part_info->part_type == LIST_PARTITION)
- my_yyabort_error((ER_PARTITION_REQUIRES_VALUES_ERROR, MYF(0),
- "LIST", "IN"));
+ if (part_info->error_if_requires_values())
+ MYSQL_YYABORT;
}
else
part_info->part_type= HASH_PARTITION;
diff --git a/sql/table.cc b/sql/table.cc
index 112b1c5ab5c..e6878c42ea2 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -989,7 +989,7 @@ bool parse_vcol_defs(THD *thd, MEM_ROOT *mem_root, TABLE *table,
Virtual_column_info **check_constraint_ptr= table->check_constraints;
sql_mode_t saved_mode= thd->variables.sql_mode;
Query_arena backup_arena;
- Virtual_column_info *vcol;
+ Virtual_column_info *vcol= 0;
StringBuffer<MAX_FIELD_WIDTH> expr_str;
bool res= 1;
DBUG_ENTER("parse_vcol_defs");
@@ -1160,7 +1160,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
uint new_frm_ver, field_pack_length, new_field_pack_flag;
uint interval_count, interval_parts, read_length, int_length;
uint db_create_options, keys, key_parts, n_length;
- uint com_length, null_bit_pos, mysql57_vcol_null_bit_pos, bitmap_count;
+ uint com_length, null_bit_pos, UNINIT_VAR(mysql57_vcol_null_bit_pos), bitmap_count;
uint i;
uint field_additional_property_length= 0;
bool use_hash, mysql57_null_bits= 0;
@@ -2127,6 +2127,7 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
}
}
+ key_first_info= keyinfo;
for (uint key=0 ; key < keys ; key++,keyinfo++)
{
uint usable_parts= 0;
@@ -2144,9 +2145,6 @@ int TABLE_SHARE::init_from_binary_frm_image(THD *thd, bool write,
keyinfo->name.length+1);
}
- if (!key)
- key_first_info= keyinfo;
-
if (ext_key_parts > share->key_parts && key)
{
KEY_PART_INFO *new_key_part= (keyinfo-1)->key_part +
@@ -4631,6 +4629,9 @@ bool TABLE_LIST::create_field_translation(THD *thd)
Query_arena *arena, backup;
bool res= FALSE;
DBUG_ENTER("TABLE_LIST::create_field_translation");
+ DBUG_PRINT("enter", ("Alias: '%s' Unit: %p",
+ (alias ? alias : "<NULL>"),
+ get_unit()));
if (thd->stmt_arena->is_conventional() ||
thd->stmt_arena->is_stmt_prepare_or_first_sp_execute())
@@ -6843,6 +6844,14 @@ void TABLE::create_key_part_by_field(KEY_PART_INFO *key_part_info,
might be reused.
*/
key_part_info->store_length= key_part_info->length;
+ /*
+ For BIT fields null_bit is not set to 0 even if the field is defined
+ as NOT NULL, look at Field_bit::Field_bit
+ */
+ if (!field->real_maybe_null())
+ {
+ key_part_info->null_bit= 0;
+ }
/*
The total store length of the key part is the raw length of the field +
@@ -7482,7 +7491,6 @@ int TABLE::update_virtual_fields(handler *h, enum_vcol_update_mode update_mode)
swap_values= 1;
break;
case VCOL_UPDATE_FOR_DELETE:
- /* Fall trough */
case VCOL_UPDATE_FOR_WRITE:
update= bitmap_is_set(vcol_set, vf->field_index);
break;
diff --git a/sql/table.h b/sql/table.h
index 017db4883f3..8e39964eea9 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -2346,6 +2346,9 @@ struct TABLE_LIST
inline void set_merged_derived()
{
DBUG_ENTER("set_merged_derived");
+ DBUG_PRINT("enter", ("Alias: '%s' Unit: %p",
+ (alias ? alias : "<NULL>"),
+ get_unit()));
derived_type= ((derived_type & DTYPE_MASK) |
DTYPE_TABLE | DTYPE_MERGE);
set_check_merged();
@@ -2358,6 +2361,9 @@ struct TABLE_LIST
void set_materialized_derived()
{
DBUG_ENTER("set_materialized_derived");
+ DBUG_PRINT("enter", ("Alias: '%s' Unit: %p",
+ (alias ? alias : "<NULL>"),
+ get_unit()));
derived_type= ((derived_type & (derived ? DTYPE_MASK : DTYPE_VIEW)) |
DTYPE_TABLE | DTYPE_MATERIALIZE);
set_check_materialized();
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index da92aa9bedb..54313281625 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -1264,6 +1264,16 @@ int wsrep_to_buf_helper(
if (!ret && writer.write(&gtid_ev)) ret= 1;
}
#endif /* GTID_SUPPORT */
+ if (wsrep_gtid_mode && thd->variables.gtid_seq_no)
+ {
+ Gtid_log_event gtid_event(thd, thd->variables.gtid_seq_no,
+ thd->variables.gtid_domain_id,
+ true, LOG_EVENT_SUPPRESS_USE_F,
+ true, 0);
+ gtid_event.server_id= thd->variables.server_id;
+ if (!gtid_event.is_valid()) ret= 0;
+ ret= writer.write(&gtid_event);
+ }
/* if there is prepare query, add event for it */
if (!ret && thd->wsrep_TOI_pre_query)
diff --git a/storage/innobase/include/trx0rec.h b/storage/innobase/include/trx0rec.h
index 1f89846d516..955a726eb50 100644
--- a/storage/innobase/include/trx0rec.h
+++ b/storage/innobase/include/trx0rec.h
@@ -155,6 +155,7 @@ trx_undo_rec_get_partial_row(
used, as we do NOT copy the data in the
record! */
dict_index_t* index, /*!< in: clustered index */
+ const upd_t* update, /*!< in: updated columns */
dtuple_t** row, /*!< out, own: partial row */
ibool ignore_prefix, /*!< in: flag to indicate if we
expect blob prefixes in undo. Used
@@ -195,8 +196,8 @@ trx_undo_report_row_operation(
marking, the record in the clustered
index; NULL if insert */
const ulint* offsets, /*!< in: rec_get_offsets(rec) */
- roll_ptr_t* roll_ptr) /*!< out: rollback pointer to the
- inserted undo log record */
+ roll_ptr_t* roll_ptr) /*!< out: DB_ROLL_PTR to the
+ undo log record */
MY_ATTRIBUTE((nonnull(1,2,8), warn_unused_result));
/** status bit used for trx_undo_prev_version_build() */
diff --git a/storage/innobase/include/trx0sys.ic b/storage/innobase/include/trx0sys.ic
index 5271601b4ea..020a46fb028 100644
--- a/storage/innobase/include/trx0sys.ic
+++ b/storage/innobase/include/trx0sys.ic
@@ -376,10 +376,8 @@ trx_id_t
trx_sys_get_new_trx_id()
/*====================*/
{
-#ifndef WITH_WSREP
/* wsrep_fake_trx_id violates this assert */
ut_ad(trx_sys_mutex_own());
-#endif /* WITH_WSREP */
/* VERY important: after the database is started, max_trx_id value is
divisible by TRX_SYS_TRX_ID_WRITE_MARGIN, and the following if
diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc
index cb902776e26..9b5c9873604 100644
--- a/storage/innobase/row/row0log.cc
+++ b/storage/innobase/row/row0log.cc
@@ -1695,13 +1695,10 @@ row_log_table_apply_insert_low(
return(error);
}
- do {
- n_index++;
-
- if (!(index = dict_table_get_next_index(index))) {
- break;
- }
+ ut_ad(dict_index_is_clust(index));
+ for (n_index += index->type != DICT_CLUSTERED;
+ (index = dict_table_get_next_index(index)); n_index++) {
if (index->type & DICT_FTS) {
continue;
}
@@ -1712,12 +1709,13 @@ row_log_table_apply_insert_low(
index, offsets_heap, heap, entry,
thr_get_trx(thr)->id, thr, false);
- /* Report correct index name for duplicate key error. */
- if (error == DB_DUPLICATE_KEY) {
- thr_get_trx(thr)->error_key_num = n_index;
+ if (error != DB_SUCCESS) {
+ if (error == DB_DUPLICATE_KEY) {
+ thr_get_trx(thr)->error_key_num = n_index;
+ }
+ break;
}
-
- } while (error == DB_SUCCESS);
+ }
return(error);
}
@@ -2297,17 +2295,16 @@ func_exit_committed:
dtuple_big_rec_free(big_rec);
}
- while ((index = dict_table_get_next_index(index)) != NULL) {
- if (error != DB_SUCCESS) {
- break;
- }
-
- n_index++;
-
+ for (n_index += index->type != DICT_CLUSTERED;
+ (index = dict_table_get_next_index(index)); n_index++) {
if (index->type & DICT_FTS) {
continue;
}
+ if (error != DB_SUCCESS) {
+ break;
+ }
+
if (!row_upd_changes_ord_field_binary(
index, update, thr, old_row, NULL)) {
continue;
diff --git a/storage/innobase/row/row0purge.cc b/storage/innobase/row/row0purge.cc
index 62085e4d2af..f2a5d8c0c57 100644
--- a/storage/innobase/row/row0purge.cc
+++ b/storage/innobase/row/row0purge.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 1997, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, MariaDB Corporation.
+Copyright (c) 2017, 2018, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -1004,7 +1004,7 @@ err_exit:
if (!(node->cmpl_info & UPD_NODE_NO_ORD_CHANGE)) {
ptr = trx_undo_rec_get_partial_row(
- ptr, clust_index, &node->row,
+ ptr, clust_index, node->update, &node->row,
type == TRX_UNDO_UPD_DEL_REC,
node->heap);
}
diff --git a/storage/innobase/row/row0row.cc b/storage/innobase/row/row0row.cc
index 93b84bdb209..3611b8c3fc7 100644
--- a/storage/innobase/row/row0row.cc
+++ b/storage/innobase/row/row0row.cc
@@ -195,13 +195,13 @@ row_build_index_entry_low(
dfield2);
break;
+ case SPATIAL_UNKNOWN:
+ ut_ad(0);
+ /* fall through */
case SPATIAL_NONE:
/* Undo record is logged before
spatial index is created.*/
return(NULL);
-
- case SPATIAL_UNKNOWN:
- ut_ad(0);
}
memcpy(mbr, ptr, DATA_MBR_LEN);
diff --git a/storage/innobase/trx/trx0rec.cc b/storage/innobase/trx/trx0rec.cc
index 86fe7758626..ce291b7add9 100644
--- a/storage/innobase/trx/trx0rec.cc
+++ b/storage/innobase/trx/trx0rec.cc
@@ -1191,14 +1191,43 @@ trx_undo_page_report_modify(
const dict_col_t* col
= dict_table_get_nth_col(table, col_no);
- const char* col_name = dict_table_get_col_name(table,
- col_no);
if (!col->ord_part) {
continue;
}
- if (update) {
+ const ulint pos = dict_index_get_nth_col_pos(
+ index, col_no, NULL);
+ /* All non-virtual columns must be present in
+ the clustered index. */
+ ut_ad(pos != ULINT_UNDEFINED);
+
+ const bool is_ext = rec_offs_nth_extern(offsets, pos);
+ const spatial_status_t spatial_status = is_ext
+ ? dict_col_get_spatial_status(col)
+ : SPATIAL_NONE;
+
+ switch (spatial_status) {
+ case SPATIAL_UNKNOWN:
+ ut_ad(0);
+ /* fall through */
+ case SPATIAL_MIXED:
+ case SPATIAL_ONLY:
+ /* Externally stored spatially indexed
+ columns will be (redundantly) logged
+ again, because we did not write the
+ MBR yet, that is, the previous call to
+ trx_undo_page_report_modify_ext()
+ was with SPATIAL_UNKNOWN. */
+ break;
+ case SPATIAL_NONE:
+ if (!update) {
+ /* This is a DELETE operation. */
+ break;
+ }
+ /* Avoid redundantly logging indexed
+ columns that were updated. */
+
for (i = 0; i < update->n_fields; i++) {
const ulint field_no
= upd_get_nth_field(update, i)
@@ -1213,37 +1242,19 @@ trx_undo_page_report_modify(
}
if (true) {
- ulint pos;
- spatial_status_t spatial_status;
-
- spatial_status = SPATIAL_NONE;
-
/* Write field number to undo log */
if (trx_undo_left(undo_page, ptr) < 5 + 15) {
return(0);
}
- pos = dict_index_get_nth_col_pos(index,
- col_no,
- NULL);
- if (pos == ULINT_UNDEFINED) {
- ib::error() << "Column " << col_no
- << " name " << col_name
- << " not found from index " << index->name
- << " table. " << table->name.m_name
- << " Table has " << dict_table_get_n_cols(table)
- << " and index has " << dict_index_get_n_fields(index)
- << " fields.";
- }
-
ptr += mach_write_compressed(ptr, pos);
/* Save the old value of field */
field = rec_get_nth_cfield(
rec, index, offsets, pos, &flen);
- if (rec_offs_nth_extern(offsets, pos)) {
+ if (is_ext) {
const dict_col_t* col =
dict_index_get_nth_col(
index, pos);
@@ -1253,10 +1264,6 @@ trx_undo_page_report_modify(
ut_a(prefix_len < sizeof ext_buf);
- spatial_status =
- dict_col_get_spatial_status(
- col);
-
/* If there is a spatial index on it,
log its MBR */
if (spatial_status != SPATIAL_NONE) {
@@ -1655,6 +1662,7 @@ trx_undo_rec_get_partial_row(
used, as we do NOT copy the data in the
record! */
dict_index_t* index, /*!< in: clustered index */
+ const upd_t* update, /*!< in: updated columns */
dtuple_t** row, /*!< out, own: partial row */
ibool ignore_prefix, /*!< in: flag to indicate if we
expect blob prefixes in undo. Used
@@ -1685,6 +1693,16 @@ trx_undo_rec_get_partial_row(
dtuple_init_v_fld(*row);
+ for (const upd_field_t* uf = update->fields, * const ue
+ = update->fields + update->n_fields;
+ uf != ue; uf++) {
+ if (uf->old_v_val) {
+ continue;
+ }
+ ulint c = dict_index_get_nth_col(index, uf->field_no)->ind;
+ *dtuple_get_nth_field(*row, c) = uf->new_val;
+ }
+
end_ptr = ptr + mach_read_from_2(ptr);
ptr += 2;
@@ -1730,6 +1748,13 @@ trx_undo_rec_get_partial_row(
col = dict_index_get_nth_col(index, field_no);
col_no = dict_col_get_no(col);
dfield = dtuple_get_nth_field(*row, col_no);
+ ut_ad(dfield->type.mtype == DATA_MISSING
+ || dict_col_type_assert_equal(col,
+ &dfield->type));
+ ut_ad(dfield->type.mtype == DATA_MISSING
+ || dfield->len == len
+ || (len != UNIV_SQL_NULL
+ && len >= UNIV_EXTERN_STORAGE_FIELD));
dict_col_copy_type(
dict_table_get_nth_col(index->table, col_no),
dfield_get_type(dfield));
@@ -1829,8 +1854,9 @@ ulint
trx_undo_page_report_rename(trx_t* trx, const dict_table_t* table,
buf_block_t* block, mtr_t* mtr)
{
- ulint first_free = mach_read_from_2(block->frame + TRX_UNDO_PAGE_HDR
- + TRX_UNDO_PAGE_FREE);
+ byte* ptr_first_free = TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_FREE
+ + block->frame;
+ ulint first_free = mach_read_from_2(ptr_first_free);
ut_ad(first_free >= TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_HDR_SIZE);
ut_ad(first_free <= UNIV_PAGE_SIZE);
byte* start = block->frame + first_free;
@@ -1858,11 +1884,10 @@ trx_undo_page_report_rename(trx_t* trx, const dict_table_t* table,
ptr += 2;
ulint offset = page_offset(ptr);
mach_write_to_2(start, offset);
- mach_write_to_2(block->frame + TRX_UNDO_PAGE_HDR
- + TRX_UNDO_PAGE_FREE, offset);
+ mach_write_to_2(ptr_first_free, offset);
trx_undof_page_add_undo_rec_log(block->frame, first_free, offset, mtr);
- return offset;
+ return first_free;
}
/** Report a RENAME TABLE operation.
@@ -1956,8 +1981,8 @@ trx_undo_report_row_operation(
marking, the record in the clustered
index; NULL if insert */
const ulint* offsets, /*!< in: rec_get_offsets(rec) */
- roll_ptr_t* roll_ptr) /*!< out: rollback pointer to the
- inserted undo log record */
+ roll_ptr_t* roll_ptr) /*!< out: DB_ROLL_PTR to the
+ undo log record */
{
trx_t* trx;
ulint page_no;
diff --git a/storage/innobase/trx/trx0sys.cc b/storage/innobase/trx/trx0sys.cc
index a332f6047d1..c2e15fea953 100644
--- a/storage/innobase/trx/trx0sys.cc
+++ b/storage/innobase/trx/trx0sys.cc
@@ -98,12 +98,10 @@ trx_sys_flush_max_trx_id(void)
mtr_t mtr;
trx_sysf_t* sys_header;
-#ifndef WITH_WSREP
/* wsrep_fake_trx_id violates this assert
Copied from trx_sys_get_new_trx_id
*/
ut_ad(trx_sys_mutex_own());
-#endif /* WITH_WSREP */
if (!srv_read_only_mode) {
mtr_start(&mtr);
diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c
index 2092e024e28..3febf879ec6 100644
--- a/storage/maria/ma_open.c
+++ b/storage/maria/ma_open.c
@@ -280,7 +280,7 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags)
size_t info_length;
char name_buff[FN_REFLEN], org_name[FN_REFLEN], index_name[FN_REFLEN],
data_name[FN_REFLEN];
- uchar *disk_cache, *disk_pos, *end_pos;
+ uchar *UNINIT_VAR(disk_cache), *disk_pos, *end_pos;
MARIA_HA info, *UNINIT_VAR(m_info), *old_info;
MARIA_SHARE share_buff,*share;
double *rec_per_key_part;
diff --git a/storage/maria/ma_search.c b/storage/maria/ma_search.c
index 089e3fabdb2..39d9322d903 100644
--- a/storage/maria/ma_search.c
+++ b/storage/maria/ma_search.c
@@ -745,11 +745,11 @@ void _ma_kpointer(register MARIA_HA *info, register uchar *buff, my_off_t pos)
case 5: mi_int5store(buff,pos); break;
#else
case 7: *buff++=0;
- /* fall trough */
+ /* fall through */
case 6: *buff++=0;
- /* fall trough */
+ /* fall through */
case 5: *buff++=0;
- /* fall trough */
+ /* fall through */
#endif
case 4: mi_int4store(buff,pos); break;
case 3: mi_int3store(buff,pos); break;
@@ -881,13 +881,13 @@ void _ma_dpointer(MARIA_SHARE *share, uchar *buff, my_off_t pos)
case 5: mi_int5store(buff,pos); break;
#else
case 8: *buff++=0;
- /* fall trough */
+ /* fall through */
case 7: *buff++=0;
- /* fall trough */
+ /* fall through */
case 6: *buff++=0;
- /* fall trough */
+ /* fall through */
case 5: *buff++=0;
- /* fall trough */
+ /* fall through */
#endif
case 4: mi_int4store(buff,pos); break;
case 3: mi_int3store(buff,pos); break;
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index 62c400b1c07..a52a306ce22 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -757,6 +757,7 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked)
{
MI_KEYDEF *keyinfo;
MI_COLUMNDEF *recinfo= 0;
+ char readlink_buf[FN_REFLEN], name_buff[FN_REFLEN];
uint recs;
uint i;
@@ -812,6 +813,30 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked)
(void) mi_extra(file, HA_EXTRA_NO_WAIT_LOCK, 0);
info(HA_STATUS_NO_LOCK | HA_STATUS_VARIABLE | HA_STATUS_CONST);
+
+ /*
+ Set data_file_name and index_file_name to point at the symlink value
+ if table is symlinked (Ie; Real name is not same as generated name)
+ */
+ fn_format(name_buff, file->filename, "", MI_NAME_DEXT,
+ MY_APPEND_EXT | MY_UNPACK_FILENAME);
+ if (my_is_symlink(name_buff))
+ {
+ my_readlink(readlink_buf, name_buff, MYF(0));
+ data_file_name= strdup_root(&table->mem_root, readlink_buf);
+ }
+ else
+ data_file_name= 0;
+ fn_format(name_buff, file->filename, "", MI_NAME_IEXT,
+ MY_APPEND_EXT | MY_UNPACK_FILENAME);
+ if (my_is_symlink(name_buff))
+ {
+ my_readlink(readlink_buf, name_buff, MYF(0));
+ index_file_name= strdup_root(&table->mem_root, readlink_buf);
+ }
+ else
+ index_file_name= 0;
+
if (!(test_if_locked & HA_OPEN_WAIT_IF_LOCKED))
(void) mi_extra(file, HA_EXTRA_WAIT_LOCK, 0);
if (!table->s->db_record_offset)
@@ -1953,7 +1978,6 @@ void ha_myisam::position(const uchar *record)
int ha_myisam::info(uint flag)
{
MI_ISAMINFO misam_info;
- char name_buff[FN_REFLEN];
if (!table)
return 1;
@@ -2001,27 +2025,6 @@ int ha_myisam::info(uint flag)
sizeof(table->key_info[0].rec_per_key[0])*share->key_parts);
if (table_share->tmp_table == NO_TMP_TABLE)
mysql_mutex_unlock(&table_share->LOCK_share);
-
- /*
- Set data_file_name and index_file_name to point at the symlink value
- if table is symlinked (Ie; Real name is not same as generated name)
- */
- char buf[FN_REFLEN];
- data_file_name= index_file_name= 0;
- fn_format(name_buff, file->filename, "", MI_NAME_DEXT,
- MY_APPEND_EXT | MY_UNPACK_FILENAME);
- if (my_is_symlink(name_buff))
- {
- my_readlink(buf, name_buff, MYF(0));
- data_file_name= ha_thd()->strdup(buf);
- }
- fn_format(name_buff, file->filename, "", MI_NAME_IEXT,
- MY_APPEND_EXT | MY_UNPACK_FILENAME);
- if (my_is_symlink(name_buff))
- {
- my_readlink(buf, name_buff, MYF(0));
- index_file_name= ha_thd()->strdup(buf);
- }
}
if (flag & HA_STATUS_ERRKEY)
{
diff --git a/storage/myisam/mi_search.c b/storage/myisam/mi_search.c
index 79ed846ce7e..d570f273b74 100644
--- a/storage/myisam/mi_search.c
+++ b/storage/myisam/mi_search.c
@@ -607,11 +607,11 @@ void _mi_kpointer(register MI_INFO *info, register uchar *buff, my_off_t pos)
case 5: mi_int5store(buff,pos); break;
#else
case 7: *buff++=0;
- /* fall trough */
+ /* fall through */
case 6: *buff++=0;
- /* fall trough */
+ /* fall through */
case 5: *buff++=0;
- /* fall trough */
+ /* fall through */
#endif
case 4: mi_int4store(buff,pos); break;
case 3: mi_int3store(buff,pos); break;
@@ -728,13 +728,13 @@ void _mi_dpointer(MI_INFO *info, uchar *buff, my_off_t pos)
case 5: mi_int5store(buff,pos); break;
#else
case 8: *buff++=0;
- /* fall trough */
+ /* fall through */
case 7: *buff++=0;
- /* fall trough */
+ /* fall through */
case 6: *buff++=0;
- /* fall trough */
+ /* fall through */
case 5: *buff++=0;
- /* fall trough */
+ /* fall through */
#endif
case 4: mi_int4store(buff,pos); break;
case 3: mi_int3store(buff,pos); break;
diff --git a/storage/rocksdb/CMakeLists.txt b/storage/rocksdb/CMakeLists.txt
index 1e20e0fa4a3..6cb7eb1d439 100644
--- a/storage/rocksdb/CMakeLists.txt
+++ b/storage/rocksdb/CMakeLists.txt
@@ -220,3 +220,18 @@ IF(MSVC)
# Some checks in C++ runtime that make debug build much slower
ADD_DEFINITIONS(-D_ITERATOR_DEBUG_LEVEL=0)
ENDIF()
+
+IF(GIT_EXECUTABLE)
+ EXECUTE_PROCESS(
+ COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/rocksdb
+ OUTPUT_VARIABLE OUT RESULT_VARIABLE RES)
+ IF(RES EQUAL 0)
+ STRING(REGEX REPLACE "\n$" "" ROCKSDB_GIT_HASH "${OUT}")
+ ENDIF()
+ENDIF()
+IF(ROCKSDB_GIT_HASH OR
+ (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/rdb_source_revision.h))
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/rdb_source_revision.h.in
+ ${CMAKE_CURRENT_BINARY_DIR}/rdb_source_revision.h )
+ENDIF()
diff --git a/storage/rocksdb/build_rocksdb.cmake b/storage/rocksdb/build_rocksdb.cmake
index dd23304a223..5810412f566 100644
--- a/storage/rocksdb/build_rocksdb.cmake
+++ b/storage/rocksdb/build_rocksdb.cmake
@@ -6,6 +6,7 @@ endif()
SET(ROCKSDB_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/rocksdb)
INCLUDE_DIRECTORIES(
+ ${CMAKE_CURRENT_BINARY_DIR}
${ROCKSDB_SOURCE_DIR}
${ROCKSDB_SOURCE_DIR}/include
${ROCKSDB_SOURCE_DIR}/third-party/gtest-1.7.0/fused-src
diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc
index d79f15c458b..479e290374e 100644
--- a/storage/rocksdb/ha_rocksdb.cc
+++ b/storage/rocksdb/ha_rocksdb.cc
@@ -70,6 +70,7 @@
#include "rocksdb/utilities/memory_util.h"
#include "rocksdb/utilities/sim_cache.h"
#include "util/stop_watch.h"
+#include "./rdb_source_revision.h"
/* MyRocks includes */
#include "./event_listener.h"
@@ -494,6 +495,7 @@ static uint32_t rocksdb_table_stats_sampling_pct;
static my_bool rocksdb_enable_bulk_load_api = 1;
static my_bool rocksdb_print_snapshot_conflict_queries = 0;
static my_bool rocksdb_large_prefix = 0;
+static char* rocksdb_git_hash;
char *compression_types_val=
const_cast<char*>(get_rocksdb_supported_compression_types());
@@ -650,6 +652,11 @@ static MYSQL_SYSVAR_BOOL(enable_bulk_load_api, rocksdb_enable_bulk_load_api,
"Enables using SstFileWriter for bulk loading",
nullptr, nullptr, rocksdb_enable_bulk_load_api);
+static MYSQL_SYSVAR_STR(git_hash, rocksdb_git_hash,
+ PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
+ "Git revision of the RocksDB library used by MyRocks",
+ nullptr, nullptr, ROCKSDB_GIT_HASH);
+
static MYSQL_THDVAR_STR(tmpdir, PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_MEMALLOC,
"Directory for temporary files during DDL operations.",
nullptr, nullptr, "");
@@ -1633,6 +1640,7 @@ static struct st_mysql_sys_var *rocksdb_system_variables[] = {
MYSQL_SYSVAR(table_stats_sampling_pct),
MYSQL_SYSVAR(large_prefix),
+ MYSQL_SYSVAR(git_hash),
nullptr};
static rocksdb::WriteOptions
diff --git a/storage/rocksdb/mysql-test/rocksdb/r/rocksdb.result b/storage/rocksdb/mysql-test/rocksdb/r/rocksdb.result
index d791cf98bb0..9b084e63cd5 100644
--- a/storage/rocksdb/mysql-test/rocksdb/r/rocksdb.result
+++ b/storage/rocksdb/mysql-test/rocksdb/r/rocksdb.result
@@ -924,6 +924,7 @@ rocksdb_force_compute_memtable_stats_cachetime 0
rocksdb_force_flush_memtable_and_lzero_now OFF
rocksdb_force_flush_memtable_now OFF
rocksdb_force_index_records_in_range 0
+rocksdb_git_hash #
rocksdb_hash_index_allow_collision ON
rocksdb_index_type kBinarySearch
rocksdb_info_log_level error_level
diff --git a/storage/rocksdb/mysql-test/rocksdb/t/disabled.def b/storage/rocksdb/mysql-test/rocksdb/t/disabled.def
index 118d8598de3..63c3d259d4c 100644
--- a/storage/rocksdb/mysql-test/rocksdb/t/disabled.def
+++ b/storage/rocksdb/mysql-test/rocksdb/t/disabled.def
@@ -41,7 +41,7 @@ rocksdb_deadlock_stress_rr: stress test
##
persistent_cache: Upstream RocksDB bug https://github.com/facebook/mysql-5.6/issues/579
collation: Fails on gcc 4.8 and before, MDEV-12433
-col_opt_zerofill: MDEV-14165: not MyRocks -problem in ps-protocol, happens in upstream too
+col_opt_zerofill: MDEV-14729 (also MDEV-14165 which was fixed): problem in the client
##
@@ -70,17 +70,10 @@ blind_delete_without_tx_api: MDEV-12286: rocksdb.blind_delete_without_tx_api tes
unique_check: wrong error number
autoinc_vars_thread: debug sync point wait timed out
-# Enabling these didn't seem to cause any trouble:
-# autoinc_vars_thread : MDEV-12474 Regularly fails on buildbot
-# unique_check : MDEV-12474 Regularly fails on buildbot
-# bloomfilter : MDEV-12474 Regularly fails on buildbot
-# unique_sec : Intermittent failures in BB
-
-
##
## Tests that fail for some other reason
##
+
information_schema : MariaRocks: requires GTIDs
mysqlbinlog_gtid_skip_empty_trans_rocksdb : MariaRocks: requires GTIDs
-#read_only_tx : MariaRocks: requires GTIDs
rpl_row_triggers : MariaRocks: requires GTIDs
diff --git a/storage/rocksdb/mysql-test/rocksdb/t/rocksdb.test b/storage/rocksdb/mysql-test/rocksdb/t/rocksdb.test
index 5c8fa9ed443..9199c572933 100644
--- a/storage/rocksdb/mysql-test/rocksdb/t/rocksdb.test
+++ b/storage/rocksdb/mysql-test/rocksdb/t/rocksdb.test
@@ -786,6 +786,8 @@ drop table t45;
--echo # Now it fails if there is data overlap with what
--echo # already exists
--echo #
+
+--replace_regex /[a-f0-9]{40}/#/
show variables
where
variable_name like 'rocksdb%' and
diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/my.cnf b/storage/rocksdb/mysql-test/rocksdb_rpl/my.cnf
index 2beaf514cee..ec7370b65f0 100644
--- a/storage/rocksdb/mysql-test/rocksdb_rpl/my.cnf
+++ b/storage/rocksdb/mysql-test/rocksdb_rpl/my.cnf
@@ -1,3 +1,4 @@
+!include rpl_1slave_base.cnf
!include include/default_my.cnf
[server]
diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_binlog_xid_count.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_binlog_xid_count.result
new file mode 100644
index 00000000000..9b46a5b5227
--- /dev/null
+++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/rpl_binlog_xid_count.result
@@ -0,0 +1,204 @@
+CREATE TABLE `t` (
+`a` text DEFAULT NULL
+) ENGINE=ROCKSDB;
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+INSERT INTO t SET a=repeat('a', 4096);
+INSERT INTO t SET a=repeat('a', 4096/2);
+DROP TABLE t;
diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/r/singledelete_idempotent_table.result b/storage/rocksdb/mysql-test/rocksdb_rpl/r/singledelete_idempotent_table.result
index 609d4a8821a..979e2cbf6c3 100644
--- a/storage/rocksdb/mysql-test/rocksdb_rpl/r/singledelete_idempotent_table.result
+++ b/storage/rocksdb/mysql-test/rocksdb_rpl/r/singledelete_idempotent_table.result
@@ -1,16 +1,19 @@
include/master-slave.inc
-Warnings:
-Note #### Sending passwords in plain text without SSL/TLS is extremely insecure.
-Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
+connection master;
drop table if exists r1;
create table r1 (id1 int, id2 int, primary key (id1, id2), index i (id2)) engine=rocksdb;
insert into r1 values (1, 1000);
set sql_log_bin=0;
delete from r1 where id1=1 and id2=1000;
set sql_log_bin=1;
+connection slave;
+connection slave;
set global rocksdb_force_flush_memtable_now=1;
+connection master;
insert into r1 values (1, 1000);
+connection slave;
+connection slave;
delete r1 from r1 force index (i) where id2=1000;
select id1,id2 from r1 force index (primary);
id1 id2
@@ -21,5 +24,6 @@ select id1,id2 from r1 force index (primary);
id1 id2
select id2 from r1 force index (i);
id2
+connection master;
drop table r1;
include/rpl_end.inc
diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/t/disabled.def b/storage/rocksdb/mysql-test/rocksdb_rpl/t/disabled.def
index 07a2738eee5..956355dceee 100644
--- a/storage/rocksdb/mysql-test/rocksdb_rpl/t/disabled.def
+++ b/storage/rocksdb/mysql-test/rocksdb_rpl/t/disabled.def
@@ -1,19 +1,29 @@
+##
+## Tests that require FB/MySQL specific features for which there are
+## no plans to port them to MariaDB
+##
+rpl_no_unique_check_on_lag : unique_check_lag_threshold is not available in MariaDB
+rpl_no_unique_check_on_lag_mts : unique_check_lag_threshold is not available in MariaDB
+consistent_snapshot_mixed_engines : Tests START TRANSACTION WITH CONSISTENT $ENGINE_NAME SNAPSHOT
+rpl_skip_trx_api_binlog_format : requires @@rpl_skip_tx_api
+rpl_ddl_high_priority : DDL commands with HIGH_PRIORITY syntax are not in MariaDB
+rpl_gtid_rocksdb_sys_header : MariaDB doesn't support printing "RocksDB: Last MySQL Gtid UUID" into server stderr on startup
+singledelete_idempotent_recovery: MariaDB doesn't support --slave-use-idempotent-for-recovery
-# rpl_rocksdb_2pc_crash_recover
+##
+## Tests that do not fit MariaDB's test environment (Functional tests only,
+## can't have stress tests)
+##
+rpl_rocksdb_stress_crash : Stress test
+
+##
+## Tests that are disabled for other reasons
+##
-consistent_snapshot_mixed_engines : Didn't try with MariaDB, yet
multiclient_2pc : Didn't try with MariaDB, yet
rpl_crash_safe_wal_corrupt : Didn't try with MariaDB, yet
-rpl_ddl_high_priority : Didn't try with MariaDB, yet
rpl_gtid_crash_safe : Didn't try with MariaDB, yet
rpl_gtid_crash_safe_wal_corrupt : Didn't try with MariaDB, yet
-rpl_gtid_rocksdb_sys_header : Didn't try with MariaDB, yet
-rpl_no_unique_check_on_lag : Didn't try with MariaDB, yet
-rpl_no_unique_check_on_lag_mts : Didn't try with MariaDB, yet
rpl_rocksdb_snapshot : Didn't try with MariaDB, yet
rpl_rocksdb_snapshot_without_gtid : Didn't try with MariaDB, yet
-rpl_rocksdb_stress_crash : Didn't try with MariaDB, yet
-rpl_skip_trx_api_binlog_format : Didn't try with MariaDB, yet
-singledelete_idempotent_recovery : Didn't try with MariaDB, yet
-singledelete_idempotent_table : Didn't try with MariaDB, yet
diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_binlog_xid_count-master.opt b/storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_binlog_xid_count-master.opt
new file mode 100644
index 00000000000..ed50a8a3deb
--- /dev/null
+++ b/storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_binlog_xid_count-master.opt
@@ -0,0 +1,3 @@
+--innodb --max-binlog-size=4096
+
+
diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_binlog_xid_count.test b/storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_binlog_xid_count.test
new file mode 100644
index 00000000000..7667f153cde
--- /dev/null
+++ b/storage/rocksdb/mysql-test/rocksdb_rpl/t/rpl_binlog_xid_count.test
@@ -0,0 +1,20 @@
+--source include/have_rocksdb.inc
+--source include/have_binlog_format_row.inc
+
+CREATE TABLE `t` (
+ `a` text DEFAULT NULL
+) ENGINE=ROCKSDB;
+
+
+--let $size=`SELECT @@GLOBAL.max_binlog_size`
+--let $loop_cnt= 100
+while ($loop_cnt)
+{
+ --eval INSERT INTO t SET a=repeat('a', $size)
+ --eval INSERT INTO t SET a=repeat('a', $size/2)
+
+ --dec $loop_cnt
+}
+
+# Cleanup
+DROP TABLE t;
diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/t/singledelete_idempotent_table.cnf b/storage/rocksdb/mysql-test/rocksdb_rpl/t/singledelete_idempotent_table.cnf
index ad4894f5b38..5f1f87d762f 100644
--- a/storage/rocksdb/mysql-test/rocksdb_rpl/t/singledelete_idempotent_table.cnf
+++ b/storage/rocksdb/mysql-test/rocksdb_rpl/t/singledelete_idempotent_table.cnf
@@ -2,14 +2,10 @@
[mysqld.1]
log_slave_updates
-gtid_mode=ON
-enforce_gtid_consistency=ON
[mysqld.2]
relay_log_recovery=1
-relay_log_info_repository=FILE
+#relay_log_info_repository=FILE
log_slave_updates
-gtid_mode=ON
-enforce_gtid_consistency=ON
-rbr_idempotent_tables='r1'
-
+#rbr_idempotent_tables='r1'
+slave_exec_mode=IDEMPOTENT
diff --git a/storage/rocksdb/mysql-test/rocksdb_rpl/t/singledelete_idempotent_table.test b/storage/rocksdb/mysql-test/rocksdb_rpl/t/singledelete_idempotent_table.test
index 23d335d6b57..00dce7c2ca9 100644
--- a/storage/rocksdb/mysql-test/rocksdb_rpl/t/singledelete_idempotent_table.test
+++ b/storage/rocksdb/mysql-test/rocksdb_rpl/t/singledelete_idempotent_table.test
@@ -2,7 +2,7 @@
--source include/have_binlog_format_row.inc
--source include/have_rocksdb.inc
--source include/master-slave.inc
---source include/have_gtid.inc
+#--source include/have_gtid.inc
--source include/not_valgrind.inc
# This is a test case for issue#655 -- SingleDelete on Primary Key may
diff --git a/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_git_hash_basic.test b/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_git_hash_basic.test
new file mode 100644
index 00000000000..7b314e47d4b
--- /dev/null
+++ b/storage/rocksdb/mysql-test/rocksdb_sys_vars/t/rocksdb_git_hash_basic.test
@@ -0,0 +1,6 @@
+--source include/have_rocksdb.inc
+
+--let $sys_var=ROCKSDB_GIT_HASH
+--let $read_only=1
+--let $session=0
+--source include/rocksdb_sys_var.inc
diff --git a/storage/rocksdb/rdb_datadic.cc b/storage/rocksdb/rdb_datadic.cc
index f4749d0c7cf..ff8a4faee55 100644
--- a/storage/rocksdb/rdb_datadic.cc
+++ b/storage/rocksdb/rdb_datadic.cc
@@ -1461,7 +1461,8 @@ int Rdb_key_def::unpack_record(TABLE *const table, uchar *const buf,
if (has_covered_bitmap && field->real_type() == MYSQL_TYPE_VARCHAR &&
!m_pack_info[i].m_covered) {
covered_column = curr_bitmap_pos < MAX_REF_PARTS &&
- bitmap_is_set(&covered_bitmap, curr_bitmap_pos++);
+ bitmap_is_set(&covered_bitmap, curr_bitmap_pos);
+ curr_bitmap_pos++;
}
if (fpi->m_unpack_func && covered_column) {
/* It is possible to unpack this column. Do it. */
diff --git a/storage/rocksdb/rdb_source_revision.h.in b/storage/rocksdb/rdb_source_revision.h.in
new file mode 100644
index 00000000000..617b39c9186
--- /dev/null
+++ b/storage/rocksdb/rdb_source_revision.h.in
@@ -0,0 +1 @@
+#define ROCKSDB_GIT_HASH "@ROCKSDB_GIT_HASH@"
diff --git a/strings/CMakeLists.txt b/strings/CMakeLists.txt
index 6d2190772c5..52dc2ed2b0f 100644
--- a/strings/CMakeLists.txt
+++ b/strings/CMakeLists.txt
@@ -20,7 +20,7 @@ SET(STRINGS_SOURCES bchange.c bmove_upp.c ctype-big5.c ctype-bin.c ctype-cp932.c
ctype-latin1.c ctype-mb.c ctype-simple.c ctype-sjis.c ctype-tis620.c ctype-uca.c
ctype-ucs2.c ctype-ujis.c ctype-utf8.c ctype-win1250ch.c ctype.c decimal.c dtoa.c int2str.c
is_prefix.c llstr.c longlong2str.c my_strtoll10.c my_vsnprintf.c
- str2int.c str_alloc.c strcend.c strend.c strfill.c strmake.c strmov.c strnmov.c
+ str2int.c strcend.c strend.c strfill.c strmake.c strmov.c strnmov.c
strxmov.c strxnmov.c xml.c
strmov_overlapp.c
my_strchr.c strcont.c strappend.c json_lib.c)
diff --git a/strings/ctype-tis620.c b/strings/ctype-tis620.c
index 4dbb66d89c5..5e24c84056c 100644
--- a/strings/ctype-tis620.c
+++ b/strings/ctype-tis620.c
@@ -524,7 +524,7 @@ int my_strnncoll_tis620(CHARSET_INFO *cs __attribute__((unused)),
tc1= buf;
if ((len1 + len2 +2) > (int) sizeof(buf))
- tc1= (uchar*) my_str_malloc(len1+len2+2);
+ tc1= (uchar*) my_malloc(len1+len2+2, MYF(MY_FAE));
tc2= tc1 + len1+1;
memcpy((char*) tc1, (char*) s1, len1);
tc1[len1]= 0; /* if length(s1)> len1, need to put 'end of string' */
@@ -534,7 +534,7 @@ int my_strnncoll_tis620(CHARSET_INFO *cs __attribute__((unused)),
thai2sortable(tc2, len2);
i= strcmp((char*)tc1, (char*)tc2);
if (tc1 != buf)
- my_str_free(tc1);
+ my_free(tc1);
return i;
}
@@ -550,7 +550,7 @@ int my_strnncollsp_tis620(CHARSET_INFO * cs __attribute__((unused)),
a= buf;
if ((a_length + b_length +2) > (int) sizeof(buf))
- alloced= a= (uchar*) my_str_malloc(a_length+b_length+2);
+ alloced= a= (uchar*) my_malloc(a_length+b_length+2, MYF(MY_FAE));
b= a + a_length+1;
memcpy((char*) a, (char*) a0, a_length);
@@ -578,7 +578,7 @@ int my_strnncollsp_tis620(CHARSET_INFO * cs __attribute__((unused)),
ret:
if (alloced)
- my_str_free(alloced);
+ my_free(alloced);
return res;
}
diff --git a/strings/my_vsnprintf.c b/strings/my_vsnprintf.c
index b2ff1e0fa2c..34ec811adac 100644
--- a/strings/my_vsnprintf.c
+++ b/strings/my_vsnprintf.c
@@ -752,14 +752,14 @@ int my_vfprintf(FILE *stream, const char* format, va_list args)
and try again.
*/
if (alloc)
- (*my_str_free)(p);
+ my_free(p);
else
alloc= 1;
new_len= cur_len*2;
if (new_len < cur_len)
return 0; /* Overflow */
cur_len= new_len;
- p= (*my_str_malloc)(cur_len);
+ p= my_malloc(cur_len, MYF(MY_FAE));
if (!p)
return 0;
}
@@ -767,7 +767,7 @@ int my_vfprintf(FILE *stream, const char* format, va_list args)
if (fputs(p, stream) < 0)
ret= -1;
if (alloc)
- (*my_str_free)(p);
+ my_free(p);
return ret;
}
diff --git a/strings/str_alloc.c b/strings/str_alloc.c
deleted file mode 100644
index 91246603f2e..00000000000
--- a/strings/str_alloc.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Copyright (c) 2005, 2006 MySQL AB
- Copyright (c) 2009-2011, Monty Program Ab
- Use is subject to license terms.
- Copyright (c) 2009-2011, Monty Program Ab
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; version 2 of the License.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
-
-#include "strings_def.h"
-
-static void *my_str_malloc_default(size_t size)
-{
- void *ret= malloc(size);
- if (!ret)
- exit(1);
- return ret;
-}
-
-static void my_str_free_default(void *ptr)
-{
- free(ptr);
-}
-
-void *my_str_realloc_default(void *ptr, size_t size)
-{
- return realloc(ptr, size);
-}
-
-void *(*my_str_malloc)(size_t)= &my_str_malloc_default;
-void (*my_str_free)(void *)= &my_str_free_default;
-void *(*my_str_realloc)(void *, size_t)= &my_str_realloc_default;
diff --git a/strings/xml.c b/strings/xml.c
index 4685a04faec..b5fed6a6760 100644
--- a/strings/xml.c
+++ b/strings/xml.c
@@ -17,6 +17,7 @@
#include "strings_def.h"
#include "m_string.h"
#include "my_xml.h"
+#include "my_sys.h"
#define MY_XML_UNKNOWN 'U'
@@ -231,13 +232,13 @@ static int my_xml_attr_ensure_space(MY_XML_PARSER *st, size_t len)
if (!st->attr.buffer)
{
- st->attr.buffer= (char *) my_str_malloc(st->attr.buffer_size);
+ st->attr.buffer= (char *) my_malloc(st->attr.buffer_size, MYF(0));
if (st->attr.buffer)
memcpy(st->attr.buffer, st->attr.static_buffer, ofs + 1 /*term. zero */);
}
else
- st->attr.buffer= (char *) my_str_realloc(st->attr.buffer,
- st->attr.buffer_size);
+ st->attr.buffer= (char *) my_realloc(st->attr.buffer,
+ st->attr.buffer_size, MYF(0));
st->attr.start= st->attr.buffer;
st->attr.end= st->attr.start + ofs;
@@ -507,7 +508,7 @@ void my_xml_parser_free(MY_XML_PARSER *p)
{
if (p->attr.buffer)
{
- my_str_free(p->attr.buffer);
+ my_free(p->attr.buffer);
p->attr.buffer= NULL;
}
}
diff --git a/support-files/CMakeLists.txt b/support-files/CMakeLists.txt
index a3a8f9fd1b4..52184baef7e 100644
--- a/support-files/CMakeLists.txt
+++ b/support-files/CMakeLists.txt
@@ -102,6 +102,21 @@ IF(UNIX)
${CMAKE_CURRENT_BINARY_DIR}/mariadb.service
DESTINATION ${inst_location}/systemd COMPONENT SupportFiles)
+ IF(INSTALL_SYSTEMD_SYSUSERSDIR)
+ CONFIGURE_FILE(sysusers.conf.in
+ ${CMAKE_CURRENT_BINARY_DIR}/sysusers.conf @ONLY)
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/sysusers.conf
+ DESTINATION ${INSTALL_SYSTEMD_SYSUSERSDIR} COMPONENT Server)
+ ENDIF()
+
+ IF(INSTALL_SYSTEMD_TMPFILESDIR)
+ get_filename_component(MYSQL_UNIX_DIR ${MYSQL_UNIX_ADDR} DIRECTORY)
+ CONFIGURE_FILE(tmpfiles.conf.in
+ ${CMAKE_CURRENT_BINARY_DIR}/tmpfiles.conf @ONLY)
+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/tmpfiles.conf
+ DESTINATION ${INSTALL_SYSTEMD_TMPFILESDIR} COMPONENT Server)
+ ENDIF()
+
# @ in directory name broken between CMake version 2.8.12.2 and 3.3
# http://public.kitware.com/Bug/view.php?id=14782
IF(NOT CMAKE_VERSION VERSION_LESS 3.3.0 OR NOT RPM)
diff --git a/support-files/sysusers.conf.in b/support-files/sysusers.conf.in
new file mode 100644
index 00000000000..a975b29476a
--- /dev/null
+++ b/support-files/sysusers.conf.in
@@ -0,0 +1 @@
+u @MYSQLD_USER@ - "MariaDB" @MYSQL_DATADIR@
diff --git a/support-files/tmpfiles.conf.in b/support-files/tmpfiles.conf.in
new file mode 100644
index 00000000000..03d66abc0c7
--- /dev/null
+++ b/support-files/tmpfiles.conf.in
@@ -0,0 +1 @@
+d @MYSQL_UNIX_DIR@ 0755 @MYSQLD_USER@ @MYSQLD_USER@ -