summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-03-20 10:26:49 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-03-20 10:41:32 +0200
commit514b305dfb2839c619a623bbdae5f21cf0077672 (patch)
tree2f9700f05ccf0ddc7e46a547d9a191404e8dbbd7
parentde51acd03730311505677eb7212756e7126183b3 (diff)
parent117291db8b35ddb4cd8c89ee4d8de888160b7163 (diff)
downloadmariadb-git-514b305dfb2839c619a623bbdae5f21cf0077672.tar.gz
Merge 10.3 into 10.4
The MDEV-17262 commit 26432e49d37a37d09b862bb49a021e44bdf4789c was skipped. In Galera 4, the implementation would seem to require changes to the streaming replication. In the tests archive.rnd_pos main.profiling, disable_ps_protocol for SHOW STATUS and SHOW PROFILE commands until MDEV-18974 has been fixed.
-rw-r--r--.gitignore3
-rw-r--r--client/mysqlbinlog.cc23
-rw-r--r--client/mysqlcheck.c3
-rw-r--r--client/mysqltest.cc60
-rw-r--r--extra/mariabackup/backup_mysql.cc18
-rw-r--r--extra/mariabackup/xtrabackup.cc48
-rw-r--r--extra/mariabackup/xtrabackup.h2
-rw-r--r--include/thread_pool_priv.h2
-rw-r--r--man/mysqldumpslow.124
-rw-r--r--mysql-test/include/check-testcase.test1
-rw-r--r--mysql-test/main/analyze_stmt.result10
-rw-r--r--mysql-test/main/analyze_stmt.test6
-rw-r--r--mysql-test/main/func_time.result30
-rw-r--r--mysql-test/main/func_time.test30
-rw-r--r--mysql-test/main/kill_processlist-6619.test2
-rw-r--r--mysql-test/main/log_slow_debug.result142
-rw-r--r--mysql-test/main/log_slow_debug.test126
-rw-r--r--mysql-test/main/log_tables.test2
-rw-r--r--mysql-test/main/old-mode.test3
-rw-r--r--mysql-test/main/partition.result2
-rw-r--r--mysql-test/main/partition.test2
-rw-r--r--mysql-test/main/profiling.test2
-rw-r--r--mysql-test/main/show_check.test16
-rw-r--r--mysql-test/main/show_explain_ps.result7
-rw-r--r--mysql-test/main/show_explain_ps.test16
-rw-r--r--mysql-test/main/sp-ucs2.result34
-rw-r--r--mysql-test/main/sp-ucs2.test16
-rw-r--r--mysql-test/main/sp.result2
-rw-r--r--mysql-test/main/sp.test2
-rw-r--r--mysql-test/main/sp_notembedded.result2
-rw-r--r--mysql-test/main/sp_notembedded.test2
-rw-r--r--mysql-test/main/sp_trans.result2
-rw-r--r--mysql-test/main/sp_trans.test2
-rw-r--r--mysql-test/main/subselect_sj_mat.test2
-rw-r--r--mysql-test/main/temp_table.test2
-rw-r--r--mysql-test/main/tmp_table_count-7586.test4
-rw-r--r--mysql-test/main/type_year.result9
-rw-r--r--mysql-test/main/type_year.test11
-rw-r--r--mysql-test/main/update.result13
-rw-r--r--mysql-test/main/update.test19
-rw-r--r--mysql-test/main/userstat.result12
-rw-r--r--mysql-test/main/userstat.test7
-rw-r--r--mysql-test/main/view.result14
-rw-r--r--mysql-test/main/view.test24
-rw-r--r--mysql-test/main/win.result17
-rw-r--r--mysql-test/main/win.test14
-rw-r--r--mysql-test/suite/archive/rnd_pos.test4
-rw-r--r--mysql-test/suite/funcs_1/datadict/processlist_priv.inc13
-rw-r--r--mysql-test/suite/funcs_1/datadict/processlist_val.inc7
-rw-r--r--mysql-test/suite/galera/r/galera_kill_largechanges.result19
-rw-r--r--mysql-test/suite/galera/r/galera_kill_nochanges.result10
-rw-r--r--mysql-test/suite/galera/r/galera_kill_smallchanges.result7
-rw-r--r--mysql-test/suite/galera/r/galera_load_data.result82
-rw-r--r--mysql-test/suite/galera/suite.pm1
-rw-r--r--mysql-test/suite/galera/t/galera_kill_largechanges.test17
-rw-r--r--mysql-test/suite/galera/t/galera_kill_nochanges.test5
-rw-r--r--mysql-test/suite/galera/t/galera_kill_smallchanges.test11
-rw-r--r--mysql-test/suite/galera/t/galera_load_data.cnf10
-rw-r--r--mysql-test/suite/galera/t/galera_load_data.test61
-rw-r--r--mysql-test/suite/handler/ps.test2
-rw-r--r--mysql-test/suite/innodb/r/doublewrite.result2
-rw-r--r--mysql-test/suite/innodb/r/log_file_name.result10
-rw-r--r--mysql-test/suite/innodb/t/alter_kill.test2
-rw-r--r--mysql-test/suite/innodb/t/doublewrite.test4
-rw-r--r--mysql-test/suite/innodb/t/innodb-corrupted-table.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb-index.test2
-rw-r--r--mysql-test/suite/innodb/t/log_file_name.test14
-rw-r--r--mysql-test/suite/maria/maria-recovery.result38
-rw-r--r--mysql-test/suite/maria/maria-recovery.test30
-rw-r--r--mysql-test/suite/rpl/include/create_recursive_construct.inc2
-rw-r--r--mysql-test/suite/sys_vars/t/max_prepared_stmt_count_func.test2
-rw-r--r--mysql-test/suite/sys_vars/t/sql_buffer_result_func.test10
-rw-r--r--mysql-test/suite/vcol/t/wrong_arena.test2
-rw-r--r--scripts/mysqldumpslow.sh9
-rw-r--r--sql/datadict.cc2
-rw-r--r--sql/debug_sync.cc6
-rw-r--r--sql/encryption.cc15
-rw-r--r--sql/ha_partition.cc2
-rw-r--r--sql/handler.cc1
-rw-r--r--sql/handler.h4
-rw-r--r--sql/item.cc1
-rw-r--r--sql/item_jsonfunc.cc4
-rw-r--r--sql/item_timefunc.cc18
-rw-r--r--sql/log_slow.h1
-rw-r--r--sql/mdl.h10
-rw-r--r--sql/mysqld.cc2
-rw-r--r--sql/mysqld.h3
-rw-r--r--sql/opt_range.cc17
-rw-r--r--sql/partition_info.cc9
-rw-r--r--sql/protocol.h67
-rw-r--r--sql/sql_acl.cc118
-rw-r--r--sql/sql_acl.h2
-rw-r--r--sql/sql_admin.cc2
-rw-r--r--sql/sql_admin.h8
-rw-r--r--sql/sql_alter.cc11
-rw-r--r--sql/sql_alter.h2
-rw-r--r--sql/sql_analyse.cc5
-rw-r--r--sql/sql_analyse.h5
-rw-r--r--sql/sql_class.cc17
-rw-r--r--sql/sql_class.h38
-rw-r--r--sql/sql_cmd.h14
-rw-r--r--sql/sql_connect.cc1
-rw-r--r--sql/sql_cte.cc1
-rw-r--r--sql/sql_handler.cc7
-rw-r--r--sql/sql_insert.cc6
-rw-r--r--sql/sql_lex.cc14
-rw-r--r--sql/sql_parse.cc158
-rw-r--r--sql/sql_partition_admin.cc5
-rw-r--r--sql/sql_prepare.cc31
-rw-r--r--sql/sql_priv.h6
-rw-r--r--sql/sql_select.cc15
-rw-r--r--sql/sql_select.h5
-rw-r--r--sql/sql_show.cc57
-rw-r--r--sql/sql_string.h21
-rw-r--r--sql/sql_table.cc2
-rw-r--r--sql/sql_trigger.cc4
-rw-r--r--sql/sql_tvc.cc14
-rw-r--r--sql/sql_union.cc27
-rw-r--r--sql/sql_view.cc25
-rw-r--r--sql/sql_yacc.yy4
-rw-r--r--sql/sql_yacc_ora.yy5
-rw-r--r--sql/table.h16
-rw-r--r--sql/tztime.cc8
-rw-r--r--storage/innobase/buf/buf0buddy.cc2
-rw-r--r--storage/innobase/buf/buf0buf.cc16
-rw-r--r--storage/innobase/dict/dict0mem.cc11
-rw-r--r--storage/innobase/dict/dict0stats_bg.cc24
-rw-r--r--storage/innobase/fsp/fsp0file.cc7
-rw-r--r--storage/innobase/handler/ha_innodb.cc131
-rw-r--r--storage/innobase/handler/ha_innodb.h17
-rw-r--r--storage/innobase/handler/handler0alter.cc99
-rw-r--r--storage/innobase/include/dict0mem.h9
-rw-r--r--storage/innobase/include/ut0new.h39
-rw-r--r--storage/innobase/os/os0file.cc12
-rw-r--r--storage/innobase/row/row0mysql.cc9
-rw-r--r--storage/innobase/trx/trx0purge.cc79
-rw-r--r--storage/innobase/trx/trx0undo.cc9
-rw-r--r--storage/innobase/ut/ut0new.cc3
-rw-r--r--storage/maria/ma_recovery.c13
-rw-r--r--storage/maria/ma_write.c13
-rw-r--r--storage/mroonga/ha_mroonga.cpp17
-rw-r--r--storage/myisam/mi_write.c15
-rw-r--r--storage/myisam/myisamlog.c10
-rw-r--r--storage/myisammrg/ha_myisammrg.cc43
-rw-r--r--storage/rocksdb/ha_rocksdb.cc2
-rw-r--r--storage/rocksdb/rdb_datadic.cc8
-rw-r--r--storage/rocksdb/rdb_threads.cc2
-rw-r--r--storage/sequence/sequence.cc9
-rw-r--r--storage/spider/ha_spider.cc2
-rw-r--r--storage/spider/spd_table.cc4
-rw-r--r--storage/spider/spd_trx.cc6
-rw-r--r--unittest/sql/mf_iocache-t.cc8
152 files changed, 1636 insertions, 966 deletions
diff --git a/.gitignore b/.gitignore
index fb0857c8c24..64844c6269a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -516,3 +516,6 @@ compile_commands.json
.editorconfig
.kateconfig
*.kdev4
+
+# Visual Studio Code workspace
+.vscode/
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc
index 114e7e8d38e..ff8566e6953 100644
--- a/client/mysqlbinlog.cc
+++ b/client/mysqlbinlog.cc
@@ -3215,17 +3215,24 @@ err:
DBUG_RETURN(retval == ERROR_STOP ? 1 : 0);
}
+uint e_key_get_latest_version_func(uint) { return 1; }
+uint e_key_get_func(uint, uint, uchar*, uint*) { return 1; }
+uint e_ctx_size_func(uint, uint) { return 1; }
+int e_ctx_init_func(void *, const uchar*, uint, const uchar*, uint,
+ int, uint, uint) { return 1; }
+int e_ctx_update_func(void *, const uchar*, uint, uchar*, uint*) { return 1; }
+int e_ctx_finish_func(void *, uchar*, uint*) { return 1; }
+uint e_encrypted_length_func(uint, uint, uint) { return 1; }
-uint dummy1() { return 1; }
struct encryption_service_st encryption_handler=
{
- (uint(*)(uint))dummy1,
- (uint(*)(uint, uint, uchar*, uint*))dummy1,
- (uint(*)(uint, uint))dummy1,
- (int (*)(void*, const uchar*, uint, const uchar*, uint, int, uint, uint))dummy1,
- (int (*)(void*, const uchar*, uint, uchar*, uint*))dummy1,
- (int (*)(void*, uchar*, uint*))dummy1,
- (uint (*)(uint, uint, uint))dummy1
+ e_key_get_latest_version_func,
+ e_key_get_func,
+ e_ctx_size_func,
+ e_ctx_init_func,
+ e_ctx_update_func,
+ e_ctx_finish_func,
+ e_encrypted_length_func
};
/*
diff --git a/client/mysqlcheck.c b/client/mysqlcheck.c
index 432c7abcbe1..e4ab18d52c4 100644
--- a/client/mysqlcheck.c
+++ b/client/mysqlcheck.c
@@ -962,7 +962,8 @@ static int handle_request_for_tables(char *tables, size_t length,
puts(query);
if (mysql_real_query(sock, query, (ulong)query_length))
{
- sprintf(message, "when executing '%s%s... %s'", op, tab_view, options);
+ my_snprintf(message, sizeof(message), "when executing '%s%s... %s'",
+ op, tab_view, options);
DBerror(sock, message);
my_free(query);
DBUG_RETURN(1);
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index ca15e5e2808..80d4d70be2c 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -8267,6 +8267,12 @@ void run_query_stmt(struct st_connection *cn, struct st_command *command,
DBUG_ENTER("run_query_stmt");
DBUG_PRINT("query", ("'%-.60s'", query));
+ if (!mysql)
+ {
+ handle_no_active_connection(command, cn, ds);
+ DBUG_VOID_RETURN;
+ }
+
/*
Init a new stmt if it's not already one created for this connection
*/
@@ -8804,18 +8810,56 @@ void init_re(void)
*/
const char *ps_re_str =
"^("
- "[[:space:]]*REPLACE[[:space:]]|"
- "[[:space:]]*INSERT[[:space:]]|"
- "[[:space:]]*UPDATE[[:space:]]|"
- "[[:space:]]*DELETE[[:space:]]|"
- "[[:space:]]*SELECT[[:space:]]|"
+ "[[:space:]]*ALTER[[:space:]]+SEQUENCE[[:space:]]|"
+ "[[:space:]]*ALTER[[:space:]]+TABLE[[:space:]]|"
+ "[[:space:]]*ALTER[[:space:]]+USER[[:space:]]|"
+ "[[:space:]]*ANALYZE[[:space:]]|"
+ "[[:space:]]*ASSIGN[[:space:]]|"
+ //"[[:space:]]*CALL[[:space:]]|" // XXX run_query_stmt doesn't read multiple result sets
+ "[[:space:]]*CHANGE[[:space:]]|"
+ "[[:space:]]*CHECKSUM[[:space:]]|"
+ "[[:space:]]*COMMIT[[:space:]]|"
+ "[[:space:]]*COMPOUND[[:space:]]|"
+ "[[:space:]]*CREATE[[:space:]]+DATABASE[[:space:]]|"
+ "[[:space:]]*CREATE[[:space:]]+INDEX[[:space:]]|"
+ "[[:space:]]*CREATE[[:space:]]+ROLE[[:space:]]|"
+ "[[:space:]]*CREATE[[:space:]]+SEQUENCE[[:space:]]|"
"[[:space:]]*CREATE[[:space:]]+TABLE[[:space:]]|"
+ "[[:space:]]*CREATE[[:space:]]+USER[[:space:]]|"
+ "[[:space:]]*CREATE[[:space:]]+VIEW[[:space:]]|"
+ "[[:space:]]*DELETE[[:space:]]|"
"[[:space:]]*DO[[:space:]]|"
+ "[[:space:]]*DROP[[:space:]]+DATABASE[[:space:]]|"
+ "[[:space:]]*DROP[[:space:]]+INDEX[[:space:]]|"
+ "[[:space:]]*DROP[[:space:]]+ROLE[[:space:]]|"
+ "[[:space:]]*DROP[[:space:]]+SEQUENCE[[:space:]]|"
+ "[[:space:]]*DROP[[:space:]]+TABLE[[:space:]]|"
+ "[[:space:]]*DROP[[:space:]]+USER[[:space:]]|"
+ "[[:space:]]*DROP[[:space:]]+VIEW[[:space:]]|"
+ "[[:space:]]*FLUSH[[:space:]]|"
+ "[[:space:]]*GRANT[[:space:]]|"
"[[:space:]]*HANDLER[[:space:]]+.*[[:space:]]+READ[[:space:]]|"
+ "[[:space:]]*INSERT[[:space:]]|"
+ "[[:space:]]*INSTALL[[:space:]]+|"
+ "[[:space:]]*KILL[[:space:]]|"
+ "[[:space:]]*OPTIMIZE[[:space:]]|"
+ "[[:space:]]*PRELOAD[[:space:]]|"
+ "[[:space:]]*RENAME[[:space:]]+TABLE[[:space:]]|"
+ "[[:space:]]*RENAME[[:space:]]+USER[[:space:]]|"
+ "[[:space:]]*REPAIR[[:space:]]|"
+ "[[:space:]]*REPLACE[[:space:]]|"
+ "[[:space:]]*RESET[[:space:]]|"
+ "[[:space:]]*REVOKE[[:space:]]|"
+ "[[:space:]]*ROLLBACK[[:space:]]|"
+ "[[:space:]]*SELECT[[:space:]]|"
"[[:space:]]*SET[[:space:]]+OPTION[[:space:]]|"
- "[[:space:]]*DELETE[[:space:]]+MULTI[[:space:]]|"
- "[[:space:]]*UPDATE[[:space:]]+MULTI[[:space:]]|"
- "[[:space:]]*INSERT[[:space:]]+SELECT[[:space:]])";
+ "[[:space:]]*SHOW[[:space:]]|"
+ "[[:space:]]*SHUTDOWN[[:space:]]|"
+ "[[:space:]]*SLAVE[[:space:]]|"
+ "[[:space:]]*TRUNCATE[[:space:]]|"
+ "[[:space:]]*UNINSTALL[[:space:]]+|"
+ "[[:space:]]*UPDATE[[:space:]]"
+ ")";
/*
Filter for queries that can be run using the
diff --git a/extra/mariabackup/backup_mysql.cc b/extra/mariabackup/backup_mysql.cc
index 5c310c1a261..b0ee0420049 100644
--- a/extra/mariabackup/backup_mysql.cc
+++ b/extra/mariabackup/backup_mysql.cc
@@ -68,7 +68,6 @@ unsigned long mysql_server_version = 0;
/* server capabilities */
bool have_changed_page_bitmaps = false;
bool have_backup_locks = false;
-bool have_backup_safe_binlog_info = false;
bool have_lock_wait_timeout = false;
bool have_galera_enabled = false;
bool have_flush_engine_logs = false;
@@ -336,7 +335,6 @@ get_mysql_vars(MYSQL *connection)
char *version_comment_var = NULL;
char *innodb_version_var = NULL;
char *have_backup_locks_var = NULL;
- char *have_backup_safe_binlog_info_var = NULL;
char *log_bin_var = NULL;
char *lock_wait_timeout_var= NULL;
char *wsrep_on_var = NULL;
@@ -360,8 +358,6 @@ get_mysql_vars(MYSQL *connection)
mysql_variable mysql_vars[] = {
{"have_backup_locks", &have_backup_locks_var},
- {"have_backup_safe_binlog_info",
- &have_backup_safe_binlog_info_var},
{"log_bin", &log_bin_var},
{"lock_wait_timeout", &lock_wait_timeout_var},
{"gtid_mode", &gtid_mode_var},
@@ -394,23 +390,12 @@ get_mysql_vars(MYSQL *connection)
}
if (opt_binlog_info == BINLOG_INFO_AUTO) {
-
- if (have_backup_safe_binlog_info_var != NULL)
- opt_binlog_info = BINLOG_INFO_LOCKLESS;
- else if (log_bin_var != NULL && !strcmp(log_bin_var, "ON"))
+ if (log_bin_var != NULL && !strcmp(log_bin_var, "ON"))
opt_binlog_info = BINLOG_INFO_ON;
else
opt_binlog_info = BINLOG_INFO_OFF;
}
- if (have_backup_safe_binlog_info_var == NULL &&
- opt_binlog_info == BINLOG_INFO_LOCKLESS) {
-
- msg("Error: --binlog-info=LOCKLESS is not supported by the "
- "server");
- return(false);
- }
-
if (lock_wait_timeout_var != NULL) {
have_lock_wait_timeout = true;
}
@@ -1716,4 +1701,3 @@ mdl_unlock_all()
mysql_close(mdl_con);
spaceid_to_tablename.clear();
}
-
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index c5408ef03f5..c903b374797 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -363,9 +363,6 @@ struct ddl_tracker_t {
static ddl_tracker_t ddl_tracker;
-/* Whether xtrabackup_binlog_info should be created on recovery */
-static bool recover_binlog_info;
-
/* Simple datasink creation tracking...add datasinks in the reverse order you
want them destroyed. */
#define XTRABACKUP_MAX_DATASINKS 10
@@ -2012,7 +2009,6 @@ xtrabackup_read_metadata(char *filename)
{
FILE *fp;
my_bool r = TRUE;
- int t;
fp = fopen(filename,"r");
if(!fp) {
@@ -2043,9 +2039,6 @@ xtrabackup_read_metadata(char *filename)
}
/* Optional fields */
- if (fscanf(fp, "recover_binlog_info = %d\n", &t) == 1) {
- recover_binlog_info = (t == 1);
- }
end:
fclose(fp);
@@ -2064,13 +2057,11 @@ xtrabackup_print_metadata(char *buf, size_t buf_len)
"backup_type = %s\n"
"from_lsn = " UINT64PF "\n"
"to_lsn = " UINT64PF "\n"
- "last_lsn = " UINT64PF "\n"
- "recover_binlog_info = %d\n",
+ "last_lsn = " UINT64PF "\n",
metadata_type,
metadata_from_lsn,
metadata_to_lsn,
- metadata_last_lsn,
- MY_TEST(opt_binlog_info == BINLOG_INFO_LOCKLESS));
+ metadata_last_lsn);
}
/***********************************************************************
@@ -5295,27 +5286,6 @@ innodb_free_param()
}
-/** Store the current binary log coordinates in a specified file.
-@param[in] filename file name
-@param[in] name binary log file name
-@param[in] pos binary log file position
-@return whether the operation succeeded */
-static bool
-store_binlog_info(const char* filename, const char* name, ulonglong pos)
-{
- FILE *fp = fopen(filename, "w");
-
- if (!fp) {
- msg("mariabackup: failed to open '%s'", filename);
- return(false);
- }
-
- fprintf(fp, "%s\t%llu\n", name, pos);
- fclose(fp);
-
- return(true);
-}
-
/** Check if file exists*/
static bool file_exists(std::string name)
{
@@ -5581,20 +5551,6 @@ xtrabackup_prepare_func(char** argv)
msg("Last binlog file %s, position %lld",
trx_sys.recovered_binlog_filename,
longlong(trx_sys.recovered_binlog_offset));
-
- /* output to xtrabackup_binlog_pos_innodb and
- (if backup_safe_binlog_info was available on
- the server) to xtrabackup_binlog_info. In the
- latter case xtrabackup_binlog_pos_innodb
- becomes redundant and is created only for
- compatibility. */
- ok = store_binlog_info("xtrabackup_binlog_pos_innodb",
- trx_sys.recovered_binlog_filename,
- trx_sys.recovered_binlog_offset)
- && (!recover_binlog_info
- || store_binlog_info(XTRABACKUP_BINLOG_INFO,
- trx_sys.recovered_binlog_filename,
- trx_sys.recovered_binlog_offset));
}
/* Check whether the log is applied enough or not. */
diff --git a/extra/mariabackup/xtrabackup.h b/extra/mariabackup/xtrabackup.h
index 767efe14b50..25943ea7d98 100644
--- a/extra/mariabackup/xtrabackup.h
+++ b/extra/mariabackup/xtrabackup.h
@@ -141,7 +141,7 @@ extern uint opt_safe_slave_backup_timeout;
extern const char *opt_history;
-enum binlog_info_enum { BINLOG_INFO_OFF, BINLOG_INFO_LOCKLESS, BINLOG_INFO_ON,
+enum binlog_info_enum { BINLOG_INFO_OFF, BINLOG_INFO_ON,
BINLOG_INFO_AUTO};
extern ulong opt_binlog_info;
diff --git a/include/thread_pool_priv.h b/include/thread_pool_priv.h
index cd53306e851..7eb2800555a 100644
--- a/include/thread_pool_priv.h
+++ b/include/thread_pool_priv.h
@@ -94,8 +94,6 @@ void mysql_audit_release(THD *thd);
bool thd_is_connection_alive(THD *thd);
/* Close connection with possible error code */
void close_connection(THD *thd, uint errcode);
-/* End the connection before closing it */
-void end_connection(THD *thd);
/* Decrement connection counter */
void dec_connection_count();
/* Destroy THD object */
diff --git a/man/mysqldumpslow.1 b/man/mysqldumpslow.1
index 27b18a4a7c2..3c9048e7394 100644
--- a/man/mysqldumpslow.1
+++ b/man/mysqldumpslow.1
@@ -210,6 +210,30 @@ should be chosen from the following list:
.IP \(bu 2.3
.\}
t,
+aa: Sort by rows affected or average rows affected
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+l,
+ae: Sort by rows examined or aggregate rows examined
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
+l,
at: Sort by query time or average query time
.RE
.sp
diff --git a/mysql-test/include/check-testcase.test b/mysql-test/include/check-testcase.test
index 1f8138eb072..39aa3d49d68 100644
--- a/mysql-test/include/check-testcase.test
+++ b/mysql-test/include/check-testcase.test
@@ -98,6 +98,7 @@ call mtr.check_testcase();
let $datadir=`select @@datadir`;
list_files $datadir mysql_upgrade_info;
list_files_write_file $datadir.tempfiles.txt $datadir/test #sql*;
+--replace_regex /#sql-ib[0-9a-f]+-[0-9a-f]+\.ibd\n//
cat_file $datadir.tempfiles.txt;
remove_file $datadir.tempfiles.txt;
list_files $datadir/mysql #sql*;
diff --git a/mysql-test/main/analyze_stmt.result b/mysql-test/main/analyze_stmt.result
index 1747fd63de6..3ae49c5eeb6 100644
--- a/mysql-test/main/analyze_stmt.result
+++ b/mysql-test/main/analyze_stmt.result
@@ -247,11 +247,9 @@ drop table t1;
#
create table t1 (i int);
insert into t1 values (1);
-analyze select * from t1 into @var;
+analyze select * into @var from t1 ;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE t1 system NULL NULL NULL NULL 1 NULL 100.00 NULL
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
drop table t1;
#
# MDEV-6394: ANALYZE DELETE .. RETURNING fails with ERROR 2027 Malformed packet
@@ -283,12 +281,10 @@ drop table t1;
#
create table t1(a int);
insert into t1 values (1),(2);
-analyze select a from t1 where a <2 into @var;
+analyze select a into @var from t1 where a <2 ;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 2.00 100.00 50.00 Using where
-Warnings:
-Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
-analyze select a from t1 into @var;
+analyze select a into @var from t1 ;
ERROR 42000: Result consisted of more than one row
analyze insert into t1 select * from t1;
id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra
diff --git a/mysql-test/main/analyze_stmt.test b/mysql-test/main/analyze_stmt.test
index d02139fe0c8..15fc00a321d 100644
--- a/mysql-test/main/analyze_stmt.test
+++ b/mysql-test/main/analyze_stmt.test
@@ -196,7 +196,7 @@ drop table t1;
--echo #
create table t1 (i int);
insert into t1 values (1);
-analyze select * from t1 into @var;
+analyze select * into @var from t1 ;
drop table t1;
--echo #
@@ -223,9 +223,9 @@ drop table t1;
create table t1(a int);
insert into t1 values (1),(2);
-analyze select a from t1 where a <2 into @var;
+analyze select a into @var from t1 where a <2 ;
--error ER_TOO_MANY_ROWS
-analyze select a from t1 into @var;
+analyze select a into @var from t1 ;
analyze insert into t1 select * from t1;
diff --git a/mysql-test/main/func_time.result b/mysql-test/main/func_time.result
index 007f5585c27..e5e9610da8c 100644
--- a/mysql-test/main/func_time.result
+++ b/mysql-test/main/func_time.result
@@ -3425,6 +3425,36 @@ t2 CREATE TABLE `t2` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1,t2;
#
+# MDEV-14926 AddressSanitizer: heap-use-after-free in make_date_time on weird combination of functions
+#
+DO INET_ATON( FROM_UNIXTIME( @@timestamp, ( TRIM( UNHEX(HEX('%m.%d.%Y') ) ) ) ) );
+CREATE TABLE t1 (d DATE);
+INSERT INTO t1 VALUES ('1989-03-10');
+SELECT TIME_FORMAT('23:59:43', BINARY d) AS f FROM t1 GROUP BY 'foo';
+f
+1989-03-10
+DROP TABLE t1;
+CREATE TABLE t1 (d DATE) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('1900-01-01');
+SELECT LENGTH( DATE_FORMAT( d, BINARY DATABASE() ) ) AS f FROM t1 GROUP BY d;
+f
+4
+DROP TABLE t1;
+#
+# MDEV-18667 ASAN heap-use-after-free in make_date_time / Arg_comparator::compare_string / Item_func_nullif::compare
+#
+SELECT NULLIF('foo', FROM_UNIXTIME('2012-12-12 12:12:12', TRIM(0)));
+NULLIF('foo', FROM_UNIXTIME('2012-12-12 12:12:12', TRIM(0)))
+foo
+Warnings:
+Warning 1292 Truncated incorrect DECIMAL value: '2012-12-12 12:12:12'
+#
+# MDEV-18626 ASAN stack-buffer-overflow in int10_to_str / make_date_time upon DATE_FORMAT
+#
+SELECT DATE_FORMAT(100000000000, '%j');
+DATE_FORMAT(100000000000, '%j')
+NULL
+#
# End of 10.1 tests
#
#
diff --git a/mysql-test/main/func_time.test b/mysql-test/main/func_time.test
index 630083ef97e..212df328130 100644
--- a/mysql-test/main/func_time.test
+++ b/mysql-test/main/func_time.test
@@ -1910,6 +1910,36 @@ SELECT * FROM t2;
SHOW CREATE TABLE t2;
DROP TABLE t1,t2;
+
+--echo #
+--echo # MDEV-14926 AddressSanitizer: heap-use-after-free in make_date_time on weird combination of functions
+--echo #
+
+DO INET_ATON( FROM_UNIXTIME( @@timestamp, ( TRIM( UNHEX(HEX('%m.%d.%Y') ) ) ) ) );
+
+CREATE TABLE t1 (d DATE);
+INSERT INTO t1 VALUES ('1989-03-10');
+SELECT TIME_FORMAT('23:59:43', BINARY d) AS f FROM t1 GROUP BY 'foo';
+DROP TABLE t1;
+
+CREATE TABLE t1 (d DATE) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('1900-01-01');
+SELECT LENGTH( DATE_FORMAT( d, BINARY DATABASE() ) ) AS f FROM t1 GROUP BY d;
+DROP TABLE t1;
+
+--echo #
+--echo # MDEV-18667 ASAN heap-use-after-free in make_date_time / Arg_comparator::compare_string / Item_func_nullif::compare
+--echo #
+
+SELECT NULLIF('foo', FROM_UNIXTIME('2012-12-12 12:12:12', TRIM(0)));
+
+--echo #
+--echo # MDEV-18626 ASAN stack-buffer-overflow in int10_to_str / make_date_time upon DATE_FORMAT
+--echo #
+
+SELECT DATE_FORMAT(100000000000, '%j');
+
+
--echo #
--echo # End of 10.1 tests
--echo #
diff --git a/mysql-test/main/kill_processlist-6619.test b/mysql-test/main/kill_processlist-6619.test
index d984924f9db..c272e68a877 100644
--- a/mysql-test/main/kill_processlist-6619.test
+++ b/mysql-test/main/kill_processlist-6619.test
@@ -6,6 +6,7 @@
--connect (con1,localhost,root,,)
--let $con_id = `SELECT CONNECTION_ID()`
+--replace_result Execute Query
--replace_column 1 # 3 # 6 # 7 #
SHOW PROCESSLIST;
SET DEBUG_SYNC='before_execute_sql_command SIGNAL ready WAIT_FOR go';
@@ -29,5 +30,6 @@ let $wait_condition=
WHERE info is NULL;
--source include/wait_condition.inc
+--replace_result Execute Query
--replace_column 1 # 3 # 6 # 7 #
SHOW PROCESSLIST;
diff --git a/mysql-test/main/log_slow_debug.result b/mysql-test/main/log_slow_debug.result
new file mode 100644
index 00000000000..7265346b36c
--- /dev/null
+++ b/mysql-test/main/log_slow_debug.result
@@ -0,0 +1,142 @@
+SET @org_slow_query_log= @@global.slow_query_log;
+SET @org_log_output= @@global.log_output;
+SET @org_log_slow_admin_statements= @@global.log_slow_admin_statements;
+SET @@GLOBAL.slow_query_log=OFF;
+SET @@GLOBAL.log_output='TABLE';
+FLUSH SLOW LOGS;
+SET @@GLOBAL.slow_query_log=ON;
+SET @@GLOBAL.log_slow_admin_statements=ON;
+SET SESSION debug_dbug="+d,simulate_slow_query";
+CREATE PROCEDURE show_slow_log()
+BEGIN
+SELECT CONCAT('[slow] ', sql_text) AS sql_text
+FROM mysql.slow_log
+WHERE sql_text NOT LIKE '%debug_dbug%';
+END
+$$
+#
+# Expect all admin statements in the slow log (ON,DEFAULT)
+#
+SET @@GLOBAL.log_slow_admin_statements=ON;
+SET log_slow_filter=DEFAULT;
+TRUNCATE TABLE mysql.slow_log;
+CREATE TABLE t1 (a INT);
+CREATE INDEX t1a ON t1 (a);
+DROP INDEX t1a ON t1;
+DROP TABLE t1;
+CREATE TABLE t2 (a INT);
+ALTER TABLE t2 RENAME t2;
+RENAME TABLE t2 TO t3;
+DROP TABLE t3;
+CREATE TABLE t4 (a INT);
+PREPARE stmt FROM 'ALTER TABLE t4 MODIFY a INT DEFAULT 1';
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+DROP TABLE t4;
+CALL show_slow_log();
+sql_text
+[slow] TRUNCATE TABLE mysql.slow_log
+[slow] CREATE TABLE t1 (a INT)
+[slow] CREATE INDEX t1a ON t1 (a)
+[slow] DROP INDEX t1a ON t1
+[slow] DROP TABLE t1
+[slow] CREATE TABLE t2 (a INT)
+[slow] ALTER TABLE t2 RENAME t2
+[slow] RENAME TABLE t2 TO t3
+[slow] DROP TABLE t3
+[slow] CREATE TABLE t4 (a INT)
+[slow] PREPARE stmt FROM 'ALTER TABLE t4 MODIFY a INT DEFAULT 1'
+[slow] ALTER TABLE t4 MODIFY a INT DEFAULT 1
+[slow] DEALLOCATE PREPARE stmt
+[slow] DROP TABLE t4
+#
+# Expect all admin statements in the slow log (ON,admin)
+#
+SET @@GLOBAL.log_slow_admin_statements=ON;
+SET log_slow_filter=admin;
+TRUNCATE TABLE mysql.slow_log;
+CREATE TABLE t1 (a INT);
+CREATE INDEX t1a ON t1 (a);
+DROP INDEX t1a ON t1;
+DROP TABLE t1;
+CREATE TABLE t2 (a INT);
+ALTER TABLE t2 RENAME t2;
+RENAME TABLE t2 TO t3;
+DROP TABLE t3;
+CREATE TABLE t4 (a INT);
+PREPARE stmt FROM 'ALTER TABLE t4 MODIFY a INT DEFAULT 1';
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+DROP TABLE t4;
+CALL show_slow_log();
+sql_text
+[slow] CREATE INDEX t1a ON t1 (a)
+[slow] DROP INDEX t1a ON t1
+[slow] ALTER TABLE t2 RENAME t2
+[slow] RENAME TABLE t2 TO t3
+[slow] ALTER TABLE t4 MODIFY a INT DEFAULT 1
+#
+# Expect none of admin DDL statements in the slow log (ON,filesort)
+#
+SET @@GLOBAL.log_slow_admin_statements=ON;
+SET log_slow_filter=filesort;
+TRUNCATE TABLE mysql.slow_log;
+CREATE TABLE t1 (a INT);
+CREATE INDEX t1a ON t1 (a);
+DROP INDEX t1a ON t1;
+DROP TABLE t1;
+CREATE TABLE t2 (a INT);
+ALTER TABLE t2 RENAME t2;
+RENAME TABLE t2 TO t3;
+DROP TABLE t3;
+CREATE TABLE t4 (a INT);
+PREPARE stmt FROM 'ALTER TABLE t4 MODIFY a INT DEFAULT 1';
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+DROP TABLE t4;
+CALL show_slow_log();
+sql_text
+#
+# Expect none of admin statements in the slow log (OFF,DEFAULT)
+#
+SET @@GLOBAL.log_slow_admin_statements=OFF;
+SET log_slow_filter=DEFAULT;
+TRUNCATE TABLE mysql.slow_log;
+CREATE TABLE t1 (a INT);
+CREATE INDEX t1a ON t1 (a);
+DROP INDEX t1a ON t1;
+DROP TABLE t1;
+CREATE TABLE t2 (a INT);
+ALTER TABLE t2 RENAME t2;
+RENAME TABLE t2 TO t3;
+DROP TABLE t3;
+CREATE TABLE t4 (a INT);
+PREPARE stmt FROM 'ALTER TABLE t4 MODIFY a INT DEFAULT 1';
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+DROP TABLE t4;
+CALL show_slow_log();
+sql_text
+[slow] TRUNCATE TABLE mysql.slow_log
+[slow] CREATE TABLE t1 (a INT)
+[slow] CREATE INDEX t1a ON t1 (a)
+[slow] DROP INDEX t1a ON t1
+[slow] DROP TABLE t1
+[slow] CREATE TABLE t2 (a INT)
+[slow] ALTER TABLE t2 RENAME t2
+[slow] RENAME TABLE t2 TO t3
+[slow] DROP TABLE t3
+[slow] CREATE TABLE t4 (a INT)
+[slow] PREPARE stmt FROM 'ALTER TABLE t4 MODIFY a INT DEFAULT 1'
+[slow] ALTER TABLE t4 MODIFY a INT DEFAULT 1
+[slow] DEALLOCATE PREPARE stmt
+[slow] DROP TABLE t4
+#
+# Clean up
+#
+SET SESSION debug_dbug="-d,simulate_slow_query";
+TRUNCATE mysql.slow_log;
+SET @@global.slow_query_log= @org_slow_query_log;
+SET @@global.log_output= @org_log_output;
+SET @@global.log_slow_admin_statements= @org_log_slow_admin_statements;
+DROP PROCEDURE show_slow_log;
diff --git a/mysql-test/main/log_slow_debug.test b/mysql-test/main/log_slow_debug.test
new file mode 100644
index 00000000000..35b5b93423d
--- /dev/null
+++ b/mysql-test/main/log_slow_debug.test
@@ -0,0 +1,126 @@
+-- source include/have_debug.inc
+
+SET @org_slow_query_log= @@global.slow_query_log;
+SET @org_log_output= @@global.log_output;
+SET @org_log_slow_admin_statements= @@global.log_slow_admin_statements;
+
+SET @@GLOBAL.slow_query_log=OFF;
+SET @@GLOBAL.log_output='TABLE';
+FLUSH SLOW LOGS;
+SET @@GLOBAL.slow_query_log=ON;
+SET @@GLOBAL.log_slow_admin_statements=ON;
+SET SESSION debug_dbug="+d,simulate_slow_query";
+
+DELIMITER $$;
+CREATE PROCEDURE show_slow_log()
+BEGIN
+ SELECT CONCAT('[slow] ', sql_text) AS sql_text
+ FROM mysql.slow_log
+ WHERE sql_text NOT LIKE '%debug_dbug%';
+END
+$$
+DELIMITER ;$$
+
+
+--echo #
+--echo # Expect all admin statements in the slow log (ON,DEFAULT)
+--echo #
+
+SET @@GLOBAL.log_slow_admin_statements=ON;
+SET log_slow_filter=DEFAULT;
+TRUNCATE TABLE mysql.slow_log;
+CREATE TABLE t1 (a INT);
+CREATE INDEX t1a ON t1 (a);
+DROP INDEX t1a ON t1;
+DROP TABLE t1;
+CREATE TABLE t2 (a INT);
+ALTER TABLE t2 RENAME t2;
+RENAME TABLE t2 TO t3;
+DROP TABLE t3;
+CREATE TABLE t4 (a INT);
+PREPARE stmt FROM 'ALTER TABLE t4 MODIFY a INT DEFAULT 1';
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+DROP TABLE t4;
+CALL show_slow_log();
+
+
+--echo #
+--echo # Expect all admin statements in the slow log (ON,admin)
+--echo #
+
+SET @@GLOBAL.log_slow_admin_statements=ON;
+SET log_slow_filter=admin;
+TRUNCATE TABLE mysql.slow_log;
+CREATE TABLE t1 (a INT);
+CREATE INDEX t1a ON t1 (a);
+DROP INDEX t1a ON t1;
+DROP TABLE t1;
+CREATE TABLE t2 (a INT);
+ALTER TABLE t2 RENAME t2;
+RENAME TABLE t2 TO t3;
+DROP TABLE t3;
+CREATE TABLE t4 (a INT);
+PREPARE stmt FROM 'ALTER TABLE t4 MODIFY a INT DEFAULT 1';
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+DROP TABLE t4;
+CALL show_slow_log();
+
+
+--echo #
+--echo # Expect none of admin DDL statements in the slow log (ON,filesort)
+--echo #
+
+SET @@GLOBAL.log_slow_admin_statements=ON;
+SET log_slow_filter=filesort;
+TRUNCATE TABLE mysql.slow_log;
+CREATE TABLE t1 (a INT);
+CREATE INDEX t1a ON t1 (a);
+DROP INDEX t1a ON t1;
+DROP TABLE t1;
+CREATE TABLE t2 (a INT);
+ALTER TABLE t2 RENAME t2;
+RENAME TABLE t2 TO t3;
+DROP TABLE t3;
+CREATE TABLE t4 (a INT);
+PREPARE stmt FROM 'ALTER TABLE t4 MODIFY a INT DEFAULT 1';
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+DROP TABLE t4;
+CALL show_slow_log();
+
+
+--echo #
+--echo # Expect none of admin statements in the slow log (OFF,DEFAULT)
+--echo #
+
+SET @@GLOBAL.log_slow_admin_statements=OFF;
+SET log_slow_filter=DEFAULT;
+TRUNCATE TABLE mysql.slow_log;
+CREATE TABLE t1 (a INT);
+CREATE INDEX t1a ON t1 (a);
+DROP INDEX t1a ON t1;
+DROP TABLE t1;
+CREATE TABLE t2 (a INT);
+ALTER TABLE t2 RENAME t2;
+RENAME TABLE t2 TO t3;
+DROP TABLE t3;
+CREATE TABLE t4 (a INT);
+PREPARE stmt FROM 'ALTER TABLE t4 MODIFY a INT DEFAULT 1';
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+DROP TABLE t4;
+CALL show_slow_log();
+
+
+--echo #
+--echo # Clean up
+--echo #
+
+SET SESSION debug_dbug="-d,simulate_slow_query";
+TRUNCATE mysql.slow_log;
+SET @@global.slow_query_log= @org_slow_query_log;
+SET @@global.log_output= @org_log_output;
+SET @@global.log_slow_admin_statements= @org_log_slow_admin_statements;
+DROP PROCEDURE show_slow_log;
diff --git a/mysql-test/main/log_tables.test b/mysql-test/main/log_tables.test
index a4158ba6a24..f822ec8d758 100644
--- a/mysql-test/main/log_tables.test
+++ b/mysql-test/main/log_tables.test
@@ -855,7 +855,9 @@ SET GLOBAL slow_query_log = @old_slow_query_log;
#
select CONNECTION_ID() into @thread_id;
+--disable_ps_protocol
truncate table mysql.general_log;
+--enable_ps_protocol
set global general_log = on;
--disable_result_log
set @lparam = "000 001 002 003 004 005 006 007 008 009"
diff --git a/mysql-test/main/old-mode.test b/mysql-test/main/old-mode.test
index 7ec2092009b..a09de1cf87d 100644
--- a/mysql-test/main/old-mode.test
+++ b/mysql-test/main/old-mode.test
@@ -22,7 +22,8 @@ drop table t1,t2;
--replace_column 1 <Id> 3 <Host> 6 <Time> 7 <State>
# Embedded server is hardcoded to show "Writing to net" as STATE.
---replace_result "Writing to net" "NULL"
+# ps-protocol will have Execute not Query
+--replace_result "Writing to net" "NULL" "Execute" "Query"
--replace_regex /localhost[:0-9]*/localhost/
SHOW PROCESSLIST;
diff --git a/mysql-test/main/partition.result b/mysql-test/main/partition.result
index 10480dc0698..89dd6e40db1 100644
--- a/mysql-test/main/partition.result
+++ b/mysql-test/main/partition.result
@@ -1323,7 +1323,7 @@ partition p2 values in (1));
end//
call p()//
drop procedure p//
-drop table t1;
+drop table t1//
create procedure p ()
begin
create table t1 (a int not null,b int not null,c int not null,primary key (a,b))
diff --git a/mysql-test/main/partition.test b/mysql-test/main/partition.test
index 42929796f6b..89db3e92162 100644
--- a/mysql-test/main/partition.test
+++ b/mysql-test/main/partition.test
@@ -1198,7 +1198,7 @@ end//
call p()//
drop procedure p//
-drop table t1;
+drop table t1//
create procedure p ()
begin
diff --git a/mysql-test/main/profiling.test b/mysql-test/main/profiling.test
index 1e1aada7c15..912e4f69798 100644
--- a/mysql-test/main/profiling.test
+++ b/mysql-test/main/profiling.test
@@ -60,6 +60,7 @@ select '012345678900123456789001234567890012345678900123456789001234567890012345
--replace_column 2 #
show profiles;
+--disable_ps_protocol
--disable_result_log
###--replace_column 2 # 3 # 4 #
show profile for query 15;
@@ -90,6 +91,7 @@ show profile all for query 0 limit 0;
###--replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 11 # 12 # 13 # 16 #
show profile all for query 15;
###--replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 11 # 12 # 13 # 16 #
+--enable_ps_protocol
select * from information_schema.profiling;
select query_id, state, duration from information_schema.profiling;
diff --git a/mysql-test/main/show_check.test b/mysql-test/main/show_check.test
index b6885b1fcaf..1b43a510e84 100644
--- a/mysql-test/main/show_check.test
+++ b/mysql-test/main/show_check.test
@@ -47,7 +47,9 @@ insert into t1 values (5,5,5);
check table t1 changed;
check table t1 medium;
check table t1 extended;
+--disable_ps_protocol
show index from t1;
+--enable_ps_protocol
--disable_metadata
--error ER_DUP_ENTRY
insert into t1 values (5,5,5);
@@ -72,7 +74,9 @@ drop table t1;
show variables like "wait_timeout%";
show variables like "WAIT_timeout%";
show variables like "this_doesn't_exists%";
+--disable_ps_protocol
show table status from test like "this_doesn't_exists%";
+--enable_ps_protocol
show databases;
show databases like "test%";
--disable_metadata
@@ -409,7 +413,9 @@ CREATE TABLE t1(
PRIMARY KEY(field1(1000))
);
--enable_metadata
+--disable_ps_protocol
show index from t1;
+--enable_ps_protocol
--disable_metadata
drop table t1;
@@ -707,11 +713,15 @@ set names utf8;
--echo ----------------------------------------------------------------
+--disable_ps_protocol
SHOW CHARACTER SET LIKE 'utf8';
+--enable_ps_protocol
--echo ----------------------------------------------------------------
+--disable_ps_protocol
SHOW COLLATION LIKE 'latin1_bin';
+--enable_ps_protocol
--echo ----------------------------------------------------------------
@@ -727,7 +737,9 @@ SHOW CREATE TABLE t1;
--echo ----------------------------------------------------------------
+--disable_ps_protocol
SHOW INDEX FROM t1;
+--enable_ps_protocol
--echo ----------------------------------------------------------------
@@ -774,8 +786,10 @@ SHOW COLUMNS FROM t1;
--echo ----------------------------------------------------------------
+--disable_ps_protocol
--replace_column 6 #
SHOW TRIGGERS LIKE 't1';
+--enable_ps_protocol
--echo ----------------------------------------------------------------
@@ -1364,9 +1378,11 @@ let $wait_timeout= 10;
let $wait_condition= SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST WHERE INFO LIKE '%GET_LOCK%' AND ID != CONNECTION_ID();
--source include/wait_condition.inc
--replace_column 1 ### 3 ### 6 ### 7 ###
+--replace_result "Execute" "Query"
SHOW PROCESSLIST;
SET NAMES utf8;
--replace_column 1 ### 3 ### 6 ### 7 ###
+--replace_result "Execute" "Query"
SHOW PROCESSLIST;
SELECT RELEASE_LOCK('t');
--connection con1
diff --git a/mysql-test/main/show_explain_ps.result b/mysql-test/main/show_explain_ps.result
index fae432e830e..69ee2cab31d 100644
--- a/mysql-test/main/show_explain_ps.result
+++ b/mysql-test/main/show_explain_ps.result
@@ -31,12 +31,11 @@ count(*)
set debug_dbug='';
select event_name
from
-performance_schema.events_stages_history_long
+performance_schema.events_stages_history_long join
+performance_schema.threads using (thread_id)
where
event_name like '%show explain' and
-thread_id in(select thread_id
-from performance_schema.events_statements_history_long
-where EVENT_NAME='statement/sql/show_explain');
+processlist_id=$thr1;
event_name
stage/sql/Show explain
drop table t0;
diff --git a/mysql-test/main/show_explain_ps.test b/mysql-test/main/show_explain_ps.test
index b43cd559e09..13cd1538143 100644
--- a/mysql-test/main/show_explain_ps.test
+++ b/mysql-test/main/show_explain_ps.test
@@ -49,12 +49,12 @@ reap;
set debug_dbug='';
-select event_name
-from
-performance_schema.events_stages_history_long
-where
- event_name like '%show explain' and
- thread_id in(select thread_id
- from performance_schema.events_statements_history_long
- where EVENT_NAME='statement/sql/show_explain');
+evalp select event_name
+ from
+ performance_schema.events_stages_history_long join
+ performance_schema.threads using (thread_id)
+ where
+ event_name like '%show explain' and
+ processlist_id=$thr1;
+
drop table t0;
diff --git a/mysql-test/main/sp-ucs2.result b/mysql-test/main/sp-ucs2.result
index b8cc5dfd73d..ca448efa535 100644
--- a/mysql-test/main/sp-ucs2.result
+++ b/mysql-test/main/sp-ucs2.result
@@ -32,61 +32,55 @@ RETURNS VARCHAR(64) UNICODE BINARY
BEGIN
RETURN '';
END|
-SHOW CREATE FUNCTION f;
-DROP FUNCTION f;
+SHOW CREATE FUNCTION f|
+Function sql_mode Create Function character_set_client collation_connection Database Collation
+f STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET ucs2 COLLATE ucs2_bin
+BEGIN
+RETURN '';
+END latin1 latin1_swedish_ci latin1_swedish_ci
+DROP FUNCTION f|
CREATE FUNCTION f()
RETURNS VARCHAR(64) BINARY UNICODE
BEGIN
RETURN '';
END|
+SHOW CREATE FUNCTION f|
Function sql_mode Create Function character_set_client collation_connection Database Collation
f STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET ucs2 COLLATE ucs2_bin
BEGIN
RETURN '';
END latin1 latin1_swedish_ci latin1_swedish_ci
-SHOW CREATE FUNCTION f;
-DROP FUNCTION f;
-#
-# Testing keywords ASCII + BINARY
-#
+DROP FUNCTION f|
CREATE FUNCTION f()
RETURNS VARCHAR(64) ASCII BINARY
BEGIN
RETURN '';
END|
+SHOW CREATE FUNCTION f|
Function sql_mode Create Function character_set_client collation_connection Database Collation
-f STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET ucs2 COLLATE ucs2_bin
+f STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET latin1 COLLATE latin1_bin
BEGIN
RETURN '';
END latin1 latin1_swedish_ci latin1_swedish_ci
-SHOW CREATE FUNCTION f;
-DROP FUNCTION f;
+DROP FUNCTION f|
CREATE FUNCTION f()
RETURNS VARCHAR(64) BINARY ASCII
BEGIN
RETURN '';
END|
+SHOW CREATE FUNCTION f|
Function sql_mode Create Function character_set_client collation_connection Database Collation
f STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET latin1 COLLATE latin1_bin
BEGIN
RETURN '';
END latin1 latin1_swedish_ci latin1_swedish_ci
-SHOW CREATE FUNCTION f;
-DROP FUNCTION f;
-#
-# Testing COLLATE in OUT parameter
-#
+DROP FUNCTION f|
CREATE PROCEDURE p1(IN f1 VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_czech_ci,
OUT f2 VARCHAR(64) CHARACTER SET ucs2 COLLATE ucs2_polish_ci)
BEGIN
SET f2= f1;
SET f2= concat(collation(f1), ' ', collation(f2));
END|
-Function sql_mode Create Function character_set_client collation_connection Database Collation
-f STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `f`() RETURNS varchar(64) CHARSET latin1 COLLATE latin1_bin
-BEGIN
-RETURN '';
-END latin1 latin1_swedish_ci latin1_swedish_ci
CREATE FUNCTION f1()
RETURNS VARCHAR(64) CHARACTER SET ucs2
BEGIN
diff --git a/mysql-test/main/sp-ucs2.test b/mysql-test/main/sp-ucs2.test
index 3532169e5a1..a1aec8071b4 100644
--- a/mysql-test/main/sp-ucs2.test
+++ b/mysql-test/main/sp-ucs2.test
@@ -52,16 +52,16 @@ CREATE FUNCTION f()
BEGIN
RETURN '';
END|
-SHOW CREATE FUNCTION f;
-DROP FUNCTION f;
+SHOW CREATE FUNCTION f|
+DROP FUNCTION f|
CREATE FUNCTION f()
RETURNS VARCHAR(64) BINARY UNICODE
BEGIN
RETURN '';
END|
-SHOW CREATE FUNCTION f;
-DROP FUNCTION f;
+SHOW CREATE FUNCTION f|
+DROP FUNCTION f|
#
@@ -72,16 +72,16 @@ CREATE FUNCTION f()
BEGIN
RETURN '';
END|
-SHOW CREATE FUNCTION f;
-DROP FUNCTION f;
+SHOW CREATE FUNCTION f|
+DROP FUNCTION f|
CREATE FUNCTION f()
RETURNS VARCHAR(64) BINARY ASCII
BEGIN
RETURN '';
END|
-SHOW CREATE FUNCTION f;
-DROP FUNCTION f;
+SHOW CREATE FUNCTION f|
+DROP FUNCTION f|
#
# Testing COLLATE in OUT parameter
diff --git a/mysql-test/main/sp.result b/mysql-test/main/sp.result
index 62663c7e91b..b54f97e6258 100644
--- a/mysql-test/main/sp.result
+++ b/mysql-test/main/sp.result
@@ -6777,7 +6777,7 @@ ERROR 42S02: Table 'test.t1' doesn't exist
create table t1 (a integer)$
call p1$
a
-alter table t1 add b integer;
+alter table t1 add b integer$
call p1$
a
drop table t1;
diff --git a/mysql-test/main/sp.test b/mysql-test/main/sp.test
index 1000f172931..d2c27873026 100644
--- a/mysql-test/main/sp.test
+++ b/mysql-test/main/sp.test
@@ -8041,7 +8041,7 @@ create procedure p1() begin select * from t1; end$
call p1$
create table t1 (a integer)$
call p1$
-alter table t1 add b integer;
+alter table t1 add b integer$
call p1$
delimiter ;$
diff --git a/mysql-test/main/sp_notembedded.result b/mysql-test/main/sp_notembedded.result
index 3883225e9bc..23461867500 100644
--- a/mysql-test/main/sp_notembedded.result
+++ b/mysql-test/main/sp_notembedded.result
@@ -74,7 +74,7 @@ select res;
end|
create table t3 (a int)|
insert into t3 values (0)|
-create view v1 as select a from t3;
+create view v1 as select a from t3|
create procedure bug10100pt(level int, lim int)
begin
if level < lim then
diff --git a/mysql-test/main/sp_notembedded.test b/mysql-test/main/sp_notembedded.test
index 2f1c4cd92f5..29901c1221b 100644
--- a/mysql-test/main/sp_notembedded.test
+++ b/mysql-test/main/sp_notembedded.test
@@ -118,7 +118,7 @@ end|
# a procedure which use tables and recursion
create table t3 (a int)|
insert into t3 values (0)|
-create view v1 as select a from t3;
+create view v1 as select a from t3|
create procedure bug10100pt(level int, lim int)
begin
if level < lim then
diff --git a/mysql-test/main/sp_trans.result b/mysql-test/main/sp_trans.result
index dad1aa7c0ff..cee2a7e5188 100644
--- a/mysql-test/main/sp_trans.result
+++ b/mysql-test/main/sp_trans.result
@@ -642,7 +642,7 @@ TRUNCATE TABLE t1;
END|
LOCK TABLES t1 WRITE|
CALL p1()|
-FLUSH TABLES;
+FLUSH TABLES|
UNLOCK TABLES|
CALL p1()|
DROP PROCEDURE p1|
diff --git a/mysql-test/main/sp_trans.test b/mysql-test/main/sp_trans.test
index a9759b99269..7d6faba9789 100644
--- a/mysql-test/main/sp_trans.test
+++ b/mysql-test/main/sp_trans.test
@@ -689,7 +689,7 @@ END|
LOCK TABLES t1 WRITE|
CALL p1()|
-FLUSH TABLES;
+FLUSH TABLES|
UNLOCK TABLES|
CALL p1()|
diff --git a/mysql-test/main/subselect_sj_mat.test b/mysql-test/main/subselect_sj_mat.test
index 2cffa2e82b8..ac0baee3728 100644
--- a/mysql-test/main/subselect_sj_mat.test
+++ b/mysql-test/main/subselect_sj_mat.test
@@ -1579,7 +1579,9 @@ INSERT INTO t2 values(1),(2);
EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT * FROM t2 GROUP BY a HAVING a > 1);
flush status;
CREATE TABLE t3 SELECT * FROM t1 WHERE a IN (SELECT * FROM t2 GROUP BY a HAVING a > 1);
+--disable_ps_protocol
SHOW STATUS LIKE 'Created_tmp_tables';
+--enable_ps_protocol
DROP TABLE t1,t2,t3;
--echo #
diff --git a/mysql-test/main/temp_table.test b/mysql-test/main/temp_table.test
index a528e27b890..a1e61b31a82 100644
--- a/mysql-test/main/temp_table.test
+++ b/mysql-test/main/temp_table.test
@@ -115,8 +115,10 @@ CREATE TABLE t1 (
INSERT INTO t1 VALUES ('2002-10-24 14:50:32'),('2002-10-24 14:50:33'),('2002-10-24 14:50:34'),('2002-10-24 14:50:34'),('2002-10-24 14:50:34'),('2002-10-24 14:50:35'),('2002-10-24 14:50:35'),('2002-10-24 14:50:35'),('2002-10-24 14:50:35'),('2002-10-24 14:50:36'),('2002-10-24 14:50:36'),('2002-10-24 14:50:36'),('2002-10-24 14:50:36'),('2002-10-24 14:50:37'),('2002-10-24 14:50:37'),('2002-10-24 14:50:37'),('2002-10-24 14:50:37'),('2002-10-24 14:50:38'),('2002-10-24 14:50:38'),('2002-10-24 14:50:38'),('2002-10-24 14:50:39'),('2002-10-24 14:50:39'),('2002-10-24 14:50:39'),('2002-10-24 14:50:39'),('2002-10-24 14:50:40'),('2002-10-24 14:50:40'),('2002-10-24 14:50:40');
flush status;
+--disable_ps_protocol
select * from t1 group by d;
show status like "created_tmp%tables";
+--enable_ps_protocol
drop table t1;
# Fix for BUG#8921: Check that temporary table is ingored by view commands.
diff --git a/mysql-test/main/tmp_table_count-7586.test b/mysql-test/main/tmp_table_count-7586.test
index e7bac127815..8bfb0e7c5cf 100644
--- a/mysql-test/main/tmp_table_count-7586.test
+++ b/mysql-test/main/tmp_table_count-7586.test
@@ -9,12 +9,16 @@ create view v2 as select a from t2;
flush status;
select * from v2;
+--disable_ps_protocol
show status like '%Created_tmp%';
+--enable_ps_protocol
explain select * from v2;
select * from (select * from t2) T1;
+--disable_ps_protocol
show status like '%Created_tmp%';
+--enable_ps_protocol
explain select * from (select * from t2) T1;
diff --git a/mysql-test/main/type_year.result b/mysql-test/main/type_year.result
index 3f589f38267..71285418588 100644
--- a/mysql-test/main/type_year.result
+++ b/mysql-test/main/type_year.result
@@ -444,6 +444,15 @@ Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where `test`.`t1`.`a` = 2010
DROP TABLE t1;
#
+# MDEV-16958 Assertion `field_length < 5' failed in Field_year::val_str or data corruption upon SELECT with UNION and aggregate functions
+#
+CREATE TABLE t1 (f YEAR);
+INSERT IGNORE INTO t1 VALUES (1971),(1972);
+SELECT MAX( NULLIF( f, '1900' ) ) AS f FROM t1 UNION SELECT MAX( NULLIF( f, '1900' ) ) AS f FROM t1;
+f
+1972
+DROP TABLE t1;
+#
# End of 10.1 tests
#
#
diff --git a/mysql-test/main/type_year.test b/mysql-test/main/type_year.test
index ea7514898cd..3c578b3ab59 100644
--- a/mysql-test/main/type_year.test
+++ b/mysql-test/main/type_year.test
@@ -214,6 +214,17 @@ SELECT * FROM t1 WHERE a=10 AND a>=10;
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a=10 AND a>=10;
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-16958 Assertion `field_length < 5' failed in Field_year::val_str or data corruption upon SELECT with UNION and aggregate functions
+--echo #
+
+CREATE TABLE t1 (f YEAR);
+INSERT IGNORE INTO t1 VALUES (1971),(1972);
+SELECT MAX( NULLIF( f, '1900' ) ) AS f FROM t1 UNION SELECT MAX( NULLIF( f, '1900' ) ) AS f FROM t1;
+DROP TABLE t1;
+
+
--echo #
--echo # End of 10.1 tests
--echo #
diff --git a/mysql-test/main/update.result b/mysql-test/main/update.result
index ab6596e8bf1..f5edf1c6be3 100644
--- a/mysql-test/main/update.result
+++ b/mysql-test/main/update.result
@@ -721,3 +721,16 @@ Handler_read_rnd_deleted 0
Handler_read_rnd_next 0
drop table t1, t2;
# End of MariaDB 10.0 tests
+#
+# MDEV-18945: multi-table update with constant table and
+# comparison of date field with integer field
+#
+CREATE TABLE t1 (i1 int, d1 date , i2 int , d2 date) engine=myisam;
+INSERT INTO t1 VALUES (19,'0000-00-00',73,'2008-05-21');
+CREATE TABLE t2 (d1 date , i1 int, i2 int , d2 date) engine=myisam;
+INSERT INTO t2 VALUES
+('2006-01-12',-102,45,'2023-11-25'),('2034-12-19',-102,45,'2001-11-20');
+UPDATE t1,t2 SET t1.i1 = -39 WHERE t2.d1 <> t1.i1 AND t2.d1 = t1.d2;
+ERROR 22007: Incorrect datetime value: '19' for column `test`.`t1`.`i1` at row 1
+DROP TABLE t1,t2;
+# End of MariaDB 10.2 tests
diff --git a/mysql-test/main/update.test b/mysql-test/main/update.test
index e5ef0b11127..84709102f96 100644
--- a/mysql-test/main/update.test
+++ b/mysql-test/main/update.test
@@ -654,3 +654,22 @@ show status like 'Handler_read%';
drop table t1, t2;
--echo # End of MariaDB 10.0 tests
+
+--echo #
+--echo # MDEV-18945: multi-table update with constant table and
+--echo # comparison of date field with integer field
+--echo #
+
+CREATE TABLE t1 (i1 int, d1 date , i2 int , d2 date) engine=myisam;
+INSERT INTO t1 VALUES (19,'0000-00-00',73,'2008-05-21');
+
+CREATE TABLE t2 (d1 date , i1 int, i2 int , d2 date) engine=myisam;
+INSERT INTO t2 VALUES
+ ('2006-01-12',-102,45,'2023-11-25'),('2034-12-19',-102,45,'2001-11-20');
+
+--error ER_TRUNCATED_WRONG_VALUE
+UPDATE t1,t2 SET t1.i1 = -39 WHERE t2.d1 <> t1.i1 AND t2.d1 = t1.d2;
+
+DROP TABLE t1,t2;
+
+--echo # End of MariaDB 10.2 tests
diff --git a/mysql-test/main/userstat.result b/mysql-test/main/userstat.result
index 0067149691a..6ba3d0b7811 100644
--- a/mysql-test/main/userstat.result
+++ b/mysql-test/main/userstat.result
@@ -148,7 +148,7 @@ show table_statistics;
Table_schema Table_name Rows_read Rows_changed Rows_changed_x_#indexes
show index_statistics;
Table_schema Table_name Index_name Rows_read
-select TOTAL_CONNECTIONS, TOTAL_SSL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, OTHER_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.client_statistics;;
+select TOTAL_CONNECTIONS, TOTAL_SSL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.client_statistics;;
TOTAL_CONNECTIONS 2
TOTAL_SSL_CONNECTIONS 1
CONCURRENT_CONNECTIONS 0
@@ -159,14 +159,13 @@ ROWS_INSERTED 7
ROWS_UPDATED 5
SELECT_COMMANDS 4
UPDATE_COMMANDS 11
-OTHER_COMMANDS 7
COMMIT_TRANSACTIONS 19
ROLLBACK_TRANSACTIONS 2
DENIED_CONNECTIONS 0
LOST_CONNECTIONS 0
ACCESS_DENIED 0
EMPTY_QUERIES 1
-select TOTAL_CONNECTIONS, TOTAL_SSL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, OTHER_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.user_statistics;;
+select TOTAL_CONNECTIONS, TOTAL_SSL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.user_statistics;;
TOTAL_CONNECTIONS 2
TOTAL_SSL_CONNECTIONS 1
CONCURRENT_CONNECTIONS 0
@@ -177,13 +176,18 @@ ROWS_INSERTED 7
ROWS_UPDATED 5
SELECT_COMMANDS 4
UPDATE_COMMANDS 11
-OTHER_COMMANDS 7
COMMIT_TRANSACTIONS 19
ROLLBACK_TRANSACTIONS 2
DENIED_CONNECTIONS 0
LOST_CONNECTIONS 0
ACCESS_DENIED 0
EMPTY_QUERIES 1
+select OTHER_COMMANDS IN (7,8) from information_schema.client_statistics;
+OTHER_COMMANDS IN (7,8)
+1
+select OTHER_COMMANDS IN (7,8) from information_schema.user_statistics;
+OTHER_COMMANDS IN (7,8)
+1
flush table_statistics;
flush index_statistics;
select * from information_schema.index_statistics;
diff --git a/mysql-test/main/userstat.test b/mysql-test/main/userstat.test
index 9ce3a32c442..547138cfeaa 100644
--- a/mysql-test/main/userstat.test
+++ b/mysql-test/main/userstat.test
@@ -73,8 +73,11 @@ select * from information_schema.index_statistics;
select * from information_schema.table_statistics;
show table_statistics;
show index_statistics;
---query_vertical select TOTAL_CONNECTIONS, TOTAL_SSL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, OTHER_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.client_statistics;
---query_vertical select TOTAL_CONNECTIONS, TOTAL_SSL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, OTHER_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.user_statistics;
+--query_vertical select TOTAL_CONNECTIONS, TOTAL_SSL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.client_statistics;
+--query_vertical select TOTAL_CONNECTIONS, TOTAL_SSL_CONNECTIONS, CONCURRENT_CONNECTIONS, ROWS_READ, ROWS_SENT, ROWS_DELETED, ROWS_INSERTED, ROWS_UPDATED, SELECT_COMMANDS, UPDATE_COMMANDS, COMMIT_TRANSACTIONS, ROLLBACK_TRANSACTIONS, DENIED_CONNECTIONS, LOST_CONNECTIONS, ACCESS_DENIED, EMPTY_QUERIES from information_schema.user_statistics;
+# different values in --ps-protocol
+select OTHER_COMMANDS IN (7,8) from information_schema.client_statistics;
+select OTHER_COMMANDS IN (7,8) from information_schema.user_statistics;
flush table_statistics;
flush index_statistics;
select * from information_schema.index_statistics;
diff --git a/mysql-test/main/view.result b/mysql-test/main/view.result
index fccec1a5ef3..83ea0e38992 100644
--- a/mysql-test/main/view.result
+++ b/mysql-test/main/view.result
@@ -6706,6 +6706,20 @@ testcase
drop view v1;
drop table t1;
#
+# MDEV-18502: Server crash in find_field_in_tables upon 2nd execution of SP which causes ER_WRONG_GROUP_FIELD
+#
+CREATE TABLE t1 (id INT, f VARCHAR(1));
+CREATE VIEW v1 AS SELECT * FROM t1;
+INSERT INTO t1 VALUES (1,'a'),(2,'b');
+CREATE PROCEDURE sp() SELECT f AS f1, MAX(id) AS f2 FROM v1 GROUP BY f1, f2 ORDER BY f1;
+CALL sp;
+ERROR 42000: Can't group on 'f2'
+CALL sp;
+ERROR 42000: Can't group on 'f2'
+DROP PROCEDURE sp;
+DROP VIEW v1;
+DROP TABLE t1;
+#
# End of 10.2 tests
#
#
diff --git a/mysql-test/main/view.test b/mysql-test/main/view.test
index 94036273ce1..2b7b9d1f161 100644
--- a/mysql-test/main/view.test
+++ b/mysql-test/main/view.test
@@ -2054,7 +2054,9 @@ flush status;
create table t1(f1 char(1));
create view v1 as select * from t1;
select * from (select f1 as f2, f1 as f3 from v1) v where v.f2='a';
+--disable_ps_protocol
show status like "Created_tmp%";
+--enable_ps_protocol
drop view v1;
drop table t1;
@@ -2063,7 +2065,9 @@ set @@optimizer_switch='derived_merge=OFF';
create table t1(f1 char(1));
create view v1 as select * from t1;
select * from (select f1 as f2, f1 as f3 from v1) v where v.f2='a';
+--disable_ps_protocol
show status like "Created_tmp%";
+--enable_ps_protocol
drop view v1;
drop table t1;
set @@optimizer_switch=@tmp;
@@ -2369,6 +2373,7 @@ DROP TABLE t1;
# Bug#15943 mysql_next_result hangs on invalid SHOW CREATE VIEW
#
+--disable_ps_protocol
delimiter //;
drop table if exists t1;
drop view if exists v1;
@@ -2379,6 +2384,7 @@ show create view v1;
drop view v1;
//
delimiter ;//
+--enable_ps_protocol
#
@@ -3889,7 +3895,9 @@ CREATE VIEW v1 AS SELECT f1() FROM t1;
let $MYSQLD_DATADIR= `SELECT @@datadir`;
copy_file std_data/bug48449.frm $MYSQLD_DATADIR/test/v2.frm;
+enable_prepare_warnings;
SHOW CREATE VIEW v1;
+disable_prepare_warnings;
DROP VIEW v1,v2;
DROP TABLE t1,t2;
@@ -6400,6 +6408,22 @@ drop view v1;
drop table t1;
--echo #
+--echo # MDEV-18502: Server crash in find_field_in_tables upon 2nd execution of SP which causes ER_WRONG_GROUP_FIELD
+--echo #
+
+CREATE TABLE t1 (id INT, f VARCHAR(1));
+CREATE VIEW v1 AS SELECT * FROM t1;
+INSERT INTO t1 VALUES (1,'a'),(2,'b');
+CREATE PROCEDURE sp() SELECT f AS f1, MAX(id) AS f2 FROM v1 GROUP BY f1, f2 ORDER BY f1;
+--error ER_WRONG_GROUP_FIELD
+CALL sp;
+--error ER_WRONG_GROUP_FIELD
+CALL sp;
+DROP PROCEDURE sp;
+DROP VIEW v1;
+DROP TABLE t1;
+
+--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/main/win.result b/mysql-test/main/win.result
index 279404968bf..2cc342a0cab 100644
--- a/mysql-test/main/win.result
+++ b/mysql-test/main/win.result
@@ -3489,6 +3489,23 @@ ifnull(max(n1) over (partition by n1),'aaa')
drop table t1;
drop view v1;
#
+# MDEV-18431: Select max + row_number giving incorrect result
+#
+create table t1 (id int, v int);
+insert into t1 values (1, 1), (1,2), (1,3), (2, 1), (2, 2);
+select e.id,
+(select max(t1.v) from t1 where t1.id=e.id) as a,
+row_number() over (partition by e.id order by e.v) as b,
+(select max(t1.v) from t1 where t1.id=e.id) + (row_number() over (partition by e.id order by e.v)) as sum_a_b
+from t1 e;
+id a b sum_a_b
+1 3 1 4
+1 3 2 5
+1 3 3 6
+2 2 1 3
+2 2 2 4
+drop table t1;
+#
# End of 10.2 tests
#
#
diff --git a/mysql-test/main/win.test b/mysql-test/main/win.test
index 19e83ea8c41..1f27e4b9226 100644
--- a/mysql-test/main/win.test
+++ b/mysql-test/main/win.test
@@ -2242,6 +2242,20 @@ drop table t1;
drop view v1;
--echo #
+--echo # MDEV-18431: Select max + row_number giving incorrect result
+--echo #
+
+create table t1 (id int, v int);
+insert into t1 values (1, 1), (1,2), (1,3), (2, 1), (2, 2);
+
+select e.id,
+ (select max(t1.v) from t1 where t1.id=e.id) as a,
+ row_number() over (partition by e.id order by e.v) as b,
+ (select max(t1.v) from t1 where t1.id=e.id) + (row_number() over (partition by e.id order by e.v)) as sum_a_b
+from t1 e;
+drop table t1;
+
+--echo #
--echo # End of 10.2 tests
--echo #
diff --git a/mysql-test/suite/archive/rnd_pos.test b/mysql-test/suite/archive/rnd_pos.test
index 7a1d78ea003..8c7a0e16a79 100644
--- a/mysql-test/suite/archive/rnd_pos.test
+++ b/mysql-test/suite/archive/rnd_pos.test
@@ -13,7 +13,9 @@ explain partitions select c1,c3 from t1 order by c2;
flush status;
select c1,c3 from t1 order by c2;
set max_length_for_sort_data = default;
+--disable_ps_protocol
show status where variable_name like '%tmp%' and value != 0;
+--enable_ps_protocol
alter table t1 partition by hash (c1) partitions 3;
explain partitions select c1,c3 from t1 order by c2;
@@ -22,6 +24,8 @@ explain partitions select c1,c3 from t1 order by c2;
flush status;
select c1,c3 from t1 order by c2;
set max_length_for_sort_data = default;
+--disable_ps_protocol
show status where variable_name like '%tmp%' and value != 0;
+--enable_ps_protocol
drop table t1;
diff --git a/mysql-test/suite/funcs_1/datadict/processlist_priv.inc b/mysql-test/suite/funcs_1/datadict/processlist_priv.inc
index ae46dfd31c8..99a4340c571 100644
--- a/mysql-test/suite/funcs_1/datadict/processlist_priv.inc
+++ b/mysql-test/suite/funcs_1/datadict/processlist_priv.inc
@@ -156,6 +156,7 @@ WHERE DB = 'information_schema' AND COMMAND = 'Sleep' AND USER = 'ddicttestuser1
--source include/wait_condition.inc
--replace_result ENGINE=MyISAM "" ENGINE=Aria "" " PAGE_CHECKSUM=1" "" " PAGE_CHECKSUM=0" ""
eval SHOW CREATE TABLE $table;
+--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
eval SHOW $table;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
@@ -176,6 +177,7 @@ connection con100;
# but "ddicttestuser1" must not see anything of the root session.
--replace_result ENGINE=MyISAM "" ENGINE=Aria "" " PAGE_CHECKSUM=1" "" " PAGE_CHECKSUM=0" ""
eval SHOW CREATE TABLE $table;
+--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
eval SHOW $table;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
@@ -202,6 +204,7 @@ GRANT PROCESS ON *.* TO ddicttestuser1@'localhost' IDENTIFIED BY 'ddictpass';
--echo ####################################################################################
connection con100;
SHOW GRANTS;
+--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
@@ -214,6 +217,7 @@ SELECT * FROM information_schema.processlist;
--echo ####################################################################################
connect (con101,localhost,ddicttestuser1,ddictpass,information_schema);
SHOW GRANTS;
+--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
@@ -237,6 +241,7 @@ GRANT PROCESS ON *.* TO ''@'localhost';
--echo ####################################################################################
connect (anonymous1,localhost,"''",,information_schema);
SHOW GRANTS;
+--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
@@ -259,6 +264,7 @@ connect (con102,localhost,ddicttestuser1,ddictpass,information_schema);
--echo ddicttestuser1 are visible.
--echo ####################################################################################
SHOW GRANTS;
+--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
@@ -284,6 +290,7 @@ SHOW GRANTS FOR ''@'localhost';
if ($fixed_bug_30395)
{
# Bug#30395 strange results after REVOKE PROCESS ON *.* FROM ...
+--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
}
@@ -306,6 +313,7 @@ connect (con103,localhost,ddicttestuser1,ddictpass,information_schema);
--echo Only the processes of ddicttestuser1 user are visible.
--echo ####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
+--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
@@ -328,6 +336,7 @@ connect (con104,localhost,ddicttestuser1,ddictpass,information_schema);
--echo Only the processes of ddicttestuser1 are visible.
--echo ####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
+--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
@@ -375,6 +384,7 @@ connect (con200,localhost,ddicttestuser2,ddictpass,information_schema);
--echo ddicttestuser2 has now the PROCESS privilege and sees all connections
--echo ####################################################################################
SHOW GRANTS FOR 'ddicttestuser2'@'localhost';
+--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
@@ -396,6 +406,7 @@ connect (con201,localhost,ddicttestuser2,ddictpass,information_schema);
--echo ddicttestuser2 has no more the PROCESS privilege and can only see own connects
--echo ####################################################################################
SHOW GRANTS;
+--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
@@ -419,6 +430,7 @@ connect (con107,localhost,ddicttestuser1,ddictpass,information_schema);
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
--error ER_ACCESS_DENIED_ERROR
GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
+--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
@@ -443,6 +455,7 @@ connect (con108,localhost,ddicttestuser1,ddictpass,information_schema);
--echo Therefore the missing SELECT privilege does not affect SELECTs on PROCESSLIST.
--echo ####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
+--replace_result Execute Query
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS
SHOW processlist;
--replace_column 1 ID 3 HOST_NAME 6 TIME 9 TIME_MS 13 MEMORY 14 MAX_MEMORY 15 ROWS 16 QUERY_ID 18 TID
diff --git a/mysql-test/suite/funcs_1/datadict/processlist_val.inc b/mysql-test/suite/funcs_1/datadict/processlist_val.inc
index 24f3eb76a1c..fa6ed4049d6 100644
--- a/mysql-test/suite/funcs_1/datadict/processlist_val.inc
+++ b/mysql-test/suite/funcs_1/datadict/processlist_val.inc
@@ -94,6 +94,7 @@ echo
# 1. Just dump what we get
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <ROWS> 16 <QUERY_ID> 18 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+--replace_result Execute Query
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS>
SHOW FULL PROCESSLIST;
#
@@ -161,6 +162,7 @@ let $wait_condition= SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
# 1. Just dump what we get
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 7 <STATE> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <ROWS> 16 <QUERY_ID> 18 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+--replace_result Execute Query
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
SHOW FULL PROCESSLIST;
#
@@ -203,6 +205,7 @@ echo
connection con1;
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <ROWS> 16 <QUERY_ID> 18 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+--replace_result Execute Query
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
SHOW FULL PROCESSLIST;
@@ -228,6 +231,7 @@ connection con2;
# Just dump what we get
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <ROWS> 16 <QUERY_ID> 18 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+--replace_result Execute Query
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
SHOW FULL PROCESSLIST;
#
@@ -279,6 +283,7 @@ WHERE ID = @test_user_con2_id AND Command IN('Query','Execute')
# 1. Just dump what we get
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <ROWS> 16 <QUERY_ID> 18 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+--replace_result Execute Query
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
SHOW FULL PROCESSLIST;
#
@@ -385,8 +390,10 @@ echo
;
--replace_column 1 <ID> 3 <HOST_NAME> 5 <COMMAND> 6 <TIME> 7 <STATE> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <ROWS> 16 <QUERY_ID> 18 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
+--replace_result Execute Query
--replace_column 1 <ID> 3 <HOST_NAME> 5 <COMMAND> 6 <TIME> 7 <STATE>
SHOW FULL PROCESSLIST;
+--replace_result Execute Query
--replace_column 1 <ID> 3 <HOST_NAME> 5 <COMMAND> 6 <TIME> 7 <STATE>
SHOW PROCESSLIST;
UNLOCK TABLES;
diff --git a/mysql-test/suite/galera/r/galera_kill_largechanges.result b/mysql-test/suite/galera/r/galera_kill_largechanges.result
index a04729d2c87..99a8005e03e 100644
--- a/mysql-test/suite/galera/r/galera_kill_largechanges.result
+++ b/mysql-test/suite/galera/r/galera_kill_largechanges.result
@@ -1,10 +1,11 @@
connection node_2;
connection node_1;
-call mtr.add_suppression("WSREP: Last Applied Action message in non-primary configuration from member .*");
+connection node_1;
+connection node_2;
connection node_1;
SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
-CREATE TABLE ten (f1 INTEGER);
-INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10),(11);
CREATE TABLE t1 (f1 VARCHAR(128)) ENGINE=InnoDB;
connection node_2;
Killing server ...
@@ -12,12 +13,12 @@ connection node_1;
INSERT INTO t1 SELECT REPEAT('a', 128) FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4, ten AS a5, ten AS a6;
connection node_2;
connection node_2a;
-SELECT COUNT(*) = 1000000 FROM t1;
-COUNT(*) = 1000000
-1
-SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-VARIABLE_VALUE = 2
-1
+SELECT COUNT(*) FROM t1;
+COUNT(*)
+1771561
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE
+2
connection node_1;
DROP TABLE t1;
DROP TABLE ten;
diff --git a/mysql-test/suite/galera/r/galera_kill_nochanges.result b/mysql-test/suite/galera/r/galera_kill_nochanges.result
index 3ccf73f0d46..8795608a303 100644
--- a/mysql-test/suite/galera/r/galera_kill_nochanges.result
+++ b/mysql-test/suite/galera/r/galera_kill_nochanges.result
@@ -10,10 +10,10 @@ SET SESSION wsrep_sync_wait = 0;
SET SESSION wsrep_sync_wait = DEFAULT;
connection node_2;
connection node_2a;
-SELECT COUNT(*) = 1 FROM t1;
-COUNT(*) = 1
-1
-SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
-VARIABLE_VALUE = 2
+SELECT COUNT(*) FROM t1;
+COUNT(*)
1
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+VARIABLE_VALUE
+2
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/r/galera_kill_smallchanges.result b/mysql-test/suite/galera/r/galera_kill_smallchanges.result
index 206591bbebe..9d52de585c2 100644
--- a/mysql-test/suite/galera/r/galera_kill_smallchanges.result
+++ b/mysql-test/suite/galera/r/galera_kill_smallchanges.result
@@ -1,6 +1,7 @@
connection node_2;
connection node_1;
-call mtr.add_suppression("WSREP: Last Applied Action message in non-primary configuration from member .*");
+connection node_1;
+connection node_2;
connection node_1;
SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
@@ -10,8 +11,8 @@ connection node_1;
INSERT INTO t1 VALUES (1);
connection node_2;
connection node_2a;
-SELECT COUNT(*) = 1 FROM t1;
-COUNT(*) = 1
+SELECT COUNT(*) FROM t1;
+COUNT(*)
1
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
VARIABLE_VALUE = 2
diff --git a/mysql-test/suite/galera/r/galera_load_data.result b/mysql-test/suite/galera/r/galera_load_data.result
new file mode 100644
index 00000000000..97d82f0f534
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_load_data.result
@@ -0,0 +1,82 @@
+connection node_2;
+connection node_1;
+connection node_1;
+create database cardtest02;
+use cardtest02;
+CREATE TABLE `cardtest_tbl` (
+`id` bigint(18) NOT NULL AUTO_INCREMENT,
+`course` bigint(18) NOT NULL,
+`name` varchar(200) DEFAULT NULL,
+`intro` longtext DEFAULT NULL,
+`introformat` smallint(4) DEFAULT 0,
+`timecreated` bigint(18) NOT NULL,
+`timemodified` bigint(18) NOT NULL,
+`grademethod` varchar(255) DEFAULT NULL,
+`grade` decimal(10,5) DEFAULT NULL,
+`updategradeoncompletion` tinyint(2) DEFAULT 1,
+`competencyoncompletion` varchar(255) DEFAULT NULL,
+`evaluationmethod` varchar(255) DEFAULT NULL,
+`completionmethod` varchar(255) DEFAULT NULL,
+`alloweddates` varchar(1024) DEFAULT NULL,
+`allowedslots` varchar(1024) DEFAULT NULL,
+`permissions` smallint(4) DEFAULT NULL,
+`notifications` varchar(1024) DEFAULT NULL,
+`type` varchar(255) DEFAULT NULL,
+PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1324 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED;
+LOCK TABLES `cardtest_tbl` WRITE;
+ALTER TABLE `cardtest_tbl` DISABLE KEYS;
+Warnings:
+Note 1031 Storage engine InnoDB of the table `cardtest02`.`cardtest_tbl` doesn't have this option
+INSERT INTO `cardtest_tbl` VALUES (1,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(2,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(3,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(4,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(5,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(6,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(7,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(8,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(9,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(10,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(11,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(12,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(13,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(14,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(15,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(16,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(17,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(18,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(19,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(20,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(21,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(22,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(23,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(24,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(25,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(26,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(27,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(28,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(29,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(30,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(31,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(32,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(33,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(34,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(35,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(36,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(37,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(38,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(39,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(40,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(41,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(42,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(43,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(44,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(45,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(46,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(47,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(48,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(49,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(50,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(51,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(52,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(53,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(54,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(55,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(56,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(57,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(58,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(59,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(60,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(61,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(62,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(63,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(64,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(65,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(66,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(67,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(68,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(69,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(70,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(71,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(72,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(73,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(74,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(75,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(76,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(77,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(78,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(79,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(80,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(81,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(82,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(83,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(84,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(85,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(86,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(87,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(88,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(89,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(90,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(91,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(92,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(93,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(94,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(95,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(96,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(97,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(98,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(99,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(100,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(101,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(102,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(103,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(104,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(105,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(106,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(107,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(108,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(109,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(110,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(111,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(112,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(113,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(114,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(115,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(116,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(117,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(118,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(119,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(120,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(121,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(122,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(123,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(124,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(125,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(126,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(127,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(128,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(129,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(130,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(131,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(132,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(133,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(134,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(135,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(136,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(137,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(138,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(139,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(140,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(141,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(142,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(143,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(144,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(145,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(146,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(147,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(148,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(149,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(150,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(151,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(152,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(153,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(154,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(155,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(156,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(157,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(158,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(159,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(160,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(161,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(162,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(163,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(164,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(165,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(166,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(167,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(168,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(169,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(170,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(171,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(172,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(173,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(174,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(175,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(176,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(177,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(178,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(179,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(180,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(181,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(182,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(183,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(184,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(185,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(186,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(187,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(188,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(189,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(190,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(191,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(192,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(193,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(194,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(195,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(196,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(197,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(198,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(199,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(200,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(201,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(202,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(203,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(204,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(205,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(206,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(207,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(208,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(209,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(210,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(211,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(212,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(213,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(214,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(215,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(216,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(217,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(218,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(219,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(220,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(221,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(222,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(223,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(224,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(225,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(226,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(227,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(228,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(229,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(230,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(231,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(232,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(233,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(234,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(235,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(236,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(237,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(238,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(239,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(240,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(241,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(242,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(243,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(244,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(245,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(246,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(247,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(248,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(249,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(250,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(251,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(252,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(253,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(254,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(255,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(256,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(257,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(258,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(259,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(260,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(261,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(262,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(263,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(264,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(265,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(266,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(267,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(268,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(269,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(270,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(271,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(272,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(273,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(274,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(275,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(276,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(277,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(278,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(279,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(280,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(281,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(282,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(283,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(284,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(285,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(286,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(287,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(288,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(289,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(290,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(291,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(292,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(293,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(294,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(295,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(296,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(297,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(298,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(299,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(300,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(301,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL);
+ALTER TABLE `cardtest_tbl` ENABLE KEYS;
+Warnings:
+Note 1031 Storage engine InnoDB of the table `cardtest02`.`cardtest_tbl` doesn't have this option
+UNLOCK TABLES;
+use cardtest02;
+show indexes from cardtest_tbl;
+Table cardtest_tbl
+Non_unique 0
+Key_name PRIMARY
+Seq_in_index 1
+Column_name id
+Collation A
+Cardinality 301
+Sub_part NULL
+Packed NULL
+Null
+Index_type BTREE
+Comment
+Index_comment
+select table_rows, avg_row_length, data_length from information_schema.tables WHERE TABLE_NAME = 'cardtest_tbl';
+table_rows 301
+avg_row_length 81
+data_length 24576
+select count(*) from cardtest_tbl;
+count(*) 301
+connection node_2;
+set session wsrep_sync_wait=15;
+use cardtest02;
+show indexes from cardtest_tbl;
+Table cardtest_tbl
+Non_unique 0
+Key_name PRIMARY
+Seq_in_index 1
+Column_name id
+Collation A
+Cardinality 301
+Sub_part NULL
+Packed NULL
+Null
+Index_type BTREE
+Comment
+Index_comment
+select table_rows, avg_row_length, data_length from information_schema.tables WHERE TABLE_NAME = 'cardtest_tbl';
+table_rows 301
+avg_row_length 81
+data_length 24576
+select count(*) from cardtest_tbl;
+count(*) 301
+connection node_1;
+use test;
+drop database cardtest02;
diff --git a/mysql-test/suite/galera/suite.pm b/mysql-test/suite/galera/suite.pm
index a9fd1568f9c..b8456189848 100644
--- a/mysql-test/suite/galera/suite.pm
+++ b/mysql-test/suite/galera/suite.pm
@@ -77,6 +77,7 @@ push @::global_suppressions,
qr|WSREP: Protocol violation. JOIN message sender .* is not in state transfer \(JOINED\). Message ignored.|,
qr|WSREP: Unsupported protocol downgrade: incremental data collection disabled. Expect abort.|,
qr(WSREP: Action message in non-primary configuration from member [0-9]*),
+ qr(WSREP: Last Applied Action message in non-primary configuration from member [0-9]*),
qr(WSREP: discarding established .*),
qr|WSREP: .*core_handle_uuid_msg.*|,
qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0. WSREP_SYNC_WAIT_BEFORE_READ is on),
diff --git a/mysql-test/suite/galera/t/galera_kill_largechanges.test b/mysql-test/suite/galera/t/galera_kill_largechanges.test
index 2803a43d85a..c671764fa9e 100644
--- a/mysql-test/suite/galera/t/galera_kill_largechanges.test
+++ b/mysql-test/suite/galera/t/galera_kill_largechanges.test
@@ -4,9 +4,11 @@
--source include/big_test.inc
--source include/galera_cluster.inc
---source include/have_innodb.inc
-call mtr.add_suppression("WSREP: Last Applied Action message in non-primary configuration from member .*");
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
--connection node_1
# Enable the master to continue running during the split-brain situation that
@@ -14,8 +16,8 @@ call mtr.add_suppression("WSREP: Last Applied Action message in non-primary conf
--let $wsrep_provider_options_orig = `SELECT @@wsrep_provider_options`
SET GLOBAL wsrep_provider_options = 'pc.ignore_sb=true';
-CREATE TABLE ten (f1 INTEGER);
-INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
+CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO ten VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10),(11);
CREATE TABLE t1 (f1 VARCHAR(128)) ENGINE=InnoDB;
--connection node_2
@@ -33,13 +35,16 @@ INSERT INTO t1 SELECT REPEAT('a', 128) FROM ten AS a1, ten AS a2, ten AS a3, ten
--source include/galera_connect.inc
--connection node_2a
-SELECT COUNT(*) = 1000000 FROM t1;
-SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT COUNT(*) FROM t1;
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--connection node_1
--disable_query_log
--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig';
--enable_query_log
+--let $node_2=node_2a
+--source include/auto_increment_offset_restore.inc
+
DROP TABLE t1;
DROP TABLE ten;
diff --git a/mysql-test/suite/galera/t/galera_kill_nochanges.test b/mysql-test/suite/galera/t/galera_kill_nochanges.test
index 9360ad542f6..aa1648ca3ae 100644
--- a/mysql-test/suite/galera/t/galera_kill_nochanges.test
+++ b/mysql-test/suite/galera/t/galera_kill_nochanges.test
@@ -20,6 +20,7 @@ INSERT INTO t1 VALUES (1);
SET SESSION wsrep_sync_wait = 0;
--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'
--source include/wait_condition.inc
+
SET SESSION wsrep_sync_wait = DEFAULT;
--connection node_2
@@ -30,8 +31,8 @@ SET SESSION wsrep_sync_wait = DEFAULT;
--source include/galera_connect.inc
--connection node_2a
-SELECT COUNT(*) = 1 FROM t1;
-SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
+SELECT COUNT(*) FROM t1;
+SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--let $node_2=node_2a
--source include/auto_increment_offset_restore.inc
diff --git a/mysql-test/suite/galera/t/galera_kill_smallchanges.test b/mysql-test/suite/galera/t/galera_kill_smallchanges.test
index 148c3dbc132..15e1727de03 100644
--- a/mysql-test/suite/galera/t/galera_kill_smallchanges.test
+++ b/mysql-test/suite/galera/t/galera_kill_smallchanges.test
@@ -3,9 +3,11 @@
#
--source include/galera_cluster.inc
---source include/have_innodb.inc
-call mtr.add_suppression("WSREP: Last Applied Action message in non-primary configuration from member .*");
+# Save original auto_increment_offset values.
+--let $node_1=node_1
+--let $node_2=node_2
+--source include/auto_increment_offset_save.inc
--connection node_1
@@ -30,7 +32,7 @@ INSERT INTO t1 VALUES (1);
--source include/galera_connect.inc
--connection node_2a
-SELECT COUNT(*) = 1 FROM t1;
+SELECT COUNT(*) FROM t1;
SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size';
--connection node_1
@@ -38,4 +40,7 @@ SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_N
--eval SET GLOBAL wsrep_provider_options = '$wsrep_provider_options_orig';
--enable_query_log
+--let $node_2=node_2a
+--source include/auto_increment_offset_restore.inc
+
DROP TABLE t1;
diff --git a/mysql-test/suite/galera/t/galera_load_data.cnf b/mysql-test/suite/galera/t/galera_load_data.cnf
new file mode 100644
index 00000000000..fd0327e0ecb
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_load_data.cnf
@@ -0,0 +1,10 @@
+!include ../galera_2nodes.cnf
+
+[mysqld]
+secure-file-priv = ""
+innodb_file_format ='Barracuda'
+innodb_file_per_table = ON
+innodb_stats_persistent=ON
+innodb_stats_auto_recalc=ON
+innodb_stats_persistent_sample_pages=20
+innodb_stats_sample_pages=8
diff --git a/mysql-test/suite/galera/t/galera_load_data.test b/mysql-test/suite/galera/t/galera_load_data.test
new file mode 100644
index 00000000000..99f8e571ef0
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_load_data.test
@@ -0,0 +1,61 @@
+--source include/galera_cluster.inc
+
+
+--connection node_1
+
+create database cardtest02;
+use cardtest02;
+
+CREATE TABLE `cardtest_tbl` (
+ `id` bigint(18) NOT NULL AUTO_INCREMENT,
+ `course` bigint(18) NOT NULL,
+ `name` varchar(200) DEFAULT NULL,
+ `intro` longtext DEFAULT NULL,
+ `introformat` smallint(4) DEFAULT 0,
+ `timecreated` bigint(18) NOT NULL,
+ `timemodified` bigint(18) NOT NULL,
+ `grademethod` varchar(255) DEFAULT NULL,
+ `grade` decimal(10,5) DEFAULT NULL,
+ `updategradeoncompletion` tinyint(2) DEFAULT 1,
+ `competencyoncompletion` varchar(255) DEFAULT NULL,
+ `evaluationmethod` varchar(255) DEFAULT NULL,
+ `completionmethod` varchar(255) DEFAULT NULL,
+ `alloweddates` varchar(1024) DEFAULT NULL,
+ `allowedslots` varchar(1024) DEFAULT NULL,
+ `permissions` smallint(4) DEFAULT NULL,
+ `notifications` varchar(1024) DEFAULT NULL,
+ `type` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=1324 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPRESSED;
+
+LOCK TABLES `cardtest_tbl` WRITE;
+ALTER TABLE `cardtest_tbl` DISABLE KEYS;
+
+INSERT INTO `cardtest_tbl` VALUES (1,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(2,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(3,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(4,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(5,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(6,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(7,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(8,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(9,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(10,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(11,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(12,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(13,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(14,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(15,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(16,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(17,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(18,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(19,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(20,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(21,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(22,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(23,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(24,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(25,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(26,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(27,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(28,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(29,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(30,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(31,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(32,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(33,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(34,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(35,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(36,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(37,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(38,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(39,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(40,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(41,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(42,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(43,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(44,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(45,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(46,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(47,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(48,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(49,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(50,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(51,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(52,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(53,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(54,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(55,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(56,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(57,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(58,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(59,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(60,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(61,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(62,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(63,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(64,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(65,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(66,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(67,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(68,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(69,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(70,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(71,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(72,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(73,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(74,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(75,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(76,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(77,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(78,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(79,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(80,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(81,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(82,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(83,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(84,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(85,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(86,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(87,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(88,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(89,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(90,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(91,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(92,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(93,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(94,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(95,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(96,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(97,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(98,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(99,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(100,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(101,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(102,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(103,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(104,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(105,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(106,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(107,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(108,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(109,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(110,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(111,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(112,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(113,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(114,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(115,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(116,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(117,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(118,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(119,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(120,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(121,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(122,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(123,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(124,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(125,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(126,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(127,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(128,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(129,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(130,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(131,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(132,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(133,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(134,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(135,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(136,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(137,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(138,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(139,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(140,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(141,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(142,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(143,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(144,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(145,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(146,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(147,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(148,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(149,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(150,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(151,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(152,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(153,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(154,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(155,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(156,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(157,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(158,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(159,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(160,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(161,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(162,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(163,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(164,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(165,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(166,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(167,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(168,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(169,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(170,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(171,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(172,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(173,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(174,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(175,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(176,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(177,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(178,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(179,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(180,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(181,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(182,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(183,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(184,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(185,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(186,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(187,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(188,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(189,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(190,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(191,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(192,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(193,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(194,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(195,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(196,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(197,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(198,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(199,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(200,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(201,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(202,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(203,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(204,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(205,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(206,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(207,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(208,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(209,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(210,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(211,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(212,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(213,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(214,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(215,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(216,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(217,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(218,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(219,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(220,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(221,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(222,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(223,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(224,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(225,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(226,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(227,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(228,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(229,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(230,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(231,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(232,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(233,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(234,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(235,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(236,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(237,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(238,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(239,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(240,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(241,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(242,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(243,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(244,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(245,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(246,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(247,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(248,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(249,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(250,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(251,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(252,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(253,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(254,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(255,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(256,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(257,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(258,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(259,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(260,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(261,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(262,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(263,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(264,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(265,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(266,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(267,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(268,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(269,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(270,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(271,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(272,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(273,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(274,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(275,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(276,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(277,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(278,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(279,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(280,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(281,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(282,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(283,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(284,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(285,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(286,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(287,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(288,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(289,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(290,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(291,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(292,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(293,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(294,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(295,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(296,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(297,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(298,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(299,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(300,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL),(301,1,'','',1,1466430455,1471454450,NULL,10.00000,1,NULL,'','',NULL,NULL,1,NULL,NULL);
+
+
+ALTER TABLE `cardtest_tbl` ENABLE KEYS;
+UNLOCK TABLES;
+
+use cardtest02;
+--sleep 15
+--vertical_results
+show indexes from cardtest_tbl;
+--vertical_results
+select table_rows, avg_row_length, data_length from information_schema.tables WHERE TABLE_NAME = 'cardtest_tbl';
+select count(*) from cardtest_tbl;
+
+--connection node_2
+set session wsrep_sync_wait=15;
+use cardtest02;
+--sleep 15
+--vertical_results
+show indexes from cardtest_tbl;
+--vertical_results
+select table_rows, avg_row_length, data_length from information_schema.tables WHERE TABLE_NAME = 'cardtest_tbl';
+select count(*) from cardtest_tbl;
+
+--connection node_1
+use test;
+drop database cardtest02;
+
diff --git a/mysql-test/suite/handler/ps.test b/mysql-test/suite/handler/ps.test
index 68091190c85..783d862435e 100644
--- a/mysql-test/suite/handler/ps.test
+++ b/mysql-test/suite/handler/ps.test
@@ -7,5 +7,7 @@ flush status;
handler handler_a read first;
# handler...read must be prepared in --ps-protocol mode
--replace_result $PS_PROTOCOL OK
+--disable_ps_protocol
show status like 'Com_stmt_prepare%';
+--enable_ps_protocol
drop table t1;
diff --git a/mysql-test/suite/innodb/r/doublewrite.result b/mysql-test/suite/innodb/r/doublewrite.result
index 377f804a836..c65c27b0d90 100644
--- a/mysql-test/suite/innodb/r/doublewrite.result
+++ b/mysql-test/suite/innodb/r/doublewrite.result
@@ -239,7 +239,7 @@ set global innodb_buf_flush_list_now = 1;
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
-FOUND 1 /\[ERROR\] InnoDB: .*test.t1\.ibd.*/ in mysqld.1.err
+FOUND 1 /InnoDB: .*test.t1\.ibd/ in mysqld.1.err
select f1, f2 from t1;
f1 f2
1 ############
diff --git a/mysql-test/suite/innodb/r/log_file_name.result b/mysql-test/suite/innodb/r/log_file_name.result
index 99eba0e33e7..78b97f7f0bb 100644
--- a/mysql-test/suite/innodb/r/log_file_name.result
+++ b/mysql-test/suite/innodb/r/log_file_name.result
@@ -48,7 +48,7 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-FOUND 1 /\[ERROR\] InnoDB: Cannot read first page of .*t2.ibd/ in mysqld.1.err
+NOT FOUND /\[Note\] InnoDB: Cannot read first page of .*t2.ibd/ in mysqld.1.err
FOUND 1 /\[ERROR\] InnoDB: Datafile .*t2.*\. Cannot determine the space ID from the first 64 pages/ in mysqld.1.err
SELECT * FROM t2;
a
@@ -82,18 +82,18 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-FOUND 1 /\[ERROR\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd/ in mysqld.1.err
+FOUND 1 /\[Note\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd/ in mysqld.1.err
FOUND 1 /\[ERROR\] InnoDB: Datafile .*u1.*\. Cannot determine the space ID from the first 64 pages/ in mysqld.1.err
-FOUND 1 /\[ERROR\] InnoDB: Cannot read first page of .*u2.ibd/ in mysqld.1.err
+NOT FOUND /\[Note\] InnoDB: Cannot read first page of .*u2.ibd/ in mysqld.1.err
# Fault 7: Missing or wrong data file and innodb_force_recovery
SELECT * FROM INFORMATION_SCHEMA.ENGINES
WHERE engine = 'innodb'
AND support IN ('YES', 'DEFAULT', 'ENABLED');
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-FOUND 1 /\[ERROR\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd/ in mysqld.1.err
+FOUND 1 /\[Note\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd/ in mysqld.1.err
FOUND 1 /InnoDB: At LSN: \d+: unable to open file .*u[1-5].ibd for tablespace/ in mysqld.1.err
FOUND 1 /\[ERROR\] InnoDB: Cannot rename '.*u5.ibd' to '.*u6.ibd' because the target file exists/ in mysqld.1.err
-FOUND 1 /\[ERROR\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd/ in mysqld.1.err
+FOUND 1 /\[Note\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd/ in mysqld.1.err
FOUND 1 /InnoDB: At LSN: \d+: unable to open file .*u[1-5].ibd for tablespace/ in mysqld.1.err
FOUND 1 /\[Warning\] InnoDB: Tablespace \d+ was not found at .*u[1-5].ibd, and innodb_force_recovery was set. All redo log for this tablespace will be ignored!/ in mysqld.1.err
DROP TABLE u1,u2,u3,u6;
diff --git a/mysql-test/suite/innodb/t/alter_kill.test b/mysql-test/suite/innodb/t/alter_kill.test
index 8f4d2b6e52d..91d62a79342 100644
--- a/mysql-test/suite/innodb/t/alter_kill.test
+++ b/mysql-test/suite/innodb/t/alter_kill.test
@@ -9,8 +9,6 @@ let PAGE_SIZE=`select @@innodb_page_size`;
-- disable_query_log
call mtr.add_suppression("InnoDB: innodb_force_recovery is on.");
-call mtr.add_suppression("InnoDB: Header page contains inconsistent data in .*bug16720368.ibd");
-call mtr.add_suppression("InnoDB: Checksum mismatch in datafile:.*bug16720368");
call mtr.add_suppression("InnoDB: Ignoring tablespace for.*bug16720368");
call mtr.add_suppression("Found 1 prepared XA transactions");
call mtr.add_suppression("InnoDB: Operating system error.*in a file operation");
diff --git a/mysql-test/suite/innodb/t/doublewrite.test b/mysql-test/suite/innodb/t/doublewrite.test
index 28a2977f12d..87ca600aea3 100644
--- a/mysql-test/suite/innodb/t/doublewrite.test
+++ b/mysql-test/suite/innodb/t/doublewrite.test
@@ -11,8 +11,6 @@
# Slow shutdown and restart to make sure ibuf merge is finished
SET GLOBAL innodb_fast_shutdown = 0;
--disable_query_log
-call mtr.add_suppression("InnoDB: Header page consists of zero bytes");
-call mtr.add_suppression("InnoDB: Checksum mismatch in datafile: .*, Space ID:0, Flags: 0");
call mtr.add_suppression("InnoDB: Data file .* uses page size .* but the innodb_page_size start-up parameter is");
call mtr.add_suppression("InnoDB: adjusting FSP_SPACE_FLAGS");
call mtr.add_suppression("InnoDB: New log files created");
@@ -425,7 +423,7 @@ EOF
--source include/start_mysqld.inc
check table t1;
---let SEARCH_PATTERN= \[ERROR\] InnoDB: .*test.t1\\.ibd.*
+--let SEARCH_PATTERN= InnoDB: .*test.t1\\.ibd
--source include/search_pattern_in_file.inc
select f1, f2 from t1;
diff --git a/mysql-test/suite/innodb/t/innodb-corrupted-table.test b/mysql-test/suite/innodb/t/innodb-corrupted-table.test
index 5d8e2bd1eda..d1384d20c7b 100644
--- a/mysql-test/suite/innodb/t/innodb-corrupted-table.test
+++ b/mysql-test/suite/innodb/t/innodb-corrupted-table.test
@@ -34,6 +34,7 @@ alter table t1 add primary key (pk);
--enable_reconnect
--source include/wait_until_connected_again.inc
+--enable_prepare_warnings
show create table t1;
select * from t1;
alter table t1 add j int;
diff --git a/mysql-test/suite/innodb/t/innodb-index.test b/mysql-test/suite/innodb/t/innodb-index.test
index 17cb9e7b4e1..8bd3919af91 100644
--- a/mysql-test/suite/innodb/t/innodb-index.test
+++ b/mysql-test/suite/innodb/t/innodb-index.test
@@ -1166,7 +1166,9 @@ DROP TABLE t;
CREATE TABLE t (a INT) ENGINE=INNODB;
-- remove_file $MYSQL_DATA_DIR/test/t.frm
-- move_file $MYSQL_DATA_DIR/test/t.fr_ $MYSQL_DATA_DIR/test/t.frm
+--enable_prepare_warnings
SHOW CREATE TABLE t;
+--disable_prepare_warnings
DROP TABLE t;
--disable_query_log
diff --git a/mysql-test/suite/innodb/t/log_file_name.test b/mysql-test/suite/innodb/t/log_file_name.test
index 7a1d9626b5d..9df1c6eed5a 100644
--- a/mysql-test/suite/innodb/t/log_file_name.test
+++ b/mysql-test/suite/innodb/t/log_file_name.test
@@ -107,7 +107,7 @@ let SEARCH_PATTERN= InnoDB: Tablespace \d+ was not found at .*t[12].ibd.
eval $check_no_innodb;
--source include/shutdown_mysqld.inc
# On Windows, this error message is not output when t2.ibd is a directory!
-#let SEARCH_PATTERN= \[ERROR\] InnoDB: Cannot read first page of .*t2.ibd;
+#let SEARCH_PATTERN= \[Note\] InnoDB: Cannot read first page of .*t2.ibd;
#--source include/search_pattern_in_file.inc
--rmdir $MYSQLD_DATADIR/test/t2.ibd
@@ -120,7 +120,7 @@ EOF
eval $check_no_innodb;
--source include/shutdown_mysqld.inc
-let SEARCH_PATTERN= \[ERROR\] InnoDB: Cannot read first page of .*t2.ibd;
+let SEARCH_PATTERN= \[Note\] InnoDB: Cannot read first page of .*t2.ibd;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN= \[ERROR\] InnoDB: Datafile .*t2.*\. Cannot determine the space ID from the first 64 pages;
--source include/search_pattern_in_file.inc
@@ -156,13 +156,11 @@ call mtr.add_suppression("InnoDB: Cannot open datafile for read-write: '.*t2\.ib
call mtr.add_suppression("InnoDB: Tablespace .* was not found at .*test");
call mtr.add_suppression("InnoDB: Set innodb_force_recovery=1 to ignore this and to permanently lose all changes to the tablespace");
call mtr.add_suppression("InnoDB: Cannot read first page of '.*test.[tu]2.ibd' I/O error");
-call mtr.add_suppression("InnoDB: Cannot read first page in datafile: .*test.*ibd");
call mtr.add_suppression("InnoDB: Datafile '.*test.*ibd' is corrupted");
call mtr.add_suppression("InnoDB: Cannot replay file rename. Remove either file and try again");
call mtr.add_suppression("InnoDB: Cannot rename.*because the target file exists");
call mtr.add_suppression("InnoDB: Log scan aborted at LSN");
# The following are for the --innodb-force-recovery=1 with broken u* tables:
-call mtr.add_suppression("InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd");
call mtr.add_suppression("InnoDB: The size of the file .*u1\\.ibd is only 16384 bytes, should be at least 65536");
call mtr.add_suppression("InnoDB: The error means the system cannot find the path specified");
call mtr.add_suppression("InnoDB: .*you must create directories");
@@ -216,7 +214,7 @@ EOF
--source include/start_mysqld.inc
eval $check_no_innodb;
-let SEARCH_PATTERN= \[ERROR\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd;
+let SEARCH_PATTERN= \[Note\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN= \[ERROR\] InnoDB: Datafile .*u1.*\. Cannot determine the space ID from the first 64 pages;
@@ -226,7 +224,7 @@ let SEARCH_PATTERN= \[ERROR\] InnoDB: Datafile .*u1.*\. Cannot determine the spa
# in innodb-force-recovery mode once
# Bug#18131883 IMPROVE INNODB ERROR MESSAGES REGARDING FILES
# has been fixed:
-let SEARCH_PATTERN= \[ERROR\] InnoDB: Cannot read first page of .*u2.ibd;
+let SEARCH_PATTERN= \[Note\] InnoDB: Cannot read first page of .*u2.ibd;
--source include/search_pattern_in_file.inc
--source include/shutdown_mysqld.inc
@@ -241,7 +239,7 @@ let SEARCH_PATTERN= \[ERROR\] InnoDB: Cannot read first page of .*u2.ibd;
--source include/start_mysqld.inc
eval $check_no_innodb;
-let SEARCH_PATTERN= \[ERROR\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd;
+let SEARCH_PATTERN= \[Note\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN= InnoDB: At LSN: \d+: unable to open file .*u[1-5].ibd for tablespace;
@@ -254,7 +252,7 @@ let SEARCH_PATTERN= \[ERROR\] InnoDB: Cannot rename '.*u5.ibd' to '.*u6.ibd' bec
--source include/restart_mysqld.inc
-let SEARCH_PATTERN= \[ERROR\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd;
+let SEARCH_PATTERN= \[Note\] InnoDB: Header page consists of zero bytes in datafile: .*u1.ibd;
--source include/search_pattern_in_file.inc
let SEARCH_PATTERN= InnoDB: At LSN: \d+: unable to open file .*u[1-5].ibd for tablespace;
diff --git a/mysql-test/suite/maria/maria-recovery.result b/mysql-test/suite/maria/maria-recovery.result
index 6c9af3eac88..915dc53b460 100644
--- a/mysql-test/suite/maria/maria-recovery.result
+++ b/mysql-test/suite/maria/maria-recovery.result
@@ -292,6 +292,44 @@ t1 CREATE TABLE `t1` (
) ENGINE=Aria AUTO_INCREMENT=17 DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
insert into t1 values(null, "f");
drop table t1;
+Test that bulk insert works with recovery
+CREATE TABLE t1 (i int, key(i)) TRANSACTIONAL=1 ENGINE=ARIA;
+CREATE TABLE t2 (i int, key(i)) TRANSACTIONAL=1 ENGINE=ARIA;
+connection admin;
+* copied t2 for feeding_recovery
+* copied t1 for feeding_recovery
+connection default;
+insert into t2 values
+(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+(0), (1), (3), (3), (4), (5), (6), (7), (8), (9),
+(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+(0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+(0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+insert into t1 select * from t2;
+insert into t2 select * from t2;
+connection admin;
+SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
+* crashing mysqld intentionally
+set global aria_checkpoint_interval=1;
+ERROR HY000: Lost connection to MySQL server during query
+* recovery happens
+connection default;
+use mysqltest;
+select count(*) from t1;
+count(*)
+100
+select count(*) from t2;
+count(*)
+200
+check table t2;
+Table Op Msg_type Msg_text
+mysqltest.t2 check status OK
+drop table t1,t2;
drop database mysqltest_for_feeding_recovery;
drop database mysqltest_for_comparison;
drop database mysqltest;
diff --git a/mysql-test/suite/maria/maria-recovery.test b/mysql-test/suite/maria/maria-recovery.test
index b0f01f37d0d..a1671a56d53 100644
--- a/mysql-test/suite/maria/maria-recovery.test
+++ b/mysql-test/suite/maria/maria-recovery.test
@@ -195,6 +195,36 @@ show create table t1;
insert into t1 values(null, "f");
drop table t1;
+--echo Test that bulk insert works with recovery
+let $mms_tables=2;
+
+CREATE TABLE t1 (i int, key(i)) TRANSACTIONAL=1 ENGINE=ARIA;
+CREATE TABLE t2 (i int, key(i)) TRANSACTIONAL=1 ENGINE=ARIA;
+-- source include/maria_make_snapshot_for_feeding_recovery.inc
+insert into t2 values
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (3), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9),
+ (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+insert into t1 select * from t2;
+insert into t2 select * from t2;
+let $mvr_restore_old_snapshot=0;
+let $mms_compare_physically=0;
+let $mvr_debug_option="+d,maria_flush_whole_log,maria_crash";
+let $mvr_crash_statement= set global aria_checkpoint_interval=1;
+let $mms_tables=0;
+-- source include/maria_verify_recovery.inc
+select count(*) from t1;
+select count(*) from t2;
+check table t2;
+drop table t1,t2;
+
# clean up everything
let $mms_purpose=feeding_recovery;
eval drop database mysqltest_for_$mms_purpose;
diff --git a/mysql-test/suite/rpl/include/create_recursive_construct.inc b/mysql-test/suite/rpl/include/create_recursive_construct.inc
index 815bbb4973e..4a094a68340 100644
--- a/mysql-test/suite/rpl/include/create_recursive_construct.inc
+++ b/mysql-test/suite/rpl/include/create_recursive_construct.inc
@@ -296,7 +296,9 @@ if ($CRC_RET_stmt_sidef) {
--echo
--echo Invoking $CRC_RET_desc.
if ($CRC_create) {
+ --disable_ps_protocol
--eval $CRC_create
+ --enable_ps_protocol
}
--echo * binlog_format = STATEMENT: expect $CRC_ARG_expected_number_of_warnings warnings.
diff --git a/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_func.test b/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_func.test
index 6617c4ad2ea..c37fc7ab114 100644
--- a/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_func.test
+++ b/mysql-test/suite/sys_vars/t/max_prepared_stmt_count_func.test
@@ -19,7 +19,7 @@
# option_mysqld_max_prepared_stmt_count #
# #
################################################################################
-
+--source include/no_protocol.inc
--echo ** Setup **
--echo
diff --git a/mysql-test/suite/sys_vars/t/sql_buffer_result_func.test b/mysql-test/suite/sys_vars/t/sql_buffer_result_func.test
index 0f6084b65f6..380f2568b9c 100644
--- a/mysql-test/suite/sys_vars/t/sql_buffer_result_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_buffer_result_func.test
@@ -46,17 +46,23 @@ INSERT INTO t1 VALUES('aa','bb');
SET SESSION sql_buffer_result = 1;
+--disable_ps_protocol
SHOW STATUS LIKE 'Created_tmp_tables';
+--enable_ps_protocol
--echo Expected value : 0.
SELECT * FROM t1;
+--disable_ps_protocol
SHOW STATUS LIKE 'Created_tmp_tables';
+--enable_ps_protocol
--echo Expected value : 1.
SELECT * FROM t1;
+--disable_ps_protocol
SHOW STATUS LIKE 'Created_tmp_tables';
+--enable_ps_protocol
--echo Expected value : 2.
--echo '#--------------------FN_DYNVARS_156_02-------------------------#'
@@ -66,12 +72,16 @@ SHOW STATUS LIKE 'Created_tmp_tables';
SET SESSION sql_buffer_result = 0;
+--disable_ps_protocol
SHOW STATUS LIKE 'Created_tmp_tables';
+--enable_ps_protocol
--echo Expected value : 2.
SELECT * FROM t1;
+--disable_ps_protocol
SHOW STATUS LIKE 'Created_tmp_tables';
+--enable_ps_protocol
--echo Expected value : 2.
--echo '#--------------------FN_DYNVARS_156_03-------------------------#'
diff --git a/mysql-test/suite/vcol/t/wrong_arena.test b/mysql-test/suite/vcol/t/wrong_arena.test
index 3d65dac9219..8ac1af5c36b 100644
--- a/mysql-test/suite/vcol/t/wrong_arena.test
+++ b/mysql-test/suite/vcol/t/wrong_arena.test
@@ -14,7 +14,9 @@ create table t1 (a datetime,
# other issues
e int as ((a,1) in ((1,1),(2,1),(NULL,1))) # cmp_item_row::alloc_comparators()
);
+enable_prepare_warnings;
show create table t1;
+disable_prepare_warnings;
connect con1, localhost, root;
disable_warnings;
insert t1 (a) values ('2010-10-10 10:10:10');
diff --git a/scripts/mysqldumpslow.sh b/scripts/mysqldumpslow.sh
index 98241da3cba..6a6ab0dc8b5 100644
--- a/scripts/mysqldumpslow.sh
+++ b/scripts/mysqldumpslow.sh
@@ -38,7 +38,7 @@ GetOptions(\%opt,
'v|verbose+',# verbose
'help+', # write usage info
'd|debug+', # debug
- 's=s', # what to sort by (al, at, ar, ae, c, t, l, r, e)
+ 's=s', # what to sort by (aa, ae, al, ar, at, a, c, e, l, r, t)
'r!', # reverse the sort order (largest last instead of first)
't=i', # just show the top n queries
'a!', # don't abstract all numbers to N and strings to 'S'
@@ -202,12 +202,15 @@ Parse and summarize the MySQL slow query log. Options are
-v verbose
-d debug
- -s ORDER what to sort by (al, at, ar, ae, c, l, r, e, t), 'at' is default
+ -s ORDER what to sort by (aa, ae, al, ar, at, a, c, e, l, r, t), 'at' is default
+ aa: average rows affected
+ ae: aggregated rows examined
al: average lock time
ar: average rows sent
at: average query time
- aa: average rows affected
+ a: rows affected
c: count
+ e: rows examined
l: lock time
r: rows sent
t: query time
diff --git a/sql/datadict.cc b/sql/datadict.cc
index 410dbff8778..231e7ea22ca 100644
--- a/sql/datadict.cc
+++ b/sql/datadict.cc
@@ -196,7 +196,7 @@ bool dd_recreate_table(THD *thd, const char *db, const char *table_name,
char path_buf[FN_REFLEN + 1];
DBUG_ENTER("dd_recreate_table");
- memset(&create_info, 0, sizeof(create_info));
+ create_info.init();
if (path)
create_info.options|= HA_LEX_CREATE_TMP_TABLE;
diff --git a/sql/debug_sync.cc b/sql/debug_sync.cc
index d25c1a75e96..357d8f4ce60 100644
--- a/sql/debug_sync.cc
+++ b/sql/debug_sync.cc
@@ -584,7 +584,7 @@ static void debug_sync_remove_action(st_debug_sync_control *ds_control,
memmove(save_action, action, sizeof(st_debug_sync_action));
/* Move actions down. */
- memmove(ds_control->ds_action + dsp_idx,
+ memmove((void*)(ds_control->ds_action + dsp_idx),
ds_control->ds_action + dsp_idx + 1,
(ds_control->ds_active - dsp_idx) *
sizeof(st_debug_sync_action));
@@ -595,8 +595,8 @@ static void debug_sync_remove_action(st_debug_sync_control *ds_control,
produced by the shift. Again do not use an assignment operator to
avoid string allocation/copy.
*/
- memmove(ds_control->ds_action + ds_control->ds_active, save_action,
- sizeof(st_debug_sync_action));
+ memmove((void*)(ds_control->ds_action + ds_control->ds_active),
+ save_action, sizeof(st_debug_sync_action));
}
DBUG_VOID_RETURN;
diff --git a/sql/encryption.cc b/sql/encryption.cc
index 3174968f9b3..0d75fdacd8f 100644
--- a/sql/encryption.cc
+++ b/sql/encryption.cc
@@ -25,6 +25,10 @@ struct encryption_service_st encryption_handler;
extern "C" {
+uint no_get_key(uint, uint, uchar*, uint*)
+{
+ return ENCRYPTION_KEY_VERSION_INVALID;
+}
uint no_key(uint)
{
return ENCRYPTION_KEY_VERSION_INVALID;
@@ -47,6 +51,11 @@ static unsigned int get_length(unsigned int slen, unsigned int key_id,
return my_aes_get_size(MY_AES_CBC, slen);
}
+uint ctx_size(unsigned int, unsigned int)
+{
+ return MY_AES_CTX_SIZE;
+}
+
} /* extern "C" */
int initialize_encryption_plugin(st_plugin_int *plugin)
@@ -72,8 +81,7 @@ int initialize_encryption_plugin(st_plugin_int *plugin)
if (handle->crypt_ctx_size)
encryption_handler.encryption_ctx_size_func= handle->crypt_ctx_size;
else
- encryption_handler.encryption_ctx_size_func=
- (uint (*)(unsigned int, unsigned int))my_aes_ctx_size;
+ encryption_handler.encryption_ctx_size_func= ctx_size;
encryption_handler.encryption_ctx_init_func=
handle->crypt_ctx_init ? handle->crypt_ctx_init : ctx_init;
@@ -102,8 +110,7 @@ int finalize_encryption_plugin(st_plugin_int *plugin)
if (used)
{
- encryption_handler.encryption_key_get_func=
- (uint (*)(uint, uint, uchar*, uint*))no_key;
+ encryption_handler.encryption_key_get_func= no_get_key;
encryption_handler.encryption_key_get_latest_version_func= no_key;
encryption_handler.encryption_ctx_size_func= zero_size;
}
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index aea1796e776..1fae1eaaca3 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -2194,7 +2194,7 @@ void ha_partition::update_create_info(HA_CREATE_INFO *create_info)
uint num_parts= (num_subparts ? m_file_tot_parts / num_subparts :
m_file_tot_parts);
HA_CREATE_INFO dummy_info;
- memset(&dummy_info, 0, sizeof(dummy_info));
+ dummy_info.init();
/*
Since update_create_info() can be called from mysql_prepare_alter_table()
diff --git a/sql/handler.cc b/sql/handler.cc
index 23df2c5b826..da7850c5c4e 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -7344,7 +7344,6 @@ static Create_field *vers_init_sys_field(THD *thd, const char *field_name, int f
if (!f)
return NULL;
- memset(f, 0, sizeof(*f));
f->field_name.str= field_name;
f->field_name.length= strlen(field_name);
f->charset= system_charset_info;
diff --git a/sql/handler.h b/sql/handler.h
index e80b963cdc1..d008249c81c 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -2135,6 +2135,7 @@ struct Table_scope_and_contents_source_pod_st // For trivial members
/* The following is used to remember the old state for CREATE OR REPLACE */
TABLE *table;
TABLE_LIST *pos_in_locked_tables;
+ TABLE_LIST *merge_list;
MDL_ticket *mdl_ticket;
bool table_was_deleted;
sequence_definition *seq_create_info;
@@ -2162,15 +2163,12 @@ struct Table_scope_and_contents_source_pod_st // For trivial members
struct Table_scope_and_contents_source_st:
public Table_scope_and_contents_source_pod_st
{
- SQL_I_List<TABLE_LIST> merge_list;
-
Vers_parse_info vers_info;
Table_period_info period_info;
void init()
{
Table_scope_and_contents_source_pod_st::init();
- merge_list.empty();
vers_info= {};
period_info= {};
}
diff --git a/sql/item.cc b/sql/item.cc
index 826fd742a07..7559acd7adb 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -2140,7 +2140,6 @@ void Item::split_sum_func2(THD *thd, Ref_ptr_array ref_pointer_array,
}
if (unlikely((!(used_tables() & ~PARAM_TABLE_BIT) ||
- type() == SUBSELECT_ITEM ||
(type() == REF_ITEM &&
((Item_ref*)this)->ref_type() != Item_ref::VIEW_REF))))
return;
diff --git a/sql/item_jsonfunc.cc b/sql/item_jsonfunc.cc
index da14c308b87..40237ab46a6 100644
--- a/sql/item_jsonfunc.cc
+++ b/sql/item_jsonfunc.cc
@@ -674,11 +674,11 @@ static int alloc_tmp_paths(THD *thd, uint n_paths,
*paths= (json_path_with_flags *) alloc_root(root,
sizeof(json_path_with_flags) * n_paths);
- *tmp_paths= (String *) alloc_root(root, sizeof(String) * n_paths);
+
+ *tmp_paths= new (root) String[n_paths];
if (*paths == 0 || *tmp_paths == 0)
return 1;
- bzero(*tmp_paths, sizeof(String) * n_paths);
for (uint c_path=0; c_path < n_paths; c_path++)
(*tmp_paths)[c_path].set_charset(&my_charset_utf8_general_ci);
}
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index cccb5a4b37f..b8fd15bb5bf 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -477,7 +477,7 @@ err:
Create a formated date/time value in a string.
*/
-static bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time,
+static bool make_date_time(const LEX_CSTRING &format, MYSQL_TIME *l_time,
timestamp_type type, const MY_LOCALE *locale,
String *str)
{
@@ -492,7 +492,7 @@ static bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time,
if (l_time->neg)
str->append('-');
- end= (ptr= format->format.str) + format->format.length;
+ end= (ptr= format.str) + format.length;
for (; ptr != end ; ptr++)
{
if (*ptr != '%' || ptr+1 == end)
@@ -612,7 +612,7 @@ static bool make_date_time(DATE_TIME_FORMAT *format, MYSQL_TIME *l_time,
str->append_with_prefill(intbuff, length, 2, '0');
break;
case 'j':
- if (type == MYSQL_TIMESTAMP_TIME)
+ if (type == MYSQL_TIMESTAMP_TIME || !l_time->month || !l_time->year)
return 1;
length= (uint) (int10_to_str(calc_daynr(l_time->year,l_time->month,
l_time->day) -
@@ -1871,6 +1871,7 @@ uint Item_func_date_format::format_length(const String *format)
String *Item_func_date_format::val_str(String *str)
{
+ StringBuffer<64> format_buffer;
String *format;
MYSQL_TIME l_time;
uint size;
@@ -1882,7 +1883,7 @@ String *Item_func_date_format::val_str(String *str)
Temporal::Options(mode, thd))))
return 0;
- if (!(format = args[1]->val_str(str)) || !format->length())
+ if (!(format= args[1]->val_str(&format_buffer)) || !format->length())
goto null_date;
if (!is_time_format && !(lc= locale) && !(lc= args[2]->locale_from_val_str()))
@@ -1896,18 +1897,13 @@ String *Item_func_date_format::val_str(String *str)
if (size < MAX_DATE_STRING_REP_LENGTH)
size= MAX_DATE_STRING_REP_LENGTH;
- if (format == str)
- str= &value; // Save result here
+ DBUG_ASSERT(format != str);
if (str->alloc(size))
goto null_date;
- DATE_TIME_FORMAT date_time_format;
- date_time_format.format.str= (char*) format->ptr();
- date_time_format.format.length= format->length();
-
/* Create the result string */
str->set_charset(collation.collation);
- if (!make_date_time(&date_time_format, &l_time,
+ if (!make_date_time(format->lex_cstring(), &l_time,
is_time_format ? MYSQL_TIMESTAMP_TIME :
MYSQL_TIMESTAMP_DATE,
lc, str))
diff --git a/sql/log_slow.h b/sql/log_slow.h
index 069c35173b9..8322f94ee3c 100644
--- a/sql/log_slow.h
+++ b/sql/log_slow.h
@@ -38,6 +38,7 @@
#define QPLAN_TMP_DISK (1U << 10)
/* ... */
+#define QPLAN_STATUS (1UL << 31) /* not in the slow_log_filter */
#define QPLAN_MAX (1UL << 31) /* reserved as placeholder */
/* Bits for log_slow_disabled_statements */
diff --git a/sql/mdl.h b/sql/mdl.h
index 63cec3b65cf..3d0c86f8f1c 100644
--- a/sql/mdl.h
+++ b/sql/mdl.h
@@ -553,6 +553,16 @@ public:
DBUG_ASSERT(ticket == NULL);
type= type_arg;
}
+ void move_from(MDL_request &from)
+ {
+ type= from.type;
+ duration= from.duration;
+ ticket= from.ticket;
+ next_in_list= from.next_in_list;
+ prev_in_list= from.prev_in_list;
+ key.mdl_key_init(&from.key);
+ from.ticket= NULL; // that's what "move" means
+ }
/**
Is this a request for a lock which allow data to be updated?
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 69dc1e5dc9d..f17e8d45309 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -8852,7 +8852,7 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
global_system_variables.binlog_format= BINLOG_FORMAT_ROW;
}
- if (!opt_bootstrap && WSREP_PROVIDER_EXISTS &&
+ if (!opt_bootstrap && WSREP_PROVIDER_EXISTS && WSREP_ON &&
global_system_variables.binlog_format != BINLOG_FORMAT_ROW)
{
diff --git a/sql/mysqld.h b/sql/mysqld.h
index 3d5e0ba85be..b8c6e5f79bb 100644
--- a/sql/mysqld.h
+++ b/sql/mysqld.h
@@ -202,9 +202,6 @@ struct vers_asof_timestamp_t
{
ulong type;
MYSQL_TIME ltime;
- vers_asof_timestamp_t() :
- type(SYSTEM_TIME_UNSPECIFIED)
- {}
};
enum vers_alter_history_enum
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 63598ce1c8f..5ab3d70214d 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -1357,14 +1357,12 @@ QUICK_RANGE_SELECT::~QUICK_RANGE_SELECT()
- Use rowids from unique to run a disk-ordered sweep
*/
-QUICK_INDEX_SORT_SELECT::QUICK_INDEX_SORT_SELECT(THD *thd_param,
- TABLE *table)
+QUICK_INDEX_SORT_SELECT::QUICK_INDEX_SORT_SELECT(THD *thd_param, TABLE *table)
:unique(NULL), pk_quick_select(NULL), thd(thd_param)
{
DBUG_ENTER("QUICK_INDEX_SORT_SELECT::QUICK_INDEX_SORT_SELECT");
index= MAX_KEY;
head= table;
- bzero(&read_record, sizeof(read_record));
init_sql_alloc(&alloc, "QUICK_INDEX_SORT_SELECT",
thd->variables.range_alloc_block_size, 0,
MYF(MY_THREAD_SPECIFIC));
@@ -5499,6 +5497,16 @@ typedef struct st_partial_index_intersect_info
key_map filtered_scans; /* scans to be filtered by cpk conditions */
MY_BITMAP *intersect_fields; /* bitmap of fields used in intersection */
+
+ void init()
+ {
+ common_info= NULL;
+ intersect_fields= NULL;
+ records_sent_to_unique= records= length= in_memory= use_cpk_filter= 0;
+ cost= index_read_cost= in_memory_cost= 0.0;
+ filtered_scans.init();
+ filtered_scans.clear_all();
+ }
} PARTIAL_INDEX_INTERSECT_INFO;
@@ -5645,8 +5653,7 @@ bool prepare_search_best_index_intersect(PARAM *param,
if (n_index_scans <= 1)
return 1;
- bzero(init, sizeof(*init));
- init->filtered_scans.init();
+ init->init();
init->common_info= common;
init->cost= cutoff_cost;
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index 2f021d6118c..34ccdbc1686 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -64,7 +64,7 @@ partition_info *partition_info::get_clone(THD *thd)
if (!part_clone)
DBUG_RETURN(NULL);
- memcpy(part_clone, part, sizeof(partition_element));
+ *part_clone= *part;
part_clone->subpartitions.empty();
while ((subpart= (subpart_it++)))
{
@@ -72,7 +72,7 @@ partition_info *partition_info::get_clone(THD *thd)
if (!subpart_clone)
DBUG_RETURN(NULL);
- memcpy(subpart_clone, subpart, sizeof(partition_element));
+ *subpart_clone= *subpart;
part_clone->subpartitions.push_back(subpart_clone, mem_root);
}
clone->partitions.push_back(part_clone, mem_root);
@@ -1432,12 +1432,11 @@ void partition_info::print_no_partition_found(TABLE *table_arg, myf errflag)
TABLE_LIST table_list;
THD *thd= current_thd;
- bzero(&table_list, sizeof(table_list));
+ table_list.reset();
table_list.db= table_arg->s->db;
table_list.table_name= table_arg->s->table_name;
- if (check_single_table_access(thd,
- SELECT_ACL, &table_list, TRUE))
+ if (check_single_table_access(thd, SELECT_ACL, &table_list, TRUE))
{
my_message(ER_NO_PARTITION_FOR_GIVEN_VALUE,
ER_THD(thd, ER_NO_PARTITION_FOR_GIVEN_VALUE_SILENT), errflag);
diff --git a/sql/protocol.h b/sql/protocol.h
index 6dd3e5c7521..248f18e33df 100644
--- a/sql/protocol.h
+++ b/sql/protocol.h
@@ -255,60 +255,29 @@ class Protocol_discard : public Protocol_text
{
public:
Protocol_discard(THD *thd_arg) : Protocol_text(thd_arg) {}
- /* The real writing is done only in write() */
- virtual bool write() { return 0; }
- virtual bool send_result_set_metadata(List<Item> *list, uint flags)
- {
- // Don't pas Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF flags
- return Protocol_text::send_result_set_metadata(list, 0);
- }
-
- // send_error is intentionally not overloaded.
- virtual bool send_eof(uint server_status, uint statement_warn_count)
- {
- return 0;
- }
-
- void prepare_for_resend()
- {
-#ifndef DBUG_OFF
- field_pos= 0;
-#endif
- }
+ bool write() { return 0; }
+ bool send_result_set_metadata(List<Item> *, uint) { return 0; }
+ bool send_eof(uint, uint) { return 0; }
+ void prepare_for_resend() { IF_DBUG(field_pos= 0,); }
/*
Provide dummy overrides for any storage methods so that we
avoid allocating and copying of data
*/
- virtual bool store_null()
- { return false; }
- virtual bool store_tiny(longlong from)
- { return false; }
- virtual bool store_short(longlong from)
- { return false; }
- virtual bool store_long(longlong from)
- { return false; }
- virtual bool store_longlong(longlong from, bool unsigned_flag)
- { return false; }
- virtual bool store_decimal(const my_decimal *)
- { return false; }
- virtual bool store(const char *from, size_t length, CHARSET_INFO *cs)
- { return false; }
- virtual bool store(const char *from, size_t length,
- CHARSET_INFO *fromcs, CHARSET_INFO *tocs)
- { return false; }
- virtual bool store(MYSQL_TIME *time, int decimals)
- { return false; }
- virtual bool store_date(MYSQL_TIME *time)
- { return false; }
- virtual bool store_time(MYSQL_TIME *time, int decimals)
- { return false; }
- virtual bool store(float nr, uint32 decimals, String *buffer)
- { return false; }
- virtual bool store(double from, uint32 decimals, String *buffer)
- { return false; }
- virtual bool store(Field *field)
- { return false; }
+ bool store_null() { return false; }
+ bool store_tiny(longlong) { return false; }
+ bool store_short(longlong) { return false; }
+ bool store_long(longlong) { return false; }
+ bool store_longlong(longlong, bool) { return false; }
+ bool store_decimal(const my_decimal *) { return false; }
+ bool store(const char *, size_t, CHARSET_INFO *) { return false; }
+ bool store(const char *, size_t, CHARSET_INFO *, CHARSET_INFO *) { return false; }
+ bool store(MYSQL_TIME *, int) { return false; }
+ bool store_date(MYSQL_TIME *) { return false; }
+ bool store_time(MYSQL_TIME *, int) { return false; }
+ bool store(float, uint32, String *) { return false; }
+ bool store(double, uint32, String *) { return false; }
+ bool store(Field *) { return false; }
};
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 6fef2927938..adfd444e4c2 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -702,7 +702,7 @@ enum enum_acl_tables
ROLES_MAPPING_TABLE,
USER_TABLE // <== always the last
};
-// bits for open_grant_tables
+
static const int Table_user= 1 << USER_TABLE;
static const int Table_db= 1 << DB_TABLE;
static const int Table_tables_priv= 1 << TABLES_PRIV_TABLE;
@@ -8844,60 +8844,6 @@ static bool print_grants_for_role(THD *thd, ACL_ROLE * role)
}
-/** checks privileges for SHOW GRANTS and SHOW CREATE USER
-
- @note that in case of SHOW CREATE USER the parser guarantees
- that a role can never happen here, so *rolename will never
- be assigned to
-*/
-static bool check_show_access(THD *thd, LEX_USER *lex_user,
- const char **username,
- const char **hostname, const char **rolename)
-{
- DBUG_ENTER("check_show_access");
-
- if (lex_user->user.str == current_user.str)
- {
- *username= thd->security_ctx->priv_user;
- *hostname= thd->security_ctx->priv_host;
- }
- else if (lex_user->user.str == current_role.str)
- {
- *rolename= thd->security_ctx->priv_role;
- }
- else if (lex_user->user.str == current_user_and_current_role.str)
- {
- *username= thd->security_ctx->priv_user;
- *hostname= thd->security_ctx->priv_host;
- *rolename= thd->security_ctx->priv_role;
- }
- else
- {
- Security_context *sctx= thd->security_ctx;
- bool do_check_access;
-
- lex_user= get_current_user(thd, lex_user);
- if (!lex_user)
- DBUG_RETURN(TRUE);
-
- if (lex_user->is_role())
- {
- *rolename= lex_user->user.str;
- do_check_access= strcmp(*rolename, sctx->priv_role);
- }
- else
- {
- *username= lex_user->user.str;
- *hostname= lex_user->host.str;
- do_check_access= strcmp(*username, sctx->priv_user) ||
- strcmp(*hostname, sctx->priv_host);
- }
-
- if (do_check_access && check_access(thd, SELECT_ACL, "mysql", 0, 0, 1, 0))
- DBUG_RETURN(TRUE);
- }
- DBUG_RETURN(FALSE);
-}
bool mysql_show_create_user(THD *thd, LEX_USER *lex_user)
{
@@ -8914,7 +8860,7 @@ bool mysql_show_create_user(THD *thd, LEX_USER *lex_user)
my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--skip-grant-tables");
DBUG_RETURN(TRUE);
}
- if (check_show_access(thd, lex_user, &username, &hostname, NULL))
+ if (get_show_user(thd, lex_user, &username, &hostname, NULL))
DBUG_RETURN(TRUE);
List<Item> field_list;
@@ -9004,6 +8950,57 @@ void mysql_show_grants_get_fields(THD *thd, List<Item> *fields,
fields->push_back(field, thd->mem_root);
}
+/** checks privileges for SHOW GRANTS and SHOW CREATE USER
+
+ @note that in case of SHOW CREATE USER the parser guarantees
+ that a role can never happen here, so *rolename will never
+ be assigned to
+*/
+bool get_show_user(THD *thd, LEX_USER *lex_user, const char **username,
+ const char **hostname, const char **rolename)
+{
+ if (lex_user->user.str == current_user.str)
+ {
+ *username= thd->security_ctx->priv_user;
+ *hostname= thd->security_ctx->priv_host;
+ return 0;
+ }
+ if (lex_user->user.str == current_role.str)
+ {
+ *rolename= thd->security_ctx->priv_role;
+ return 0;
+ }
+ if (lex_user->user.str == current_user_and_current_role.str)
+ {
+ *username= thd->security_ctx->priv_user;
+ *hostname= thd->security_ctx->priv_host;
+ *rolename= thd->security_ctx->priv_role;
+ return 0;
+ }
+
+ Security_context *sctx= thd->security_ctx;
+ bool do_check_access;
+
+ if (!(lex_user= get_current_user(thd, lex_user)))
+ return 1;
+
+ if (lex_user->is_role())
+ {
+ *rolename= lex_user->user.str;
+ do_check_access= strcmp(*rolename, sctx->priv_role);
+ }
+ else
+ {
+ *username= lex_user->user.str;
+ *hostname= lex_user->host.str;
+ do_check_access= strcmp(*username, sctx->priv_user) ||
+ strcmp(*hostname, sctx->priv_host);
+ }
+
+ if (do_check_access && check_access(thd, SELECT_ACL, "mysql", 0, 0, 1, 0))
+ return 1;
+ return 0;
+}
/*
SHOW GRANTS; Send grants for a user to the client
@@ -9028,15 +9025,16 @@ bool mysql_show_grants(THD *thd, LEX_USER *lex_user)
DBUG_RETURN(TRUE);
}
- if (check_show_access(thd, lex_user, &username, &hostname, &rolename))
+ if (get_show_user(thd, lex_user, &username, &hostname, &rolename))
DBUG_RETURN(TRUE);
+
DBUG_ASSERT(rolename || username);
List<Item> field_list;
- if (!username)
- end= strxmov(buff,"Grants for ",rolename, NullS);
- else
+ if (username)
end= strxmov(buff,"Grants for ",username,"@",hostname, NullS);
+ else
+ end= strxmov(buff,"Grants for ",rolename, NullS);
mysql_show_grants_get_fields(thd, &field_list, buff, (uint) (end-buff));
diff --git a/sql/sql_acl.h b/sql/sql_acl.h
index 6da7d4d5db4..cb49172a90c 100644
--- a/sql/sql_acl.h
+++ b/sql/sql_acl.h
@@ -254,6 +254,8 @@ ulong get_table_grant(THD *thd, TABLE_LIST *table);
ulong get_column_grant(THD *thd, GRANT_INFO *grant,
const char *db_name, const char *table_name,
const char *field_name);
+bool get_show_user(THD *thd, LEX_USER *lex_user, const char **username,
+ const char **hostname, const char **rolename);
void mysql_show_grants_get_fields(THD *thd, List<Item> *fields,
const char *name, size_t length);
bool mysql_show_grants(THD *thd, LEX_USER *user);
diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc
index 795d4c2611b..1da345dfbf4 100644
--- a/sql/sql_admin.cc
+++ b/sql/sql_admin.cc
@@ -452,8 +452,6 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
DBUG_ENTER("mysql_admin_table");
DBUG_PRINT("enter", ("extra_open_options: %u", extra_open_options));
- thd->prepare_logs_for_admin_command();
-
field_list.push_back(item= new (thd->mem_root)
Item_empty_string(thd, "Table",
NAME_CHAR_LEN * 2), thd->mem_root);
diff --git a/sql/sql_admin.h b/sql/sql_admin.h
index dea835c2de9..e7f4086540a 100644
--- a/sql/sql_admin.h
+++ b/sql/sql_admin.h
@@ -28,7 +28,7 @@ int reassign_keycache_tables(THD* thd, KEY_CACHE *src_cache,
/**
Sql_cmd_analyze_table represents the ANALYZE TABLE statement.
*/
-class Sql_cmd_analyze_table : public Sql_cmd_admin
+class Sql_cmd_analyze_table : public Sql_cmd
{
public:
/**
@@ -53,7 +53,7 @@ public:
/**
Sql_cmd_check_table represents the CHECK TABLE statement.
*/
-class Sql_cmd_check_table : public Sql_cmd_admin
+class Sql_cmd_check_table : public Sql_cmd
{
public:
/**
@@ -77,7 +77,7 @@ public:
/**
Sql_cmd_optimize_table represents the OPTIMIZE TABLE statement.
*/
-class Sql_cmd_optimize_table : public Sql_cmd_admin
+class Sql_cmd_optimize_table : public Sql_cmd
{
public:
/**
@@ -102,7 +102,7 @@ public:
/**
Sql_cmd_repair_table represents the REPAIR TABLE statement.
*/
-class Sql_cmd_repair_table : public Sql_cmd_admin
+class Sql_cmd_repair_table : public Sql_cmd
{
public:
/**
diff --git a/sql/sql_alter.cc b/sql/sql_alter.cc
index 4e5ac6e9381..1d2b5c3449b 100644
--- a/sql/sql_alter.cc
+++ b/sql/sql_alter.cc
@@ -402,7 +402,7 @@ bool Sql_cmd_alter_table::execute(THD *thd)
DBUG_RETURN(TRUE); /* purecov: inspected */
/* If it is a merge table, check privileges for merge children. */
- if (create_info.merge_list.first)
+ if (create_info.merge_list)
{
/*
The user must have (SELECT_ACL | UPDATE_ACL | DELETE_ACL) on the
@@ -440,7 +440,7 @@ bool Sql_cmd_alter_table::execute(THD *thd)
*/
if (check_table_access(thd, SELECT_ACL | UPDATE_ACL | DELETE_ACL,
- create_info.merge_list.first, FALSE, UINT_MAX, FALSE))
+ create_info.merge_list, FALSE, UINT_MAX, FALSE))
DBUG_RETURN(TRUE);
}
@@ -451,9 +451,7 @@ bool Sql_cmd_alter_table::execute(THD *thd)
{
// Rename of table
TABLE_LIST tmp_table;
- memset(&tmp_table, 0, sizeof(tmp_table));
- tmp_table.table_name= lex->name;
- tmp_table.db= select_lex->db;
+ tmp_table.init_one_table(&select_lex->db, &lex->name, 0, TL_IGNORE);
tmp_table.grant.privilege= priv;
if (check_grant(thd, INSERT_ACL | CREATE_ACL, &tmp_table, FALSE,
UINT_MAX, FALSE))
@@ -471,7 +469,6 @@ bool Sql_cmd_alter_table::execute(THD *thd)
"INDEX DIRECTORY");
create_info.data_file_name= create_info.index_file_name= NULL;
- thd->prepare_logs_for_admin_command();
#ifdef WITH_PARTITION_STORAGE_ENGINE
thd->work_part_info= 0;
#endif
@@ -522,8 +519,6 @@ bool Sql_cmd_discard_import_tablespace::execute(THD *thd)
if (check_grant(thd, ALTER_ACL, table_list, false, UINT_MAX, false))
return true;
- thd->prepare_logs_for_admin_command();
-
/*
Check if we attempt to alter mysql.slow_log or
mysql.general_log table and return an error if
diff --git a/sql/sql_alter.h b/sql/sql_alter.h
index e2e7abe2a1c..14242015bd2 100644
--- a/sql/sql_alter.h
+++ b/sql/sql_alter.h
@@ -333,7 +333,7 @@ private:
statements.
@todo move Alter_info and other ALTER generic structures from Lex here.
*/
-class Sql_cmd_common_alter_table : public Sql_cmd_admin
+class Sql_cmd_common_alter_table : public Sql_cmd
{
protected:
/**
diff --git a/sql/sql_analyse.cc b/sql/sql_analyse.cc
index a7cfaca0d0e..fa24ea142b1 100644
--- a/sql/sql_analyse.cc
+++ b/sql/sql_analyse.cc
@@ -295,9 +295,9 @@ bool get_ev_num_info(EV_NUM_INFO *ev_info, NUM_INFO *info, const char *num)
} // get_ev_num_info
-int free_string(String *s)
+int free_string(void* str, TREE_FREE, void*)
{
- s->free();
+ ((String*)str)->free();
return 0;
}
@@ -1233,4 +1233,3 @@ uint check_ulonglong(const char *str, uint length)
while (*cmp && *cmp++ == *str++) ;
return ((uchar) str[-1] <= (uchar) cmp[-1]) ? smaller : bigger;
} /* check_ulonlong */
-
diff --git a/sql/sql_analyse.h b/sql/sql_analyse.h
index 6704de4ed6d..a76e1409659 100644
--- a/sql/sql_analyse.h
+++ b/sql/sql_analyse.h
@@ -68,7 +68,7 @@ int compare_ulonglong2(void* cmp_arg __attribute__((unused)),
int compare_decimal2(int* len, const char *s, const char *t);
Procedure *proc_analyse_init(THD *thd, ORDER *param, select_result *result,
List<Item> &field_list);
-int free_string(String*);
+int free_string(void* str, TREE_FREE, void*);
class analyse;
class field_info :public Sql_alloc
@@ -121,8 +121,7 @@ public:
must_be_blob(0), was_zero_fill(0),
was_maybe_zerofill(0), can_be_still_num(1)
{ init_tree(&tree, 0, 0, sizeof(String), (qsort_cmp2) sortcmp2,
- (tree_element_free) free_string, NULL,
- MYF(MY_THREAD_SPECIFIC)); };
+ free_string, NULL, MYF(MY_THREAD_SPECIFIC)); };
void add();
void get_opt_type(String*, ha_rows);
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index d05cd4d2e4c..d6196d8edbe 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -2648,17 +2648,15 @@ CHANGED_TABLE_LIST* THD::changed_table_dup(const char *key, size_t key_length)
}
-void THD::prepare_explain_fields(select_result *result,
- List<Item> *field_list,
- uint8 explain_flags,
- bool is_analyze)
+int THD::prepare_explain_fields(select_result *result, List<Item> *field_list,
+ uint8 explain_flags, bool is_analyze)
{
if (lex->explain_json)
make_explain_json_field_list(*field_list, is_analyze);
else
make_explain_field_list(*field_list, explain_flags, is_analyze);
- result->prepare(*field_list, NULL);
+ return result->prepare(*field_list, NULL);
}
@@ -2668,11 +2666,10 @@ int THD::send_explain_fields(select_result *result,
{
List<Item> field_list;
int rc;
- prepare_explain_fields(result, &field_list, explain_flags, is_analyze);
- rc= result->send_result_set_metadata(field_list,
- Protocol::SEND_NUM_ROWS |
- Protocol::SEND_EOF);
- return(rc);
+ rc= prepare_explain_fields(result, &field_list, explain_flags, is_analyze) ||
+ result->send_result_set_metadata(field_list, Protocol::SEND_NUM_ROWS |
+ Protocol::SEND_EOF);
+ return rc;
}
diff --git a/sql/sql_class.h b/sql/sql_class.h
index bbe9433eeb2..ba4bb45c5ae 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1,6 +1,6 @@
/*
Copyright (c) 2000, 2016, Oracle and/or its affiliates.
- Copyright (c) 2009, 2017, MariaDB Corporation.
+ Copyright (c) 2009, 2019, 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
@@ -3847,8 +3847,8 @@ public:
void add_changed_table(TABLE *table);
void add_changed_table(const char *key, size_t key_length);
CHANGED_TABLE_LIST * changed_table_dup(const char *key, size_t key_length);
- void prepare_explain_fields(select_result *result, List<Item> *field_list,
- uint8 explain_flags, bool is_analyze);
+ int prepare_explain_fields(select_result *result, List<Item> *field_list,
+ uint8 explain_flags, bool is_analyze);
int send_explain_fields(select_result *result, uint8 explain_flags,
bool is_analyze);
void make_explain_field_list(List<Item> &field_list, uint8 explain_flags,
@@ -5033,11 +5033,6 @@ public:
Item *sp_prepare_func_item(Item **it_addr, uint cols= 1);
bool sp_eval_expr(Field *result_field, Item **expr_item_ptr);
- inline void prepare_logs_for_admin_command()
- {
- query_plan_flags|= QPLAN_ADMIN;
- }
-
bool having_pushdown;
};
@@ -5130,6 +5125,7 @@ public:
void reset(THD *thd_arg) { thd= thd_arg; }
};
+class select_result_interceptor;
/*
Interface for sending tabular data, together with some other stuff:
@@ -5228,11 +5224,10 @@ public:
/*
This returns
- - FALSE if the class sends output row to the client
- - TRUE if the output is set elsewhere (a file, @variable, or table).
- Currently all intercepting classes derive from select_result_interceptor.
+ - NULL if the class sends output row to the client
+ - this if the output is set elsewhere (a file, @variable, or table).
*/
- virtual bool is_result_interceptor()=0;
+ virtual select_result_interceptor *result_interceptor()=0;
/*
This method is used to distinguish an normal SELECT from the cursor
@@ -5308,7 +5303,7 @@ public:
} /* Remove gcc warning */
uint field_count(List<Item> &fields) const { return 0; }
bool send_result_set_metadata(List<Item> &fields, uint flag) { return FALSE; }
- bool is_result_interceptor() { return true; }
+ select_result_interceptor *result_interceptor() { return this; }
/*
Instruct the object to not call my_ok(). Client output will be handled
@@ -5442,7 +5437,7 @@ public:
virtual bool check_simple_select() const { return FALSE; }
void abort_result_set();
virtual void cleanup();
- bool is_result_interceptor() { return false; }
+ select_result_interceptor *result_interceptor() { return NULL; }
};
@@ -6486,27 +6481,32 @@ public:
#define CF_UPDATES_DATA (1U << 18)
/**
+ Not logged into slow log as "admin commands"
+*/
+#define CF_ADMIN_COMMAND (1U << 19)
+
+/**
SP Bulk execution safe
*/
-#define CF_SP_BULK_SAFE (1U << 19)
+#define CF_SP_BULK_SAFE (1U << 20)
/**
SP Bulk execution optimized
*/
-#define CF_SP_BULK_OPTIMIZED (1U << 20)
+#define CF_SP_BULK_OPTIMIZED (1U << 21)
/**
If command creates or drops a table
*/
-#define CF_SCHEMA_CHANGE (1U << 21)
+#define CF_SCHEMA_CHANGE (1U << 22)
/**
If command creates or drops a database
*/
-#define CF_DB_CHANGE (1U << 22)
+#define CF_DB_CHANGE (1U << 23)
#ifdef WITH_WSREP
/**
DDL statement that may be subject to error filtering.
*/
-#define CF_WSREP_MAY_IGNORE_ERRORS (1U << 23)
+#define CF_WSREP_MAY_IGNORE_ERRORS (1U << 24)
#endif /* WITH_WSREP */
diff --git a/sql/sql_cmd.h b/sql/sql_cmd.h
index cbd7513e29f..8ff26b09015 100644
--- a/sql/sql_cmd.h
+++ b/sql/sql_cmd.h
@@ -161,8 +161,6 @@ public:
*/
virtual bool execute(THD *thd) = 0;
- virtual bool log_slow_enabled_statement(const THD *thd) const;
-
protected:
Sql_cmd()
{}
@@ -180,17 +178,6 @@ protected:
};
-class Sql_cmd_admin: public Sql_cmd
-{
-public:
- Sql_cmd_admin()
- {}
- ~Sql_cmd_admin()
- {}
- bool log_slow_enabled_statement(const THD *thd) const;
-};
-
-
/**
Sql_cmd_call represents the CALL statement.
*/
@@ -220,5 +207,4 @@ public:
}
};
-
#endif // SQL_CMD_INCLUDED
diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc
index 5adf5c75600..6ce2aeb095c 100644
--- a/sql/sql_connect.cc
+++ b/sql/sql_connect.cc
@@ -1182,7 +1182,6 @@ exit:
void end_connection(THD *thd)
{
NET *net= &thd->net;
- plugin_thdvar_cleanup(thd);
if (thd->user_connect)
{
diff --git a/sql/sql_cte.cc b/sql/sql_cte.cc
index c89f49aaefc..455abd9c4b3 100644
--- a/sql/sql_cte.cc
+++ b/sql/sql_cte.cc
@@ -714,6 +714,7 @@ void With_element::move_anchors_ahead()
}
}
first_recursive= new_pos;
+ spec->first_select()->set_linkage(DERIVED_TABLE_TYPE);
}
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 73b6f637a98..9da1d314393 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -417,8 +417,6 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, SQL_HANDLER *reopen)
sql_handler->reset();
}
sql_handler->table= table;
- memcpy(&sql_handler->mdl_request, &tables->mdl_request,
- sizeof(tables->mdl_request));
if (!(sql_handler->lock= get_lock_data(thd, &sql_handler->table, 1,
GET_LOCK_STORE_LOCKS)))
@@ -431,6 +429,8 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, SQL_HANDLER *reopen)
if (unlikely(error))
goto err;
+ sql_handler->mdl_request.move_from(tables->mdl_request);
+
/* Always read all columns */
table->read_set= &table->s->all_set;
@@ -468,9 +468,6 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, SQL_HANDLER *reopen)
table_list->table->open_by_handler= 1;
}
- /* Safety, cleanup the pointer to satisfy MDL assertions. */
- tables->mdl_request.ticket= NULL;
-
if (! reopen)
my_ok(thd);
DBUG_PRINT("exit",("OK"));
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index b18553ee586..9f02a809026 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -4504,14 +4504,12 @@ select_create::binlog_show_create_table(TABLE **tables, uint count)
DBUG_ASSERT(thd->is_current_stmt_binlog_format_row());
DBUG_ASSERT(tables && *tables && count > 0);
- char buf[2048];
- String query(buf, sizeof(buf), system_charset_info);
+ StringBuffer<2048> query(system_charset_info);
int result;
TABLE_LIST tmp_table_list;
- memset(&tmp_table_list, 0, sizeof(tmp_table_list));
+ tmp_table_list.reset();
tmp_table_list.table = *tables;
- query.length(0); // Have to zero it since constructor doesn't
result= show_create_table(thd, &tmp_table_list, &query,
create_info, WITH_DB_NAME);
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 89b330f263a..fcde5deb7f6 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -5217,20 +5217,6 @@ bool LEX::is_partition_management() const
}
-bool Sql_cmd::log_slow_enabled_statement(const THD *thd) const
-{
- return global_system_variables.sql_log_slow && thd->variables.sql_log_slow;
-}
-
-
-bool Sql_cmd_admin::log_slow_enabled_statement(const THD *thd) const
-{
- return !MY_TEST(thd->variables.log_slow_disabled_statements &
- LOG_SLOW_DISABLE_ADMIN) &&
- Sql_cmd::log_slow_enabled_statement(thd);
-}
-
-
/**
Exclude last added SELECT_LEX (current) in the UNIT and return pointer in it
(previous become currect)
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 91f43fdbaa6..6b609833ef0 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -550,12 +550,14 @@ void init_update_queries(void)
CF_REEXECUTION_FRAGILE |
CF_AUTO_COMMIT_TRANS |
CF_SCHEMA_CHANGE);
- sql_command_flags[SQLCOM_CREATE_INDEX]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS | CF_REPORT_PROGRESS;
+ sql_command_flags[SQLCOM_CREATE_INDEX]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS |
+ CF_ADMIN_COMMAND | CF_REPORT_PROGRESS;
sql_command_flags[SQLCOM_ALTER_TABLE]= CF_CHANGES_DATA | CF_WRITE_LOGS_COMMAND |
CF_AUTO_COMMIT_TRANS | CF_REPORT_PROGRESS |
- CF_INSERTS_DATA;
+ CF_INSERTS_DATA | CF_ADMIN_COMMAND;
sql_command_flags[SQLCOM_ALTER_SEQUENCE]= CF_CHANGES_DATA | CF_WRITE_LOGS_COMMAND |
- CF_AUTO_COMMIT_TRANS | CF_SCHEMA_CHANGE;
+ CF_AUTO_COMMIT_TRANS | CF_SCHEMA_CHANGE |
+ CF_ADMIN_COMMAND;
sql_command_flags[SQLCOM_TRUNCATE]= CF_CHANGES_DATA | CF_WRITE_LOGS_COMMAND |
CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_DROP_TABLE]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS | CF_SCHEMA_CHANGE;
@@ -571,8 +573,9 @@ void init_update_queries(void)
sql_command_flags[SQLCOM_DROP_PACKAGE_BODY]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_ALTER_DB_UPGRADE]= CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_ALTER_DB]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS | CF_DB_CHANGE;
- sql_command_flags[SQLCOM_RENAME_TABLE]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
- sql_command_flags[SQLCOM_DROP_INDEX]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS | CF_REPORT_PROGRESS;
+ sql_command_flags[SQLCOM_RENAME_TABLE]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS | CF_ADMIN_COMMAND;
+ sql_command_flags[SQLCOM_DROP_INDEX]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS |
+ CF_REPORT_PROGRESS | CF_ADMIN_COMMAND;
sql_command_flags[SQLCOM_CREATE_VIEW]= CF_CHANGES_DATA | CF_REEXECUTION_FRAGILE |
CF_AUTO_COMMIT_TRANS;
sql_command_flags[SQLCOM_DROP_VIEW]= CF_CHANGES_DATA | CF_AUTO_COMMIT_TRANS;
@@ -752,10 +755,14 @@ void init_update_queries(void)
The following admin table operations are allowed
on log tables.
*/
- sql_command_flags[SQLCOM_REPAIR]= CF_WRITE_LOGS_COMMAND | CF_AUTO_COMMIT_TRANS | CF_REPORT_PROGRESS;
- sql_command_flags[SQLCOM_OPTIMIZE]|= CF_WRITE_LOGS_COMMAND | CF_AUTO_COMMIT_TRANS | CF_REPORT_PROGRESS;
- sql_command_flags[SQLCOM_ANALYZE]= CF_WRITE_LOGS_COMMAND | CF_AUTO_COMMIT_TRANS | CF_REPORT_PROGRESS;
- sql_command_flags[SQLCOM_CHECK]= CF_WRITE_LOGS_COMMAND | CF_AUTO_COMMIT_TRANS | CF_REPORT_PROGRESS;
+ sql_command_flags[SQLCOM_REPAIR]= CF_WRITE_LOGS_COMMAND | CF_AUTO_COMMIT_TRANS |
+ CF_REPORT_PROGRESS | CF_ADMIN_COMMAND;
+ sql_command_flags[SQLCOM_OPTIMIZE]|= CF_WRITE_LOGS_COMMAND | CF_AUTO_COMMIT_TRANS |
+ CF_REPORT_PROGRESS | CF_ADMIN_COMMAND;
+ sql_command_flags[SQLCOM_ANALYZE]= CF_WRITE_LOGS_COMMAND | CF_AUTO_COMMIT_TRANS |
+ CF_REPORT_PROGRESS | CF_ADMIN_COMMAND;
+ sql_command_flags[SQLCOM_CHECK]= CF_WRITE_LOGS_COMMAND | CF_AUTO_COMMIT_TRANS |
+ CF_REPORT_PROGRESS | CF_ADMIN_COMMAND;
sql_command_flags[SQLCOM_CHECKSUM]= CF_REPORT_PROGRESS;
sql_command_flags[SQLCOM_CREATE_USER]|= CF_AUTO_COMMIT_TRANS;
@@ -1571,10 +1578,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
thd->reset_for_next_command();
thd->set_command(command);
- /*
- thd->variables.log_slow_disabled_statements defines which statements
- are logged to slow log
- */
thd->enable_slow_log= true;
thd->query_plan_flags= QPLAN_INIT;
thd->lex->sql_command= SQLCOM_END; /* to avoid confusing VIEW detectors */
@@ -2076,7 +2079,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
status_var_increment(thd->status_var.com_other);
- thd->prepare_logs_for_admin_command();
+ thd->query_plan_flags|= QPLAN_ADMIN;
if (check_global_access(thd, REPL_SLAVE_ACL))
break;
@@ -2483,33 +2486,11 @@ dispatch_end:
DBUG_RETURN(error);
}
-
-static bool log_slow_enabled_statement(const THD *thd)
+static bool slow_filter_masked(THD *thd, ulonglong mask)
{
- /*
- TODO-10.4: Add classes Sql_cmd_create_index and Sql_cmd_drop_index
- for symmetry with other admin commands, so these statements can be
- handled by this command:
- */
- if (thd->lex->m_sql_cmd)
- return thd->lex->m_sql_cmd->log_slow_enabled_statement(thd);
-
- /*
- Currently CREATE INDEX or DROP INDEX cause a full table rebuild
- and thus classify as slow administrative statements just like
- ALTER TABLE.
- */
- if ((thd->lex->sql_command == SQLCOM_CREATE_INDEX ||
- thd->lex->sql_command == SQLCOM_DROP_INDEX) &&
- MY_TEST(thd->variables.log_slow_disabled_statements &
- LOG_SLOW_DISABLE_ADMIN))
- return true;
-
- return global_system_variables.sql_log_slow &&
- thd->variables.sql_log_slow;
+ return thd->variables.log_slow_filter && !(thd->variables.log_slow_filter & mask);
}
-
/*
Log query to slow queries, if it passes filtering
@@ -2540,11 +2521,16 @@ void log_slow_statement(THD *thd)
if (!thd->enable_slow_log)
goto end; // E.g. SP statement
+ DBUG_EXECUTE_IF("simulate_slow_query", {
+ if (thd->get_command() == COM_QUERY ||
+ thd->get_command() == COM_STMT_EXECUTE)
+ thd->server_status|= SERVER_QUERY_WAS_SLOW;
+ });
+
if ((thd->server_status &
(SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED)) &&
- !(sql_command_flags[thd->last_sql_command] & CF_STATUS_COMMAND) &&
- (!thd->variables.log_slow_filter ||
- (thd->variables.log_slow_filter & QPLAN_NOT_USING_INDEX)))
+ !(thd->query_plan_flags & QPLAN_STATUS) &&
+ !slow_filter_masked(thd, QPLAN_NOT_USING_INDEX))
{
thd->query_plan_flags|= QPLAN_NOT_USING_INDEX;
/* We are always logging no index queries if enabled in filter */
@@ -2556,7 +2542,15 @@ void log_slow_statement(THD *thd)
{
thd->status_var.long_query_count++;
- if (!log_slow_enabled_statement(thd))
+ /*
+ until log_slow_disabled_statements=admin is removed, it
+ duplicates slow_log_filter=admin
+ */
+ if ((thd->query_plan_flags & QPLAN_ADMIN) &&
+ (thd->variables.log_slow_disabled_statements & LOG_SLOW_DISABLE_ADMIN))
+ goto end;
+
+ if (!global_system_variables.sql_log_slow || !thd->variables.sql_log_slow)
goto end;
/*
@@ -2571,8 +2565,7 @@ void log_slow_statement(THD *thd)
Follow the slow log filter configuration:
skip logging if the current statement matches the filter.
*/
- if (thd->variables.log_slow_filter &&
- !(thd->variables.log_slow_filter & thd->query_plan_flags))
+ if (slow_filter_masked(thd, thd->query_plan_flags))
goto end;
THD_STAGE_INFO(thd, stage_logging_slow_query);
@@ -3768,6 +3761,11 @@ mysql_execute_command(THD *thd)
goto error;
}
+ if (sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND)
+ thd->query_plan_flags|= QPLAN_STATUS;
+ if (sql_command_flags[lex->sql_command] & CF_ADMIN_COMMAND)
+ thd->query_plan_flags|= QPLAN_ADMIN;
+
/* Start timeouts */
thd->set_query_timer();
@@ -3866,6 +3864,8 @@ mysql_execute_command(THD *thd)
else
{
WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW);
+ if (lex->sql_command == SQLCOM_SHOW_PROFILE)
+ thd->profiling.discard_current_query();
}
#endif /* WITH_WSREP */
@@ -4436,12 +4436,6 @@ end_with_restore_list:
if (check_one_table_access(thd, INDEX_ACL, all_tables))
goto error; /* purecov: inspected */
WSREP_TO_ISOLATION_BEGIN(first_table->db.str, first_table->table_name.str, NULL);
- /*
- Currently CREATE INDEX or DROP INDEX cause a full table rebuild
- and thus classify as slow administrative statements just like
- ALTER TABLE.
- */
- thd->prepare_logs_for_admin_command();
bzero((char*) &create_info, sizeof(create_info));
create_info.db_type= 0;
@@ -4604,48 +4598,6 @@ end_with_restore_list:
DBUG_PRINT("debug", ("lex->only_view: %d, table: %s.%s",
lex->table_type == TABLE_TYPE_VIEW,
first_table->db.str, first_table->table_name.str));
- if (lex->table_type == TABLE_TYPE_VIEW)
- {
- if (check_table_access(thd, SELECT_ACL, first_table, FALSE, 1, FALSE))
- {
- DBUG_PRINT("debug", ("check_table_access failed"));
- my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0),
- "SHOW", thd->security_ctx->priv_user,
- thd->security_ctx->host_or_ip, first_table->alias.str);
- goto error;
- }
- DBUG_PRINT("debug", ("check_table_access succeeded"));
-
- /* Ignore temporary tables if this is "SHOW CREATE VIEW" */
- first_table->open_type= OT_BASE_ONLY;
- }
- else
- {
- /*
- Temporary tables should be opened for SHOW CREATE TABLE, but not
- for SHOW CREATE VIEW.
- */
- if (thd->open_temporary_tables(all_tables))
- goto error;
-
- /*
- The fact that check_some_access() returned FALSE does not mean that
- access is granted. We need to check if first_table->grant.privilege
- contains any table-specific privilege.
- */
- DBUG_PRINT("debug", ("first_table->grant.privilege: %lx",
- first_table->grant.privilege));
- if (check_some_access(thd, SHOW_CREATE_TABLE_ACLS, first_table) ||
- (first_table->grant.privilege & SHOW_CREATE_TABLE_ACLS) == 0)
- {
- my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0),
- "SHOW", thd->security_ctx->priv_user,
- thd->security_ctx->host_or_ip, first_table->alias.str);
- goto error;
- }
- }
-
- /* Access is granted. Execute the command. */
res= mysqld_show_create(thd, first_table);
break;
#endif
@@ -4992,7 +4944,7 @@ end_with_restore_list:
case SQLCOM_DELETE:
{
WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE);
- select_result *sel_result=lex->result;
+ select_result *sel_result= NULL;
DBUG_ASSERT(first_table == all_tables && first_table != 0);
WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE);
@@ -5021,16 +4973,15 @@ end_with_restore_list:
}
else
{
- if (!(sel_result= lex->result) &&
- !(sel_result= new (thd->mem_root) select_send(thd)))
- return 1;
+ if (!lex->result && !(sel_result= new (thd->mem_root) select_send(thd)))
+ goto error;
}
}
res = mysql_delete(thd, all_tables,
select_lex->where, &select_lex->order_list,
unit->select_limit_cnt, select_lex->options,
- sel_result);
+ lex->result ? lex->result : sel_result);
if (replaced_protocol)
{
@@ -6384,8 +6335,6 @@ end_with_restore_list:
DBUG_ASSERT(first_table == all_tables && first_table != 0);
/* fall through */
case SQLCOM_ALTER_SEQUENCE:
- thd->prepare_logs_for_admin_command();
- /* fall through */
case SQLCOM_SIGNAL:
case SQLCOM_RESIGNAL:
case SQLCOM_GET_DIAGNOSTICS:
@@ -6633,8 +6582,8 @@ static bool execute_sqlcom_select(THD *thd, TABLE_LIST *all_tables)
Protocol *save_protocol= NULL;
if (lex->analyze_stmt)
{
- if (result && result->is_result_interceptor())
- ((select_result_interceptor*)result)->disable_my_ok_calls();
+ if (result && result->result_interceptor())
+ result->result_interceptor()->disable_my_ok_calls();
else
{
DBUG_ASSERT(thd->protocol);
@@ -7196,7 +7145,7 @@ static bool check_show_access(THD *thd, TABLE_LIST *table)
Check_grant will grant access if there is any column privileges on
all of the tables thanks to the fourth parameter (bool show_table).
*/
- if (check_grant(thd, SELECT_ACL, dst_table, TRUE, UINT_MAX, FALSE))
+ if (check_grant(thd, SELECT_ACL, dst_table, TRUE, 1, FALSE))
return TRUE; /* Access denied */
close_thread_tables(thd);
@@ -9759,7 +9708,7 @@ bool create_table_precheck(THD *thd, TABLE_LIST *tables,
goto err;
/* If it is a merge table, check privileges for merge children. */
- if (lex->create_info.merge_list.first)
+ if (lex->create_info.merge_list)
{
/*
The user must have (SELECT_ACL | UPDATE_ACL | DELETE_ACL) on the
@@ -9797,8 +9746,7 @@ bool create_table_precheck(THD *thd, TABLE_LIST *tables,
*/
if (check_table_access(thd, SELECT_ACL | UPDATE_ACL | DELETE_ACL,
- lex->create_info.merge_list.first,
- FALSE, UINT_MAX, FALSE))
+ lex->create_info.merge_list, FALSE, UINT_MAX, FALSE))
goto err;
}
diff --git a/sql/sql_partition_admin.cc b/sql/sql_partition_admin.cc
index 71ab7477391..11276aa5a64 100644
--- a/sql/sql_partition_admin.cc
+++ b/sql/sql_partition_admin.cc
@@ -96,7 +96,6 @@ bool Sql_cmd_alter_table_exchange_partition::execute(THD *thd)
DBUG_ASSERT(!create_info.data_file_name && !create_info.index_file_name);
WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table);
- thd->prepare_logs_for_admin_command();
DBUG_RETURN(exchange_partition(thd, first_table, &alter_info));
#ifdef WITH_WSREP
wsrep_error_label:
@@ -193,8 +192,8 @@ static bool compare_table_with_partition(THD *thd, TABLE *table,
DBUG_ENTER("compare_table_with_partition");
bool metadata_equal= false;
- memset(&part_create_info, 0, sizeof(HA_CREATE_INFO));
- memset(&table_create_info, 0, sizeof(HA_CREATE_INFO));
+ part_create_info.init();
+ table_create_info.init();
update_create_info_from_table(&table_create_info, table);
/* get the current auto_increment value */
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 3967b4d57a9..8a722ad3952 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -1902,8 +1902,20 @@ static int mysql_test_show_grants(Prepared_statement *stmt)
DBUG_ENTER("mysql_test_show_grants");
THD *thd= stmt->thd;
List<Item> fields;
+ char buff[1024];
+ const char *username= NULL, *hostname= NULL, *rolename= NULL, *end;
- mysql_show_grants_get_fields(thd, &fields, STRING_WITH_LEN("Grants for"));
+ if (get_show_user(thd, thd->lex->grant_user, &username, &hostname, &rolename))
+ DBUG_RETURN(1);
+
+ if (username)
+ end= strxmov(buff,"Grants for ",username,"@",hostname, NullS);
+ else if (rolename)
+ end= strxmov(buff,"Grants for ",rolename, NullS);
+ else
+ DBUG_RETURN(1);
+
+ mysql_show_grants_get_fields(thd, &fields, buff, (uint)(end - buff));
DBUG_RETURN(send_stmt_metadata(thd, stmt, &fields));
}
#endif /*NO_EMBEDDED_ACCESS_CHECKS*/
@@ -1927,7 +1939,7 @@ static int mysql_test_show_slave_status(Prepared_statement *stmt)
THD *thd= stmt->thd;
List<Item> fields;
- show_master_info_get_fields(thd, &fields, 0, 0);
+ show_master_info_get_fields(thd, &fields, thd->lex->verbose, 0);
DBUG_RETURN(send_stmt_metadata(thd, stmt, &fields));
}
@@ -2478,6 +2490,7 @@ static bool check_prepared_statement(Prepared_statement *stmt)
case SQLCOM_CREATE_INDEX:
case SQLCOM_DROP_INDEX:
case SQLCOM_ROLLBACK:
+ case SQLCOM_ROLLBACK_TO_SAVEPOINT:
case SQLCOM_TRUNCATE:
case SQLCOM_DROP_VIEW:
case SQLCOM_REPAIR:
@@ -2497,6 +2510,7 @@ static bool check_prepared_statement(Prepared_statement *stmt)
case SQLCOM_ALTER_DB_UPGRADE:
case SQLCOM_CHECKSUM:
case SQLCOM_CREATE_USER:
+ case SQLCOM_ALTER_USER:
case SQLCOM_RENAME_USER:
case SQLCOM_DROP_USER:
case SQLCOM_CREATE_ROLE:
@@ -2506,6 +2520,7 @@ static bool check_prepared_statement(Prepared_statement *stmt)
case SQLCOM_GRANT:
case SQLCOM_GRANT_ROLE:
case SQLCOM_REVOKE:
+ case SQLCOM_REVOKE_ALL:
case SQLCOM_REVOKE_ROLE:
case SQLCOM_KILL:
case SQLCOM_COMPOUND:
@@ -2534,14 +2549,12 @@ static bool check_prepared_statement(Prepared_statement *stmt)
{
if (lex->describe || lex->analyze_stmt)
{
- if (!lex->result &&
- !(lex->result= new (stmt->mem_root) select_send(thd)))
- DBUG_RETURN(TRUE);
+ select_send result(thd);
List<Item> field_list;
- thd->prepare_explain_fields(lex->result, &field_list,
- lex->describe, lex->analyze_stmt);
- res= send_prep_stmt(stmt, lex->result->field_count(field_list)) ||
- lex->result->send_result_set_metadata(field_list,
+ res= thd->prepare_explain_fields(&result, &field_list,
+ lex->describe, lex->analyze_stmt) ||
+ send_prep_stmt(stmt, result.field_count(field_list)) ||
+ result.send_result_set_metadata(field_list,
Protocol::SEND_EOF);
}
else
diff --git a/sql/sql_priv.h b/sql/sql_priv.h
index 25384527c10..4332a6961d9 100644
--- a/sql/sql_priv.h
+++ b/sql/sql_priv.h
@@ -175,12 +175,6 @@
*/
#define OPTION_MASTER_SQL_ERROR (1ULL << 35)
-/*
- Dont report errors for individual rows,
- But just report error on commit (or read ofcourse)
- Note! Reserved for use in MySQL Cluster
-*/
-#define OPTION_ALLOW_BATCH (1ULL << 36) // THD, intern (slave)
#define OPTION_SKIP_REPLICATION (1ULL << 37) // THD, user
#define OPTION_RPL_SKIP_PARALLEL (1ULL << 38)
#define OPTION_NO_QUERY_CACHE (1ULL << 39) // SELECT, user
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index b5b69a8f6c0..c8974721d09 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -3142,7 +3142,7 @@ bool JOIN::make_aggr_tables_info()
aggr_tables++;
curr_tab= join_tab + exec_join_tab_cnt();
- bzero(curr_tab, sizeof(JOIN_TAB));
+ bzero((void*)curr_tab, sizeof(JOIN_TAB));
curr_tab->ref.key= -1;
curr_tab->join= this;
@@ -3232,7 +3232,7 @@ bool JOIN::make_aggr_tables_info()
{
aggr_tables++;
curr_tab= join_tab + exec_join_tab_cnt();
- bzero(curr_tab, sizeof(JOIN_TAB));
+ bzero((void*)curr_tab, sizeof(JOIN_TAB));
curr_tab->ref.key= -1;
if (only_const_tables())
first_select= sub_select_postjoin_aggr;
@@ -3360,7 +3360,7 @@ bool JOIN::make_aggr_tables_info()
curr_tab++;
aggr_tables++;
- bzero(curr_tab, sizeof(JOIN_TAB));
+ bzero((void*)curr_tab, sizeof(JOIN_TAB));
curr_tab->ref.key= -1;
/* group data to new table */
@@ -4786,7 +4786,7 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list,
DBUG_RETURN(1);
/* The following should be optimized to only clear critical things */
- bzero(stat, sizeof(JOIN_TAB)* table_count);
+ bzero((void*)stat, sizeof(JOIN_TAB)* table_count);
/* Initialize POSITION objects */
for (i=0 ; i <= table_count ; i++)
(void) new ((char*) (join->positions + i)) POSITION;
@@ -10148,7 +10148,7 @@ bool JOIN::get_best_combination()
1. Put into main join order a JOIN_TAB that represents a lookup or scan
in the temptable.
*/
- bzero(j, sizeof(JOIN_TAB));
+ bzero((void*)j, sizeof(JOIN_TAB));
j->join= this;
j->table= NULL; //temporary way to tell SJM tables from others.
j->ref.key = -1;
@@ -18625,7 +18625,7 @@ bool Virtual_tmp_table::init(uint field_count)
&bitmaps, bitmap_buffer_size(field_count) * 6,
NullS))
DBUG_RETURN(true);
- bzero(s, sizeof(*s));
+ s->reset();
s->blob_field= blob_field;
setup_tmp_table_column_bitmaps(this, bitmaps, field_count);
m_alloced_field_count= field_count;
@@ -21891,7 +21891,8 @@ make_cond_for_table_from_pred(THD *thd, Item *root_cond, Item *cond,
the new parent Item. This should not be expensive because all
children of Item_cond_and should be fixed by now.
*/
- new_cond->fix_fields(thd, 0);
+ if (new_cond->fix_fields(thd, 0))
+ return (COND*) 0;
new_cond->used_tables_cache=
((Item_cond_and*) cond)->used_tables_cache &
tables;
diff --git a/sql/sql_select.h b/sql/sql_select.h
index dcf95f04702..55ab94186ad 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -246,7 +246,6 @@ struct SplM_plan_info;
class SplM_opt_info;
typedef struct st_join_table {
- st_join_table() {}
TABLE *table;
TABLE_LIST *tab_list;
KEYUSE *keyuse; /**< pointer to first used key */
@@ -2157,9 +2156,9 @@ public:
static void operator delete(void *ptr, size_t size) { TRASH_FREE(ptr, size); }
static void operator delete(void *, THD *) throw(){}
- Virtual_tmp_table(THD *thd)
+ Virtual_tmp_table(THD *thd) : m_alloced_field_count(0)
{
- bzero(this, sizeof(*this));
+ reset();
temp_pool_slot= MY_BIT_NONE;
in_use= thd;
copy_blobs= true;
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 07ef2b675f2..6f964b6901f 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -1239,13 +1239,56 @@ mysqld_show_create_get_fields(THD *thd, TABLE_LIST *table_list,
List<Item> *field_list, String *buffer)
{
bool error= TRUE;
+ LEX *lex= thd->lex;
MEM_ROOT *mem_root= thd->mem_root;
DBUG_ENTER("mysqld_show_create_get_fields");
DBUG_PRINT("enter",("db: %s table: %s",table_list->db.str,
table_list->table_name.str));
+ if (lex->table_type == TABLE_TYPE_VIEW)
+ {
+ if (check_table_access(thd, SELECT_ACL, table_list, FALSE, 1, FALSE))
+ {
+ DBUG_PRINT("debug", ("check_table_access failed"));
+ my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0),
+ "SHOW", thd->security_ctx->priv_user,
+ thd->security_ctx->host_or_ip, table_list->alias.str);
+ goto exit;
+ }
+ DBUG_PRINT("debug", ("check_table_access succeeded"));
+
+ /* Ignore temporary tables if this is "SHOW CREATE VIEW" */
+ table_list->open_type= OT_BASE_ONLY;
+ }
+ else
+ {
+ /*
+ Temporary tables should be opened for SHOW CREATE TABLE, but not
+ for SHOW CREATE VIEW.
+ */
+ if (thd->open_temporary_tables(table_list))
+ goto exit;
+
+ /*
+ The fact that check_some_access() returned FALSE does not mean that
+ access is granted. We need to check if table_list->grant.privilege
+ contains any table-specific privilege.
+ */
+ DBUG_PRINT("debug", ("table_list->grant.privilege: %lx",
+ table_list->grant.privilege));
+ if (check_some_access(thd, SHOW_CREATE_TABLE_ACLS, table_list) ||
+ (table_list->grant.privilege & SHOW_CREATE_TABLE_ACLS) == 0)
+ {
+ my_error(ER_TABLEACCESS_DENIED_ERROR, MYF(0),
+ "SHOW", thd->security_ctx->priv_user,
+ thd->security_ctx->host_or_ip, table_list->alias.str);
+ goto exit;
+ }
+ }
+ /* Access is granted. Execute the command. */
+
/* We want to preserve the tree for views. */
- thd->lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_VIEW;
+ lex->context_analysis_only|= CONTEXT_ANALYSIS_ONLY_VIEW;
{
/*
@@ -1260,20 +1303,20 @@ mysqld_show_create_get_fields(THD *thd, TABLE_LIST *table_list,
bool open_error=
open_tables(thd, &table_list, &counter,
MYSQL_OPEN_FORCE_SHARED_HIGH_PRIO_MDL) ||
- mysql_handle_derived(thd->lex, DT_INIT | DT_PREPARE);
+ mysql_handle_derived(lex, DT_INIT | DT_PREPARE);
thd->pop_internal_handler();
if (unlikely(open_error && (thd->killed || thd->is_error())))
goto exit;
}
/* TODO: add environment variables show when it become possible */
- if (thd->lex->table_type == TABLE_TYPE_VIEW && !table_list->view)
+ if (lex->table_type == TABLE_TYPE_VIEW && !table_list->view)
{
my_error(ER_WRONG_OBJECT, MYF(0),
table_list->db.str, table_list->table_name.str, "VIEW");
goto exit;
}
- else if (thd->lex->table_type == TABLE_TYPE_SEQUENCE &&
+ else if (lex->table_type == TABLE_TYPE_SEQUENCE &&
table_list->table->s->table_type != TABLE_TYPE_SEQUENCE)
{
my_error(ER_NOT_SEQUENCE, MYF(0),
@@ -1288,7 +1331,7 @@ mysqld_show_create_get_fields(THD *thd, TABLE_LIST *table_list,
if ((table_list->view ?
show_create_view(thd, table_list, buffer) :
- thd->lex->table_type == TABLE_TYPE_SEQUENCE ?
+ lex->table_type == TABLE_TYPE_SEQUENCE ?
show_create_sequence(thd, table_list, buffer) :
show_create_table(thd, table_list, buffer, NULL, WITHOUT_DB_NAME)))
goto exit;
@@ -5509,7 +5552,7 @@ static int get_schema_tables_record(THD *thd, TABLE_LIST *tables,
if (file)
{
HA_CREATE_INFO create_info;
- memset(&create_info, 0, sizeof(create_info));
+ create_info.init();
file->update_create_info(&create_info);
append_directory(thd, &str, "DATA", create_info.data_file_name);
append_directory(thd, &str, "INDEX", create_info.index_file_name);
@@ -6690,7 +6733,7 @@ static int get_schema_views_record(THD *thd, TABLE_LIST *tables,
{
TABLE_LIST table_list;
uint view_access;
- memset(&table_list, 0, sizeof(table_list));
+ table_list.reset();
table_list.db= tables->db;
table_list.table_name= tables->table_name;
table_list.grant.privilege= thd->col_access;
diff --git a/sql/sql_string.h b/sql/sql_string.h
index a4574c2ef2d..fa941c8156e 100644
--- a/sql/sql_string.h
+++ b/sql/sql_string.h
@@ -27,6 +27,7 @@
#include "m_ctype.h" /* my_charset_bin */
#include <my_sys.h> /* alloc_root, my_free, my_realloc */
#include "m_string.h" /* TRASH */
+#include "sql_list.h"
class String;
typedef struct st_io_cache IO_CACHE;
@@ -165,7 +166,7 @@ public:
A storage for String.
Should be eventually derived from LEX_STRING.
*/
-class Static_binary_string
+class Static_binary_string : public Sql_alloc
{
protected:
char *Ptr;
@@ -181,24 +182,6 @@ public:
{
DBUG_ASSERT(length_arg < UINT_MAX32);
}
-
- static void *operator new(size_t size, MEM_ROOT *mem_root) throw ()
- { return (void*) alloc_root(mem_root, size); }
- static void *operator new[](size_t size, MEM_ROOT *mem_root) throw ()
- { return alloc_root(mem_root, size); }
- static void operator delete(void *ptr_arg, size_t size)
- {
- (void) ptr_arg;
- (void) size;
- TRASH_FREE(ptr_arg, size);
- }
- static void operator delete(void *, MEM_ROOT *)
- { /* never called */ }
- static void operator delete[](void *ptr, size_t size)
- { TRASH_FREE(ptr, size); }
- static void operator delete[](void *, MEM_ROOT *)
- { /* never called */ }
-
inline uint32 length() const { return str_length;}
inline char& operator [] (size_t i) const { return Ptr[i]; }
inline void length(size_t len) { str_length=(uint32)len ; }
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index fe7a2335d2d..ad62ecc1103 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -10813,8 +10813,6 @@ bool mysql_recreate_table(THD *thd, TABLE_LIST *table_list, bool table_copy)
if (table_copy)
alter_info.requested_algorithm= Alter_info::ALTER_TABLE_ALGORITHM_COPY;
- thd->prepare_logs_for_admin_command();
-
bool res= mysql_alter_table(thd, &null_clex_str, &null_clex_str, &create_info,
table_list, &alter_info, 0,
(ORDER *) 0, 0);
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index 61660a964ff..96f21bc47a7 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -1796,7 +1796,7 @@ bool Table_triggers_list::drop_all_triggers(THD *thd, const LEX_CSTRING *db,
bool result= 0;
DBUG_ENTER("Triggers::drop_all_triggers");
- bzero(&table, sizeof(table));
+ table.reset();
init_sql_alloc(&table.mem_root, "Triggers::drop_all_triggers", 8192, 0,
MYF(0));
@@ -2048,7 +2048,7 @@ bool Table_triggers_list::change_table_name(THD *thd, const LEX_CSTRING *db,
Trigger *err_trigger;
DBUG_ENTER("Triggers::change_table_name");
- bzero(&table, sizeof(table));
+ table.reset();
init_sql_alloc(&table.mem_root, "Triggers::change_table_name", 8192, 0,
MYF(0));
diff --git a/sql/sql_tvc.cc b/sql/sql_tvc.cc
index 0e4caae7a2f..f16d34e8041 100644
--- a/sql/sql_tvc.cc
+++ b/sql/sql_tvc.cc
@@ -230,29 +230,29 @@ bool table_value_constr::prepare(THD *thd, SELECT_LEX *sl,
if (fix_fields_for_tvc(thd, li))
DBUG_RETURN(true);
- if (!(holders= new (thd->mem_root)
- Type_holder[cnt]) ||
- join_type_handlers_for_tvc(thd, li, holders,
- cnt) ||
+ if (!(holders= new (thd->stmt_arena->mem_root) Type_holder[cnt]) ||
+ join_type_handlers_for_tvc(thd, li, holders, cnt) ||
get_type_attributes_for_tvc(thd, li, holders,
lists_of_values.elements, cnt))
DBUG_RETURN(true);
List_iterator_fast<Item> it(*first_elem);
Item *item;
+ Query_arena *arena, backup;
+ arena=thd->activate_stmt_arena_if_needed(&backup);
sl->item_list.empty();
for (uint pos= 0; (item= it++); pos++)
{
/* Error's in 'new' will be detected after loop */
Item_type_holder *new_holder= new (thd->mem_root)
- Item_type_holder(thd,
- item,
- holders[pos].type_handler(),
+ Item_type_holder(thd, item, holders[pos].type_handler(),
&holders[pos]/*Type_all_attributes*/,
holders[pos].get_maybe_null());
sl->item_list.push_back(new_holder);
}
+ if (arena)
+ thd->restore_active_arena(arena, &backup);
if (unlikely(thd->is_fatal_error))
DBUG_RETURN(true); // out of memory
diff --git a/sql/sql_union.cc b/sql/sql_union.cc
index a1d86959218..528292e5177 100644
--- a/sql/sql_union.cc
+++ b/sql/sql_union.cc
@@ -1240,15 +1240,6 @@ cont:
allocation in setup_ref_array().
*/
fake_select_lex->n_child_sum_items+= global_parameters()->n_sum_items;
-
- saved_error= fake_select_lex->join->
- prepare(fake_select_lex->table_list.first,
- 0, 0,
- global_parameters()->order_list.elements, // og_num
- global_parameters()->order_list.first, // order
- false, NULL, NULL, NULL,
- fake_select_lex, this);
- fake_select_lex->table_list.empty();
}
}
else
@@ -1259,6 +1250,24 @@ cont:
*/
table->reset_item_list(&item_list, intersect_mark ? 1 : 0);
}
+ if (fake_select_lex != NULL &&
+ (thd->stmt_arena->is_stmt_prepare() ||
+ (thd->lex->context_analysis_only & CONTEXT_ANALYSIS_ONLY_VIEW)))
+ {
+ if (!fake_select_lex->join &&
+ !(fake_select_lex->join=
+ new JOIN(thd, item_list, thd->variables.option_bits, result)))
+ {
+ fake_select_lex->table_list.empty();
+ DBUG_RETURN(TRUE);
+ }
+ saved_error= fake_select_lex->join->
+ prepare(fake_select_lex->table_list.first, 0, 0,
+ global_parameters()->order_list.elements, // og_num
+ global_parameters()->order_list.first, // order
+ false, NULL, NULL, NULL, fake_select_lex, this);
+ fake_select_lex->table_list.empty();
+ }
}
thd->lex->current_select= lex_select_save;
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index 31032c5cd5e..ec1141668b5 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -216,7 +216,8 @@ fill_defined_view_parts (THD *thd, TABLE_LIST *view)
LEX *lex= thd->lex;
TABLE_LIST decoy;
- memcpy (&decoy, view, sizeof (TABLE_LIST));
+ decoy= *view;
+ decoy.mdl_request.key.mdl_key_init(&view->mdl_request.key);
if (tdc_open_view(thd, &decoy, OPEN_VIEW_NO_PARSE))
return TRUE;
@@ -330,12 +331,11 @@ bool create_view_precheck(THD *thd, TABLE_LIST *tables, TABLE_LIST *view,
{
if (!tbl->table_in_first_from_clause)
{
- if (check_access(thd, SELECT_ACL, tbl->db.str,
- &tbl->grant.privilege,
- &tbl->grant.m_internal,
- 0, 0) ||
- check_grant(thd, SELECT_ACL, tbl, FALSE, 1, FALSE))
+ if (check_single_table_access(thd, SELECT_ACL, tbl, FALSE))
+ {
+ tbl->hide_view_error(thd);
goto err;
+ }
}
}
}
@@ -912,15 +912,8 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
View definition query is stored in the client character set.
*/
- char view_query_buff[4096];
- String view_query(view_query_buff,
- sizeof (view_query_buff),
- thd->charset());
-
- char is_query_buff[4096];
- String is_query(is_query_buff,
- sizeof (is_query_buff),
- system_charset_info);
+ StringBuffer<4096> view_query(thd->charset());
+ StringBuffer<4096> is_query(system_charset_info);
char md5[MD5_BUFF_LENGTH];
bool can_be_merged;
@@ -2197,7 +2190,7 @@ mysql_rename_view(THD *thd,
view definition parsing or use temporary 'view_def'
object for it.
*/
- bzero(&view_def, sizeof(view_def));
+ view_def.reset();
view_def.timestamp.str= view_def.timestamp_buffer;
view_def.view_suid= TRUE;
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy
index 5c911928a9a..5869f51cb1c 100644
--- a/sql/sql_yacc.yy
+++ b/sql/sql_yacc.yy
@@ -6250,7 +6250,7 @@ create_table_option:
from the global list.
*/
LEX *lex=Lex;
- lex->create_info.merge_list= lex->first_select_lex()->table_list;
+ lex->create_info.merge_list= lex->first_select_lex()->table_list.first;
lex->first_select_lex()->table_list= lex->save_list;
/*
When excluding union list from the global list we assume that
@@ -6259,7 +6259,7 @@ create_table_option:
*/
TABLE_LIST *last_non_sel_table= lex->create_last_non_select_table;
DBUG_ASSERT(last_non_sel_table->next_global ==
- lex->create_info.merge_list.first);
+ lex->create_info.merge_list);
last_non_sel_table->next_global= 0;
Lex->query_tables_last= &last_non_sel_table->next_global;
diff --git a/sql/sql_yacc_ora.yy b/sql/sql_yacc_ora.yy
index b6ea6ba9970..39095bc8e88 100644
--- a/sql/sql_yacc_ora.yy
+++ b/sql/sql_yacc_ora.yy
@@ -6275,7 +6275,7 @@ create_table_option:
from the global list.
*/
LEX *lex=Lex;
- lex->create_info.merge_list= lex->first_select_lex()->table_list;
+ lex->create_info.merge_list= lex->first_select_lex()->table_list.first;
lex->first_select_lex()->table_list= lex->save_list;
/*
When excluding union list from the global list we assume that
@@ -6284,7 +6284,7 @@ create_table_option:
*/
TABLE_LIST *last_non_sel_table= lex->create_last_non_select_table;
DBUG_ASSERT(last_non_sel_table->next_global ==
- lex->create_info.merge_list.first);
+ lex->create_info.merge_list);
last_non_sel_table->next_global= 0;
Lex->query_tables_last= &last_non_sel_table->next_global;
@@ -14898,6 +14898,7 @@ load:
}
if (Lex->main_select_push())
MYSQL_YYABORT;
+ mysql_init_select(lex);
}
load_data_lock opt_local INFILE TEXT_STRING_filesystem
{
diff --git a/sql/table.h b/sql/table.h
index c88398bf3c7..2d2510c24fd 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -830,6 +830,8 @@ struct TABLE_SHARE
/** Instrumentation for this table share. */
PSI_table_share *m_psi;
+ inline void reset() { bzero((void*)this, sizeof(*this)); }
+
/*
Set share's table cache key and update its db and table name appropriately.
@@ -1401,6 +1403,8 @@ public:
SplM_opt_info *spl_opt_info;
key_map keys_usable_for_splitting;
+
+ inline void reset() { bzero((void*)this, sizeof(*this)); }
void init(THD *thd, TABLE_LIST *tl);
bool fill_item_list(List<Item> *item_list) const;
void reset_item_list(List<Item> *item_list, uint skip) const;
@@ -2004,6 +2008,7 @@ struct TABLE_LIST
Prepare TABLE_LIST that consists of one table instance to use in
open_and_lock_tables
*/
+ inline void reset() { bzero((void*)this, sizeof(*this)); }
inline void init_one_table(const LEX_CSTRING *db_arg,
const LEX_CSTRING *table_name_arg,
const LEX_CSTRING *alias_arg,
@@ -2017,7 +2022,7 @@ struct TABLE_LIST
else
mdl_type= MDL_SHARED_READ;
- bzero((char*) this, sizeof(*this));
+ reset();
DBUG_ASSERT(!db_arg->str || strlen(db_arg->str) == db_arg->length);
DBUG_ASSERT(!table_name_arg->str || strlen(table_name_arg->str) == table_name_arg->length);
DBUG_ASSERT(!alias_arg || strlen(alias_arg->str) == alias_arg->length);
@@ -2549,8 +2554,7 @@ struct TABLE_LIST
@sa check_and_update_table_version()
*/
- inline
- bool is_table_ref_id_equal(TABLE_SHARE *s) const
+ inline bool is_table_ref_id_equal(TABLE_SHARE *s) const
{
return (m_table_ref_type == s->get_table_ref_type() &&
m_table_ref_version == s->get_table_ref_version());
@@ -2562,12 +2566,10 @@ struct TABLE_LIST
@sa check_and_update_table_version()
*/
- inline
- void set_table_ref_id(TABLE_SHARE *s)
+ inline void set_table_ref_id(TABLE_SHARE *s)
{ set_table_ref_id(s->get_table_ref_type(), s->get_table_ref_version()); }
- inline
- void set_table_ref_id(enum_table_ref_type table_ref_type_arg,
+ inline void set_table_ref_id(enum_table_ref_type table_ref_type_arg,
ulong table_ref_version_arg)
{
m_table_ref_type= table_ref_type_arg;
diff --git a/sql/tztime.cc b/sql/tztime.cc
index 177521e5a55..fb158480b21 100644
--- a/sql/tztime.cc
+++ b/sql/tztime.cc
@@ -1531,14 +1531,10 @@ my_offset_tzs_get_key(Time_zone_offset *entry,
static void
tz_init_table_list(TABLE_LIST *tz_tabs)
{
- bzero(tz_tabs, sizeof(TABLE_LIST) * MY_TZ_TABLES_COUNT);
-
for (int i= 0; i < MY_TZ_TABLES_COUNT; i++)
{
- tz_tabs[i].alias= tz_tabs[i].table_name= tz_tables_names[i];
- tz_tabs[i].db= MYSQL_SCHEMA_NAME;
- tz_tabs[i].lock_type= TL_READ;
-
+ tz_tabs[i].init_one_table(&MYSQL_SCHEMA_NAME, tz_tables_names + i,
+ NULL, TL_READ);
if (i != MY_TZ_TABLES_COUNT - 1)
tz_tabs[i].next_global= tz_tabs[i].next_local= &tz_tabs[i+1];
if (i != 0)
diff --git a/storage/innobase/buf/buf0buddy.cc b/storage/innobase/buf/buf0buddy.cc
index f932195897c..bd8d575d8c2 100644
--- a/storage/innobase/buf/buf0buddy.cc
+++ b/storage/innobase/buf/buf0buddy.cc
@@ -358,7 +358,7 @@ buf_buddy_alloc_zip(
if (buf) {
/* Trash the page other than the BUF_BUDDY_STAMP_NONFREE. */
- UNIV_MEM_TRASH(buf, ~i, BUF_BUDDY_STAMP_OFFSET);
+ UNIV_MEM_TRASH((void*) buf, ~i, BUF_BUDDY_STAMP_OFFSET);
UNIV_MEM_TRASH(BUF_BUDDY_STAMP_OFFSET + 4
+ buf->stamp.bytes, ~i,
(BUF_BUDDY_LOW << i)
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 92a880e70ed..ee0e7316205 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -1590,8 +1590,7 @@ buf_chunk_init(
DBUG_EXECUTE_IF("ib_buf_chunk_init_fails", return(NULL););
- chunk->mem = buf_pool->allocator.allocate_large(mem_size,
- &chunk->mem_pfx, true);
+ chunk->mem = buf_pool->allocator.allocate_large_dontdump(mem_size, &chunk->mem_pfx);
if (UNIV_UNLIKELY(chunk->mem == NULL)) {
@@ -1890,9 +1889,8 @@ buf_pool_init_instance(
buf_block_free_mutexes(block);
}
- buf_pool->allocator.deallocate_large(
- chunk->mem, &chunk->mem_pfx, chunk->mem_size(),
- true);
+ buf_pool->allocator.deallocate_large_dodump(
+ chunk->mem, &chunk->mem_pfx, chunk->mem_size());
}
ut_free(buf_pool->chunks);
buf_pool_mutex_exit(buf_pool);
@@ -2035,8 +2033,8 @@ buf_pool_free_instance(
buf_block_free_mutexes(block);
}
- buf_pool->allocator.deallocate_large(
- chunk->mem, &chunk->mem_pfx, true);
+ buf_pool->allocator.deallocate_large_dodump(
+ chunk->mem, &chunk->mem_pfx, chunk->mem_size());
}
for (ulint i = BUF_FLUSH_LRU; i < BUF_FLUSH_N_TYPES; ++i) {
@@ -2909,8 +2907,8 @@ withdraw_retry:
buf_block_free_mutexes(block);
}
- buf_pool->allocator.deallocate_large(
- chunk->mem, &chunk->mem_pfx, true);
+ buf_pool->allocator.deallocate_large_dodump(
+ chunk->mem, &chunk->mem_pfx, chunk->mem_size());
sum_freed += chunk->size;
diff --git a/storage/innobase/dict/dict0mem.cc b/storage/innobase/dict/dict0mem.cc
index 3d373bf37d8..2bd0cf2fada 100644
--- a/storage/innobase/dict/dict0mem.cc
+++ b/storage/innobase/dict/dict0mem.cc
@@ -2,7 +2,7 @@
Copyright (c) 1996, 2018, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc.
-Copyright (c) 2013, 2018, MariaDB Corporation.
+Copyright (c) 2013, 2019, 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
@@ -1083,14 +1083,7 @@ dict_mem_index_free(
mem_heap_free(index->heap);
}
-/** Create a temporary tablename like "#sql-ibtid-inc where
- tid = the Table ID
- inc = a randomly initialized number that is incremented for each file
-The table ID is a 64 bit integer, can use up to 20 digits, and is
-initialized at bootstrap. The second number is 32 bits, can use up to 10
-digits, and is initialized at startup to a randomly distributed number.
-It is hoped that the combination of these two numbers will provide a
-reasonably unique temporary file name.
+/** Create a temporary tablename like "#sql-ibNNN".
@param[in] heap A memory heap
@param[in] dbtab Table name in the form database/table name
@param[in] id Table id
diff --git a/storage/innobase/dict/dict0stats_bg.cc b/storage/innobase/dict/dict0stats_bg.cc
index ae31b3d0e37..603122903ff 100644
--- a/storage/innobase/dict/dict0stats_bg.cc
+++ b/storage/innobase/dict/dict0stats_bg.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2012, 2017, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2018, MariaDB Corporation.
+Copyright (c) 2017, 2019, 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
@@ -166,10 +166,26 @@ void dict_stats_update_if_needed_func(dict_table_t* table)
&& dict_stats_auto_recalc_is_enabled(table)) {
#ifdef WITH_WSREP
- if (thd && wsrep_on(thd) && wsrep_thd_is_BF(thd, 0)) {
+ /* Do not add table to background
+ statistic calculation if this thread is not a
+ applier (as all DDL, which is replicated (i.e
+ is binlogged in master node), will be executed
+ with high priority (a.k.a BF) in slave nodes)
+ and is BF. This could again lead BF lock
+ waits in applier node but it is better than
+ no persistent index/table statistics at
+ applier nodes. TODO: allow BF threads
+ wait for these InnoDB internal SQL-parser
+ generated row locks and allow BF thread
+ lock waits to be enqueued at head of waiting
+ queue. */
+ if (thd
+ && !wsrep_thd_is_applying(thd)
+ && wsrep_on(thd)
+ && wsrep_thd_is_BF(thd, 0)) {
WSREP_DEBUG("Avoiding background statistics"
- " calculation for table %s",
- table->name.m_name);
+ " calculation for table %s.",
+ table->name.m_name);
return;
}
#endif /* WITH_WSREP */
diff --git a/storage/innobase/fsp/fsp0file.cc b/storage/innobase/fsp/fsp0file.cc
index dbd7d4dd741..d5301f8bfb9 100644
--- a/storage/innobase/fsp/fsp0file.cc
+++ b/storage/innobase/fsp/fsp0file.cc
@@ -516,9 +516,9 @@ Datafile::validate_first_page(lsn_t* flush_lsn)
if (error_txt != NULL) {
err_exit:
- ib::error() << error_txt << " in datafile: " << m_filepath
+ ib::info() << error_txt << " in datafile: " << m_filepath
<< ", Space ID:" << m_space_id << ", Flags: "
- << m_flags << ". " << TROUBLESHOOT_DATADICT_MSG;
+ << m_flags;
m_is_valid = false;
free_first_page();
return(DB_CORRUPTION);
@@ -565,8 +565,7 @@ err_exit:
goto err_exit;
}
- if (m_space_id == ULINT_UNDEFINED) {
- /* The space_id can be most anything, except -1. */
+ if (m_space_id >= SRV_LOG_SPACE_FIRST_ID) {
error_txt = "A bad Space ID was found";
goto err_exit;
}
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 06f2beea97c..97969028389 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -2899,7 +2899,6 @@ ha_innobase::ha_innobase(
TABLE_SHARE* table_arg)
:handler(hton, table_arg),
m_prebuilt(),
- m_prebuilt_ptr(&m_prebuilt),
m_user_thd(),
m_int_table_flags(HA_REC_NOT_IN_SEQ
| HA_NULL_IN_KEY
@@ -5876,7 +5875,7 @@ innobase_build_v_templ(
Field* field = table->field[i];
/* Build template for virtual columns */
- if (innobase_is_v_fld(field)) {
+ if (!field->stored_in_db()) {
#ifdef UNIV_DEBUG
const char* name;
@@ -7330,7 +7329,7 @@ build_template_needs_field(
{
const Field* field = table->field[i];
- if (innobase_is_v_fld(field) && omits_virtual_cols(*table->s)) {
+ if (!field->stored_in_db() && omits_virtual_cols(*table->s)) {
return NULL;
}
@@ -7410,7 +7409,7 @@ build_template_field(
templ = prebuilt->mysql_template + prebuilt->n_template++;
UNIV_MEM_INVALID(templ, sizeof *templ);
- templ->is_virtual = innobase_is_v_fld(field);
+ templ->is_virtual = !field->stored_in_db();
if (!templ->is_virtual) {
templ->col_no = i;
@@ -7664,7 +7663,7 @@ ha_innobase::build_template(
/* Push down an index condition or an end_range check. */
for (ulint i = 0; i < n_fields; i++) {
const Field* field = table->field[i];
- const bool is_v = innobase_is_v_fld(field);
+ const bool is_v = !field->stored_in_db();
if (is_v && skip_virtual) {
num_v++;
continue;
@@ -7803,7 +7802,7 @@ ha_innobase::build_template(
for (ulint i = 0; i < n_fields; i++) {
mysql_row_templ_t* templ;
const Field* field = table->field[i];
- const bool is_v = innobase_is_v_fld(field);
+ const bool is_v = !field->stored_in_db();
if (is_v && skip_virtual) {
num_v++;
continue;
@@ -7853,7 +7852,7 @@ no_icp:
for (ulint i = 0; i < n_fields; i++) {
const Field* field = table->field[i];
- const bool is_v = innobase_is_v_fld(field);
+ const bool is_v = !field->stored_in_db();
if (whole_row) {
if (is_v && skip_virtual) {
@@ -8377,8 +8376,9 @@ calc_row_difference(
for (uint i = 0; i < table->s->fields; i++) {
field = table->field[i];
- const bool is_virtual = innobase_is_v_fld(field);
+ const bool is_virtual = !field->stored_in_db();
if (is_virtual && skip_virtual) {
+ num_v++;
continue;
}
dict_col_t* col = is_virtual
@@ -8750,7 +8750,7 @@ wsrep_calc_row_hash(
byte true_byte=1;
const Field* field = table->field[i];
- if (innobase_is_v_fld(field)) {
+ if (!field->stored_in_db()) {
continue;
}
@@ -10730,8 +10730,6 @@ create_table_check_doc_id_col(
ULINT_UNDEFINED if column is of the
wrong type/name/size */
{
- ut_ad(!omits_virtual_cols(*form->s));
-
for (ulint i = 0; i < form->s->fields; i++) {
const Field* field;
ulint col_type;
@@ -10869,10 +10867,8 @@ innodb_base_col_setup_for_stored(
for (uint i= 0; i < field->table->s->fields; ++i) {
const Field* base_field = field->table->field[i];
- if (!innobase_is_s_fld(base_field)
- && !innobase_is_v_fld(base_field)
- && bitmap_is_set(&field->table->tmp_set,
- i)) {
+ if (!base_field->vcol_info
+ && bitmap_is_set(&field->table->tmp_set, i)) {
ulint z;
for (z = 0; z < table->n_cols; z++) {
const char* name = dict_table_get_col_name(
@@ -10903,7 +10899,6 @@ int
create_table_info_t::create_table_def()
{
dict_table_t* table;
- ulint n_cols;
ulint col_type;
ulint col_len;
ulint nulls_allowed;
@@ -10911,13 +10906,10 @@ create_table_info_t::create_table_def()
ulint binary_type;
ulint long_true_varchar;
ulint charset_no;
- ulint i;
ulint j = 0;
ulint doc_id_col = 0;
ibool has_doc_id_col = FALSE;
mem_heap_t* heap;
- ulint num_v = 0;
- ulint actual_n_cols;
ha_table_option_struct *options= m_form->s->option_struct;
dberr_t err = DB_SUCCESS;
@@ -10948,14 +10940,15 @@ create_table_info_t::create_table_def()
DBUG_RETURN(ER_WRONG_TABLE_NAME);
}
- n_cols = m_form->s->fields;
-
- /* Find out any virtual column */
- for (i = 0; i < n_cols; i++) {
- Field* field = m_form->field[i];
+ /* Find out the number of virtual columns. */
+ ulint num_v = 0;
+ const bool omit_virtual = omits_virtual_cols(*m_form->s);
+ const ulint n_cols = omit_virtual
+ ? m_form->s->stored_fields : m_form->s->fields;
- if (innobase_is_v_fld(field)) {
- num_v++;
+ if (!omit_virtual) {
+ for (ulint i = 0; i < n_cols; i++) {
+ num_v += !m_form->field[i]->stored_in_db();
}
}
@@ -10971,10 +10964,8 @@ create_table_info_t::create_table_def()
}
/* Adjust the number of columns for the FTS hidden field */
- actual_n_cols = n_cols;
- if (m_flags2 & DICT_TF2_FTS && !has_doc_id_col) {
- actual_n_cols += 1;
- }
+ const ulint actual_n_cols = n_cols
+ + (m_flags2 & DICT_TF2_FTS && !has_doc_id_col);
table = dict_mem_table_create(m_table_name, NULL,
actual_n_cols, num_v, m_flags, m_flags2);
@@ -10997,10 +10988,7 @@ create_table_info_t::create_table_def()
heap = mem_heap_create(1000);
- for (i = 0; i < n_cols; i++) {
- ulint is_virtual;
- bool is_stored = false;
-
+ for (ulint i = 0; i < n_cols; i++) {
Field* field = m_form->field[i];
ulint vers_row = 0;
@@ -11078,9 +11066,6 @@ create_table_info_t::create_table_def()
}
}
- is_virtual = (innobase_is_v_fld(field)) ? DATA_VIRTUAL : 0;
- is_stored = innobase_is_s_fld(field);
-
/* First check whether the column to be added has a
system reserved name. */
if (dict_col_name_is_reserved(field->field_name.str)){
@@ -11093,6 +11078,8 @@ err_col:
DBUG_RETURN(HA_ERR_GENERIC);
}
+ ulint is_virtual = !field->stored_in_db() ? DATA_VIRTUAL : 0;
+
if (!is_virtual) {
dict_mem_table_add_col(table, heap,
field->field_name.str, col_type,
@@ -11103,7 +11090,7 @@ err_col:
| vers_row,
charset_no),
col_len);
- } else {
+ } else if (!omit_virtual) {
dict_mem_table_add_v_col(table, heap,
field->field_name.str, col_type,
dtype_form_prtype(
@@ -11116,7 +11103,7 @@ err_col:
col_len, i, 0);
}
- if (is_stored) {
+ if (innobase_is_s_fld(field)) {
ut_ad(!is_virtual);
/* Added stored column in m_s_cols list. */
dict_mem_table_add_s_col(
@@ -11125,12 +11112,12 @@ err_col:
}
if (num_v) {
- for (i = 0; i < n_cols; i++) {
+ for (ulint i = 0; i < n_cols; i++) {
dict_v_col_t* v_col;
- Field* field = m_form->field[i];
+ const Field* field = m_form->field[i];
- if (!innobase_is_v_fld(field)) {
+ if (field->stored_in_db()) {
continue;
}
@@ -11144,8 +11131,7 @@ err_col:
/** Fill base columns for the stored column present in the list. */
if (table->s_cols && table->s_cols->size()) {
-
- for (i = 0; i < n_cols; i++) {
+ for (ulint i = 0; i < n_cols; i++) {
Field* field = m_form->field[i];
if (!innobase_is_s_fld(field)) {
@@ -11258,17 +11244,17 @@ create_index(
key->user_defined_key_parts);
for (ulint i = 0; i < key->user_defined_key_parts; i++) {
- KEY_PART_INFO* key_part = key->key_part + i;
+ const Field* field = key->key_part[i].field;
/* We do not support special (Fulltext or Spatial)
index on virtual columns */
- if (innobase_is_v_fld(key_part->field)) {
+ if (!field->stored_in_db()) {
ut_ad(0);
DBUG_RETURN(HA_ERR_UNSUPPORTED);
}
- dict_mem_index_add_field(
- index, key_part->field->field_name.str, 0);
+ dict_mem_index_add_field(index, field->field_name.str,
+ 0);
}
DBUG_RETURN(convert_error_code_to_mysql(
@@ -11355,7 +11341,7 @@ create_index(
field_lengths[i] = key_part->length;
- if (innobase_is_v_fld(key_part->field)) {
+ if (!key_part->field->stored_in_db()) {
index->type |= DICT_VIRTUAL;
}
@@ -12317,19 +12303,17 @@ create_table_info_t::gcols_in_fulltext_or_spatial()
{
for (ulint i = 0; i < m_form->s->keys; i++) {
const KEY* key = m_form->key_info + i;
- if (key->flags & (HA_SPATIAL | HA_FULLTEXT)) {
- for (ulint j = 0; j < key->user_defined_key_parts; j++) {
- const KEY_PART_INFO* key_part = key->key_part + j;
-
- /* We do not support special (Fulltext or
- Spatial) index on virtual columns */
- if (innobase_is_v_fld(key_part->field)) {
- my_error(ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN, MYF(0));
- return true;
- }
+ if (!(key->flags & (HA_SPATIAL | HA_FULLTEXT))) {
+ continue;
+ }
+ for (ulint j = 0; j < key->user_defined_key_parts; j++) {
+ /* We do not support special (Fulltext or
+ Spatial) index on virtual columns */
+ if (!key->key_part[j].field->stored_in_db()) {
+ my_error(ER_UNSUPPORTED_ACTION_ON_GENERATED_COLUMN, MYF(0));
+ return true;
}
}
-
}
return false;
}
@@ -12610,7 +12594,7 @@ create_table_info_t::create_table_update_dict()
}
if (const Field* ai = m_form->found_next_number_field) {
- ut_ad(!innobase_is_v_fld(ai));
+ ut_ad(ai->stored_in_db());
ib_uint64_t autoinc = m_create_info->auto_increment_value;
@@ -13048,8 +13032,6 @@ inline int ha_innobase::delete_table(const char* name, enum_sql_command sqlcom)
}
}
- /* TODO: remove this when the conversion tool from ha_partition to
- native innodb partitioning is completed */
if (err == DB_TABLE_NOT_FOUND
&& innobase_get_lower_case_table_names() == 1) {
char* is_part = is_partition(norm_name);
@@ -13397,12 +13379,26 @@ int ha_innobase::truncate()
if (!err) {
/* Reopen the newly created table, and drop the
original table that was renamed to temp_name. */
- close();
+
+ row_prebuilt_t* prebuilt = m_prebuilt;
+ uchar* upd_buf = m_upd_buf;
+ ulint upd_buf_size = m_upd_buf_size;
+ /* Mimic ha_innobase::close(). */
+ m_prebuilt = NULL;
+ m_upd_buf = NULL;
+ m_upd_buf_size = 0;
err = open(name, 0, 0);
if (!err) {
m_prebuilt->stored_select_lock_type = stored_lock;
m_prebuilt->table->update_time = update_time;
+ row_prebuilt_free(prebuilt, FALSE);
delete_table(temp_name, SQLCOM_TRUNCATE);
+ my_free(upd_buf);
+ } else {
+ /* Revert to the old table before truncation. */
+ m_prebuilt = prebuilt;
+ m_upd_buf = upd_buf;
+ m_upd_buf_size = upd_buf_size;
}
}
@@ -14559,8 +14555,11 @@ ha_innobase::check(
/* We must run the index record counts at an isolation level
>= READ COMMITTED, because a dirty read can see a wrong number
of records in some index; to play safe, we use always
- REPEATABLE READ here */
- m_prebuilt->trx->isolation_level = TRX_ISO_REPEATABLE_READ;
+ REPEATABLE READ here (except when undo logs are unavailable) */
+ m_prebuilt->trx->isolation_level = srv_force_recovery
+ >= SRV_FORCE_NO_UNDO_LOG_SCAN
+ ? TRX_ISO_READ_UNCOMMITTED
+ : TRX_ISO_REPEATABLE_READ;
ut_ad(!m_prebuilt->table->corrupted);
diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h
index bdef141ed1c..4f97eebf3bf 100644
--- a/storage/innobase/handler/ha_innodb.h
+++ b/storage/innobase/handler/ha_innodb.h
@@ -476,10 +476,6 @@ protected:
/** Save CPU time with prebuilt/cached data structures */
row_prebuilt_t* m_prebuilt;
- /** prebuilt pointer for the right prebuilt. For native
- partitioning, points to the current partition prebuilt. */
- row_prebuilt_t** m_prebuilt_ptr;
-
/** Thread handle of the user currently using the handler;
this is set in external_lock function */
THD* m_user_thd;
@@ -572,15 +568,6 @@ bool thd_is_strict_mode(const MYSQL_THD thd);
*/
extern void mysql_bin_log_commit_pos(THD *thd, ulonglong *out_pos, const char **out_file);
-/** Get the partition_info working copy.
-@param thd Thread object.
-@return NULL or pointer to partition_info working copy. */
-/* JAN: TODO: MySQL 5.7 Partitioning
-partition_info*
-thd_get_work_part_info(
- THD* thd);
-*/
-
struct trx_t;
#ifdef WITH_WSREP
#include <mysql/service_wsrep.h>
@@ -864,10 +851,8 @@ innodb_base_col_setup_for_stored(
const Field* field,
dict_s_col_t* s_col);
-/** whether this is a stored column */
+/** whether this is a stored generated column */
#define innobase_is_s_fld(field) ((field)->vcol_info && (field)->stored_in_db())
-/** whether this is a computed virtual column */
-#define innobase_is_v_fld(field) ((field)->vcol_info && !(field)->stored_in_db())
/** Always normalize table name to lower case on Windows */
#ifdef _WIN32
diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
index af973e1544e..6c989be7c1b 100644
--- a/storage/innobase/handler/handler0alter.cc
+++ b/storage/innobase/handler/handler0alter.cc
@@ -1384,7 +1384,7 @@ check_v_col_in_order(
cf_it.rewind();
while (const Create_field* new_field = cf_it++) {
- if (!innobase_is_v_fld(new_field)) {
+ if (new_field->stored_in_db()) {
continue;
}
@@ -1416,8 +1416,6 @@ check_v_col_in_order(
continue;
}
- ut_ad(innobase_is_v_fld(field));
-
if (field->flags & FIELD_IS_DROPPED) {
continue;
}
@@ -1661,7 +1659,7 @@ innobase_fts_check_doc_id_col(
for (i = 0; i < n_cols; i++) {
const Field* field = altered_table->field[i];
- if (innobase_is_v_fld(field)) {
+ if (!field->stored_in_db()) {
(*num_v)++;
}
@@ -1676,7 +1674,7 @@ innobase_fts_check_doc_id_col(
|| field->pack_length() != 8
|| field->real_maybe_null()
|| !(field->flags & UNSIGNED_FLAG)
- || innobase_is_v_fld(field)) {
+ || !field->stored_in_db()) {
err = ER_INNODB_FT_WRONG_DOCID_COLUMN;
} else {
*fts_doc_col_no = i - *num_v;
@@ -2056,7 +2054,7 @@ ha_innobase::check_if_supported_inplace_alter(
need_rebuild = true;
}
- if (innobase_is_v_fld(key_part->field)) {
+ if (!key_part->field->stored_in_db()) {
/* Do not support adding index on newly added
virtual column, while there is also a drop
virtual column in the same clause */
@@ -2530,7 +2528,7 @@ no_match:
/* Any index on virtual columns cannot be used
for reference constaint */
- if (innobase_is_v_fld(key_part.field)) {
+ if (!key_part.field->stored_in_db()) {
goto no_match;
}
@@ -3103,21 +3101,15 @@ innobase_fields_to_mysql(
for (uint i = 0; i < n_fields; i++) {
Field* field = table->field[i];
ulint ipos;
- ulint col_n;
ulint prefix_col;
field->reset();
- if (innobase_is_v_fld(field)) {
- col_n = num_v;
- num_v++;
- } else {
- col_n = i - num_v;
- }
+ const bool is_v = !field->stored_in_db();
+ const ulint col_n = is_v ? num_v++ : i - num_v;
ipos = dict_index_get_nth_col_or_prefix_pos(
- index, col_n, true, innobase_is_v_fld(field),
- &prefix_col);
+ index, col_n, true, is_v, &prefix_col);
if (ipos == ULINT_UNDEFINED
|| dfield_is_ext(&fields[ipos])
@@ -3163,7 +3155,7 @@ innobase_row_to_mysql(
field->reset();
- if (innobase_is_v_fld(field)) {
+ if (!field->stored_in_db()) {
/* Virtual column are not stored in InnoDB table, so
skip it */
num_v++;
@@ -3374,7 +3366,7 @@ innobase_create_index_field_def(
: key_part->field;
for (ulint i = 0; i < key_part->fieldnr; i++) {
- if (innobase_is_v_fld(altered_table->field[i])) {
+ if (!altered_table->field[i]->stored_in_db()) {
num_v++;
}
}
@@ -3382,11 +3374,9 @@ innobase_create_index_field_def(
col_type = get_innobase_type_from_mysql_type(
&is_unsigned, field);
- if (innobase_is_v_fld(field)) {
- index_field->is_v_col = true;
+ if ((index_field->is_v_col = !field->stored_in_db())) {
index_field->col_no = num_v;
} else {
- index_field->is_v_col = false;
index_field->col_no = key_part->fieldnr - num_v;
}
@@ -3488,24 +3478,15 @@ innobase_create_index_def(
/* Need to count the virtual fields before this spatial
indexed field */
for (ulint i = 0; i < key->key_part->fieldnr; i++) {
- if (innobase_is_v_fld(altered_table->field[i])) {
- num_v++;
- }
+ num_v += !altered_table->field[i]->stored_in_db();
}
index->fields[0].col_no = key->key_part[0].fieldnr - num_v;
index->fields[0].prefix_len = 0;
index->fields[0].is_v_col = false;
- if (innobase_is_v_fld(key->key_part[0].field)) {
-
- /* Currently, the spatial index cannot be created
- on virtual columns. It is blocked in server
- layer */
- ut_ad(0);
- index->fields[0].is_v_col = true;
- } else {
- index->fields[0].is_v_col = false;
- }
+ /* Currently, the spatial index cannot be created
+ on virtual columns. It is blocked in the SQL layer. */
+ DBUG_ASSERT(key->key_part[0].field->stored_in_db());
} else {
index->ind_type = (key->flags & HA_NOSAME) ? DICT_UNIQUE : 0;
}
@@ -4215,13 +4196,12 @@ innobase_build_col_map(
}
while (const Create_field* new_field = cf_it++) {
- bool is_v = innobase_is_v_fld(new_field);
-
+ bool is_v = !new_field->stored_in_db();
ulint num_old_v = 0;
for (uint old_i = 0; table->field[old_i]; old_i++) {
const Field* field = table->field[old_i];
- if (innobase_is_v_fld(field)) {
+ if (!field->stored_in_db()) {
if (is_v && new_field->field == field) {
col_map[old_table->n_cols + num_v]
= num_old_v;
@@ -4390,14 +4370,12 @@ innobase_get_col_names(
ulint num_v = 0;
DBUG_ASSERT(i < altered_table->s->fields);
- if (innobase_is_v_fld(new_field)) {
+ if (!new_field->stored_in_db()) {
continue;
}
for (uint old_i = 0; table->field[old_i]; old_i++) {
- if (innobase_is_v_fld(table->field[old_i])) {
- num_v++;
- }
+ num_v += !table->field[old_i]->stored_in_db();
if (new_field->field == table->field[old_i]) {
cols[old_i - num_v] = new_field->field_name.str;
@@ -4683,7 +4661,7 @@ innobase_check_gis_columns(
const KEY_PART_INFO& key_part = key.key_part[0];
/* Does not support spatial index on virtual columns */
- if (innobase_is_v_fld(key_part.field)) {
+ if (!key_part.field->stored_in_db()) {
DBUG_RETURN(DB_UNSUPPORTED);
}
@@ -4755,7 +4733,7 @@ prepare_inplace_add_virtual(
while (const Create_field* new_field = cf_it++) {
const Field* field = altered_table->field[i++];
- if (new_field->field || !innobase_is_v_fld(field)) {
+ if (new_field->field || field->stored_in_db()) {
continue;
}
@@ -5857,7 +5835,7 @@ innodb_v_adjust_idx_col(
/* Found the field in the new table */
while (const Create_field* new_field = cf_it++) {
- if (!innobase_is_v_fld(new_field)) {
+ if (new_field->stored_in_db()) {
continue;
}
@@ -5877,7 +5855,7 @@ innodb_v_adjust_idx_col(
ut_a(0);
}
- ut_ad(innobase_is_v_fld(field));
+ ut_ad(!field->stored_in_db());
num_v = 0;
@@ -5891,9 +5869,7 @@ innodb_v_adjust_idx_col(
break;
}
- if (innobase_is_v_fld(old_table->field[old_i])) {
- num_v++;
- }
+ num_v += !old_table->field[old_i]->stored_in_db();
}
ut_ad(col_found);
@@ -6174,10 +6150,10 @@ new_clustered_failed:
for (uint i = 0; i < altered_table->s->fields; i++) {
const Field* field = altered_table->field[i];
- if (innobase_is_v_fld(field)) {
+ if (!field->stored_in_db()) {
n_v_cols++;
} else {
- n_cols++;
+ n_cols++;
}
}
@@ -6218,7 +6194,7 @@ new_clustered_failed:
&is_unsigned, field);
ulint charset_no;
ulint col_len;
- bool is_virtual = innobase_is_v_fld(field);
+ const bool is_virtual = !field->stored_in_db();
/* we assume in dtype_form_prtype() that this
fits in two bytes */
@@ -6314,7 +6290,7 @@ new_clustered_failed:
dict_v_col_t* v_col;
const Field* field = altered_table->field[i];
- if (!innobase_is_v_fld(field)) {
+ if (!!field->stored_in_db()) {
continue;
}
v_col = dict_table_get_nth_v_col(
@@ -7303,7 +7279,7 @@ alter_fill_stored_column(
Field* field = altered_table->field[i];
dict_s_col_t s_col;
- if (!innobase_is_v_fld(field)) {
+ if (field->stored_in_db()) {
stored_col_no++;
}
@@ -7551,7 +7527,7 @@ check_if_ok_to_rename:
MySQL should have checked these already.
We want to allow renaming of c1 to c2, c2 to c1. */
for (j = 0; j < table->s->fields; j++) {
- if (!innobase_is_v_fld(table->field[j])) {
+ if (table->field[j]->stored_in_db()) {
s += strlen(s) + 1;
}
}
@@ -7981,7 +7957,7 @@ err_exit:
if (heap) {
ha_alter_info->handler_ctx
= new ha_innobase_inplace_ctx(
- (*m_prebuilt_ptr),
+ m_prebuilt,
drop_index, n_drop_index,
rename_index, n_rename_index,
drop_fk, n_drop_fk,
@@ -8100,10 +8076,7 @@ err_exit:
autoinc_col_max_value = innobase_get_int_col_max_value(field);
}
found_col:
- if (innobase_is_v_fld(new_field)) {
- ++num_v;
- }
-
+ num_v += !new_field->stored_in_db();
i++;
}
@@ -8112,7 +8085,7 @@ found_col:
DBUG_ASSERT(!ha_alter_info->handler_ctx);
ha_alter_info->handler_ctx = new ha_innobase_inplace_ctx(
- (*m_prebuilt_ptr),
+ m_prebuilt,
drop_index, n_drop_index,
rename_index, n_rename_index,
drop_fk, n_drop_fk, add_fk, n_add_fk,
@@ -8988,13 +8961,13 @@ innobase_rename_columns_try(
& ALTER_COLUMN_NAME);
for (Field** fp = table->field; *fp; fp++, i++) {
- bool is_virtual = innobase_is_v_fld(*fp);
-
+ const bool is_virtual = !(*fp)->stored_in_db();
if (!((*fp)->flags & FIELD_IS_RENAMED)) {
goto processed_field;
}
cf_it.rewind();
+
while (Create_field* cf = cf_it++) {
if (cf->field == *fp) {
if (innobase_rename_column_try(
@@ -9221,7 +9194,7 @@ innobase_rename_or_enlarge_columns_cache(
ulint num_v = 0;
for (Field** fp = table->field; *fp; fp++, i++) {
- bool is_virtual = innobase_is_v_fld(*fp);
+ const bool is_virtual = !(*fp)->stored_in_db();
cf_it.rewind();
Field** af = altered_table->field;
diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h
index 9f76728e6cf..8a8530867ca 100644
--- a/storage/innobase/include/dict0mem.h
+++ b/storage/innobase/include/dict0mem.h
@@ -477,14 +477,7 @@ void
dict_mem_table_free_foreign_vcol_set(
dict_table_t* table);
-/** Create a temporary tablename like "#sql-ibtid-inc where
- tid = the Table ID
- inc = a randomly initialized number that is incremented for each file
-The table ID is a 64 bit integer, can use up to 20 digits, and is
-initialized at bootstrap. The second number is 32 bits, can use up to 10
-digits, and is initialized at startup to a randomly distributed number.
-It is hoped that the combination of these two numbers will provide a
-reasonably unique temporary file name.
+/** Create a temporary tablename like "#sql-ibNNN".
@param[in] heap A memory heap
@param[in] dbtab Table name in the form database/table name
@param[in] id Table id
diff --git a/storage/innobase/include/ut0new.h b/storage/innobase/include/ut0new.h
index b79d03f1b0b..b338bc765b5 100644
--- a/storage/innobase/include/ut0new.h
+++ b/storage/innobase/include/ut0new.h
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (c) 2014, 2015, Oracle and/or its affiliates. All Rights Reserved.
-Copyright (c) 2017, 2018, MariaDB Corporation.
+Copyright (c) 2017, 2019, 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
@@ -174,7 +174,6 @@ extern PSI_memory_key mem_key_other;
extern PSI_memory_key mem_key_row_log_buf;
extern PSI_memory_key mem_key_row_merge_sort;
extern PSI_memory_key mem_key_std;
-extern PSI_memory_key mem_key_partitioning;
/** Setup the internal objects needed for UT_NEW() to operate.
This must be called before the first call to UT_NEW(). */
@@ -654,13 +653,18 @@ public:
return(ptr);
}
+ pointer
+ allocate_large_dontdump(
+ size_type n_elements,
+ ut_new_pfx_t* pfx)
+ {
+ return allocate_large(n_elements, pfx, true);
+ }
/** Free a memory allocated by allocate_large() and trace the
deallocation.
@param[in,out] ptr pointer to memory to free
@param[in] pfx descriptor of the memory, as returned by
- allocate_large().
- @param[in] dodump if true, advise the OS to include this
- memory again if a core dump occurs. */
+ allocate_large(). */
void
deallocate_large(
pointer ptr,
@@ -669,12 +673,8 @@ public:
pfx
#endif
,
- size_t size,
- bool dodump = false)
+ size_t size)
{
- if (dodump) {
- ut_dodump(ptr, size);
- }
#ifdef UNIV_PFS_MEMORY
if (pfx) {
deallocate_trace(pfx);
@@ -684,8 +684,27 @@ public:
os_mem_free_large(ptr, size);
}
+ void
+ deallocate_large_dodump(
+ pointer ptr,
+ const ut_new_pfx_t*
#ifdef UNIV_PFS_MEMORY
+ pfx
+#endif
+ ,
+ size_t size)
+ {
+ ut_dodump(ptr, size);
+ deallocate_large(ptr,
+#ifdef UNIV_PFS_MEMORY
+ pfx,
+#else
+ NULL,
+#endif
+ size);
+ }
+#ifdef UNIV_PFS_MEMORY
/** Get the performance schema key to use for tracing allocations.
@param[in] file file name of the caller or NULL if unknown
@return performance schema key */
diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc
index bb51123617d..bbb8a0a4b55 100644
--- a/storage/innobase/os/os0file.cc
+++ b/storage/innobase/os/os0file.cc
@@ -2484,18 +2484,10 @@ os_file_fsync_posix(
ut_a(failures < 2000);
break;
- case EIO:
- ib::error() << "fsync() returned EIO, aborting";
- /* fall through */
default:
- ut_error;
- break;
+ ib::fatal() << "fsync() returned " << errno;
}
}
-
- ut_error;
-
- return(-1);
}
/** Check the existence and type of the given file.
@@ -5717,7 +5709,7 @@ AIO::AIO(
m_not_full = os_event_create("aio_not_full");
m_is_empty = os_event_create("aio_is_empty");
- memset(&m_slots[0], 0x0, sizeof(m_slots[0]) * m_slots.size());
+ memset((void*)&m_slots[0], 0x0, sizeof(m_slots[0]) * m_slots.size());
#ifdef LINUX_NATIVE_AIO
memset(&m_events[0], 0x0, sizeof(m_events[0]) * m_events.size());
#endif /* LINUX_NATIVE_AIO */
diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc
index aef488eb96d..d09fe6e36c1 100644
--- a/storage/innobase/row/row0mysql.cc
+++ b/storage/innobase/row/row0mysql.cc
@@ -2687,10 +2687,15 @@ next:
goto next;
}
+ char* name = mem_strdup(table->name.m_name);
+
dict_table_close(table, FALSE, FALSE);
- if (DB_SUCCESS != row_drop_table_for_mysql_in_background(
- table->name.m_name)) {
+ dberr_t err = row_drop_table_for_mysql_in_background(name);
+
+ ut_free(name);
+
+ if (err != DB_SUCCESS) {
/* If the DROP fails for some table, we return, and let the
main thread retry later */
return(n_tables + n_tables_dropped);
diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc
index d0b56e139d2..08a0575dbfb 100644
--- a/storage/innobase/trx/trx0purge.cc
+++ b/storage/innobase/trx/trx0purge.cc
@@ -231,22 +231,18 @@ trx_purge_add_undo_to_history(const trx_t* trx, trx_undo_t*& undo, mtr_t* mtr)
}
if (undo->state != TRX_UNDO_CACHED) {
- ulint hist_size;
-#ifdef UNIV_DEBUG
- trx_usegf_t* seg_header = undo_page + TRX_UNDO_SEG_HDR;
-#endif /* UNIV_DEBUG */
-
/* The undo log segment will not be reused */
ut_a(undo->id < TRX_RSEG_N_SLOTS);
trx_rsegf_set_nth_undo(rseg_header, undo->id, FIL_NULL, mtr);
MONITOR_DEC(MONITOR_NUM_UNDO_SLOT_USED);
- hist_size = mtr_read_ulint(
- rseg_header + TRX_RSEG_HISTORY_SIZE, MLOG_4BYTES, mtr);
+ uint32_t hist_size = mach_read_from_4(TRX_RSEG_HISTORY_SIZE
+ + rseg_header);
- ut_ad(undo->size == flst_get_len(
- seg_header + TRX_UNDO_PAGE_LIST));
+ ut_ad(undo->size == flst_get_len(TRX_UNDO_SEG_HDR
+ + TRX_UNDO_PAGE_LIST
+ + undo_page));
mlog_write_ulint(
rseg_header + TRX_RSEG_HISTORY_SIZE,
@@ -830,11 +826,7 @@ not_free:
/***********************************************************************//**
Updates the last not yet purged history log info in rseg when we have purged
a whole undo log. Advances also purge_sys.purge_trx_no past the purged log. */
-static
-void
-trx_purge_rseg_get_next_history_log(
-/*================================*/
- trx_rseg_t* rseg, /*!< in: rollback segment */
+static void trx_purge_rseg_get_next_history_log(
ulint* n_pages_handled)/*!< in/out: number of UNDO pages
handled */
{
@@ -844,20 +836,21 @@ trx_purge_rseg_get_next_history_log(
trx_id_t trx_no;
mtr_t mtr;
- mutex_enter(&(rseg->mutex));
+ mutex_enter(&purge_sys.rseg->mutex);
- ut_a(rseg->last_page_no != FIL_NULL);
+ ut_a(purge_sys.rseg->last_page_no != FIL_NULL);
- purge_sys.tail.commit = rseg->last_commit + 1;
+ purge_sys.tail.commit = purge_sys.rseg->last_commit + 1;
purge_sys.tail.undo_no = 0;
purge_sys.next_stored = false;
- mtr_start(&mtr);
+ mtr.start();
undo_page = trx_undo_page_get_s_latched(
- page_id_t(rseg->space->id, rseg->last_page_no), &mtr);
+ page_id_t(purge_sys.rseg->space->id,
+ purge_sys.rseg->last_page_no), &mtr);
- log_hdr = undo_page + rseg->last_offset;
+ log_hdr = undo_page + purge_sys.rseg->last_offset;
/* Increase the purge page count by one for every handled log */
@@ -866,26 +859,26 @@ trx_purge_rseg_get_next_history_log(
prev_log_addr = trx_purge_get_log_from_hist(
flst_get_prev_addr(log_hdr + TRX_UNDO_HISTORY_NODE, &mtr));
- if (prev_log_addr.page == FIL_NULL) {
+ const bool empty = prev_log_addr.page == FIL_NULL;
+
+ if (empty) {
/* No logs left in the history list */
+ purge_sys.rseg->last_page_no = FIL_NULL;
+ }
- rseg->last_page_no = FIL_NULL;
+ mutex_exit(&purge_sys.rseg->mutex);
+ mtr.commit();
- mutex_exit(&(rseg->mutex));
- mtr_commit(&mtr);
+ if (empty) {
return;
}
- mutex_exit(&rseg->mutex);
-
- mtr_commit(&mtr);
-
/* Read the previous log header. */
- mtr_start(&mtr);
+ mtr.start();
- log_hdr = trx_undo_page_get_s_latched(page_id_t(rseg->space->id,
- prev_log_addr.page),
- &mtr)
+ log_hdr = trx_undo_page_get_s_latched(
+ page_id_t(purge_sys.rseg->space->id, prev_log_addr.page),
+ &mtr)
+ prev_log_addr.boffset;
trx_no = mach_read_from_8(log_hdr + TRX_UNDO_TRX_NO);
@@ -894,12 +887,12 @@ trx_purge_rseg_get_next_history_log(
mtr_commit(&mtr);
- mutex_enter(&(rseg->mutex));
+ mutex_enter(&purge_sys.rseg->mutex);
- rseg->last_page_no = prev_log_addr.page;
- rseg->last_offset = prev_log_addr.boffset;
- rseg->set_last_trx_no(trx_no, purge != 0);
- rseg->needs_purge = purge != 0;
+ purge_sys.rseg->last_page_no = prev_log_addr.page;
+ purge_sys.rseg->last_offset = prev_log_addr.boffset;
+ purge_sys.rseg->set_last_trx_no(trx_no, purge != 0);
+ purge_sys.rseg->needs_purge = purge != 0;
/* Purge can also produce events, however these are already ordered
in the rollback segment and any user generated event will be greater
@@ -908,11 +901,11 @@ trx_purge_rseg_get_next_history_log(
mutex_enter(&purge_sys.pq_mutex);
- purge_sys.purge_queue.push(*rseg);
+ purge_sys.purge_queue.push(*purge_sys.rseg);
mutex_exit(&purge_sys.pq_mutex);
- mutex_exit(&rseg->mutex);
+ mutex_exit(&purge_sys.rseg->mutex);
}
/** Position the purge sys "iterator" on the undo record to use for purging. */
@@ -1007,8 +1000,7 @@ trx_purge_get_next_rec(
/* It is the dummy undo log record, which means that there is
no need to purge this undo log */
- trx_purge_rseg_get_next_history_log(
- purge_sys.rseg, n_pages_handled);
+ trx_purge_rseg_get_next_history_log(n_pages_handled);
/* Look for the next undo log and record to purge */
@@ -1035,8 +1027,7 @@ trx_purge_get_next_rec(
if (rec2 == NULL) {
mtr_commit(&mtr);
- trx_purge_rseg_get_next_history_log(
- purge_sys.rseg, n_pages_handled);
+ trx_purge_rseg_get_next_history_log(n_pages_handled);
/* Look for the next undo log and record to purge */
@@ -1163,7 +1154,7 @@ trx_purge_attach_undo_recs(ulint n_purge_threads)
const ulint batch_size = srv_purge_batch_size;
- for (;;) {
+ while (UNIV_LIKELY(srv_undo_sources) || !srv_fast_shutdown) {
purge_node_t* node;
trx_purge_rec_t* purge_rec;
diff --git a/storage/innobase/trx/trx0undo.cc b/storage/innobase/trx/trx0undo.cc
index 81e0b5a1945..df5adbd5186 100644
--- a/storage/innobase/trx/trx0undo.cc
+++ b/storage/innobase/trx/trx0undo.cc
@@ -1353,6 +1353,15 @@ trx_undo_reuse_cached(trx_t* trx, trx_rseg_t* rseg, trx_undo_t** pundo,
*pundo = undo;
ulint offset = trx_undo_header_create(block->frame, trx->id, mtr);
+ /* Reset the TRX_UNDO_PAGE_TYPE in case this page is being
+ repurposed after upgrading to MariaDB 10.3. */
+ if (ut_d(ulint type =) UNIV_UNLIKELY(
+ mach_read_from_2(TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_TYPE
+ + block->frame))) {
+ ut_ad(type == TRX_UNDO_INSERT || type == TRX_UNDO_UPDATE);
+ mlog_write_ulint(TRX_UNDO_PAGE_HDR + TRX_UNDO_PAGE_TYPE
+ + block->frame, 0, MLOG_2BYTES, mtr);
+ }
trx_undo_header_add_space_for_xid(block->frame, block->frame + offset,
mtr);
diff --git a/storage/innobase/ut/ut0new.cc b/storage/innobase/ut/ut0new.cc
index cdba09974ad..64796a544c9 100644
--- a/storage/innobase/ut/ut0new.cc
+++ b/storage/innobase/ut/ut0new.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 2014, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2019, 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
@@ -41,7 +42,6 @@ PSI_memory_key mem_key_other;
PSI_memory_key mem_key_row_log_buf;
PSI_memory_key mem_key_row_merge_sort;
PSI_memory_key mem_key_std;
-PSI_memory_key mem_key_partitioning;
#ifdef UNIV_PFS_MEMORY
@@ -69,7 +69,6 @@ static PSI_memory_info pfs_info[] = {
{&mem_key_row_log_buf, "row_log_buf", 0},
{&mem_key_row_merge_sort, "row_merge_sort", 0},
{&mem_key_std, "std", 0},
- {&mem_key_partitioning, "partitioning", 0},
};
/** Map used for default performance schema keys, based on file name of the
diff --git a/storage/maria/ma_recovery.c b/storage/maria/ma_recovery.c
index 8d2381a3e19..3ddf2d91f16 100644
--- a/storage/maria/ma_recovery.c
+++ b/storage/maria/ma_recovery.c
@@ -1416,6 +1416,11 @@ static int new_table(uint16 sid, const char *name, LSN lsn_of_file_id)
}
if (cmp_translog_addr(lsn_of_file_id, share->state.create_rename_lsn) <= 0)
{
+ /*
+ This can happen if the table was dropped and re-created since this
+ redo entry or if the table had a bulk insert directly after create,
+ in which case the create_rename_lsn changed.
+ */
tprint(tracef, ", has create_rename_lsn " LSN_FMT " more recent than"
" LOGREC_FILE_ID's LSN " LSN_FMT ", ignoring open request",
LSN_IN_PARTS(share->state.create_rename_lsn),
@@ -3636,8 +3641,16 @@ my_bool _ma_reenable_logging_for_table(MARIA_HA *info, my_bool flush_pages)
{
/* Ensure that recover is not executing any redo before this */
if (!maria_in_recovery)
+ {
+ if (share->id != 0)
+ {
+ mysql_mutex_lock(&share->intern_lock);
+ translog_deassign_id_from_share(share);
+ mysql_mutex_unlock(&share->intern_lock);
+ }
share->state.is_of_horizon= share->state.create_rename_lsn=
share->state.skip_redo_lsn= translog_get_horizon();
+ }
/*
We are going to change callbacks; if a page is flushed at this moment
this can cause race conditions, that's one reason to flush pages
diff --git a/storage/maria/ma_write.c b/storage/maria/ma_write.c
index 52eefa33bc3..7e9df1ed56c 100644
--- a/storage/maria/ma_write.c
+++ b/storage/maria/ma_write.c
@@ -1676,14 +1676,15 @@ static int keys_compare(bulk_insert_param *param, uchar *key1, uchar *key2)
}
-static int keys_free(uchar *key, TREE_FREE mode, bulk_insert_param *param)
+static int keys_free(void* key_arg, TREE_FREE mode, void *param_arg)
{
/*
Probably I can use info->lastkey here, but I'm not sure,
and to be safe I'd better use local lastkey.
*/
+ bulk_insert_param *param= (bulk_insert_param*)param_arg;
MARIA_SHARE *share= param->info->s;
- uchar lastkey[MARIA_MAX_KEY_BUFF];
+ uchar lastkey[MARIA_MAX_KEY_BUFF], *key= (uchar*)key_arg;
uint keylen;
MARIA_KEYDEF *keyinfo= share->keyinfo + param->keynr;
MARIA_KEY tmp_key;
@@ -1710,13 +1711,14 @@ static int keys_free(uchar *key, TREE_FREE mode, bulk_insert_param *param)
copying middle key up if tree is growing
*/
memcpy(lastkey, key, tmp_key.data_length + tmp_key.ref_length);
- return _ma_ck_write_btree(param->info, &tmp_key);
+ _ma_ck_write_btree(param->info, &tmp_key);
+ return 0;
case free_end:
if (share->lock_key_trees)
mysql_rwlock_unlock(&keyinfo->root_lock);
return 0;
}
- return 1;
+ return 0;
}
@@ -1772,8 +1774,7 @@ int maria_init_bulk_insert(MARIA_HA *info, size_t cache_size, ha_rows rows)
init_tree(&info->bulk_insert[i],
cache_size * key[i].maxlength,
cache_size * key[i].maxlength, 0,
- (qsort_cmp2)keys_compare,
- (tree_element_free) keys_free, (void *)params++, MYF(0));
+ (qsort_cmp2) keys_compare, keys_free, (void *)params++, MYF(0));
}
else
info->bulk_insert[i].root=0;
diff --git a/storage/mroonga/ha_mroonga.cpp b/storage/mroonga/ha_mroonga.cpp
index 453dd15da47..0f153e200ef 100644
--- a/storage/mroonga/ha_mroonga.cpp
+++ b/storage/mroonga/ha_mroonga.cpp
@@ -2600,7 +2600,7 @@ ha_mroonga::~ha_mroonga()
}
if (blob_buffers)
{
- ::delete [] blob_buffers;
+ delete [] blob_buffers;
}
grn_obj_unlink(ctx, &top_left_point);
grn_obj_unlink(ctx, &bottom_right_point);
@@ -3003,9 +3003,9 @@ int ha_mroonga::create_share_for_create() const
TABLE_LIST *table_list = MRN_LEX_GET_TABLE_LIST(lex);
MRN_DBUG_ENTER_METHOD();
wrap_handler_for_create = NULL;
- memset(&table_for_create, 0, sizeof(TABLE));
+ table_for_create.reset();
+ table_share_for_create.reset();
memset(&share_for_create, 0, sizeof(MRN_SHARE));
- memset(&table_share_for_create, 0, sizeof(TABLE_SHARE));
if (table_share) {
table_share_for_create.comment = table_share->comment;
table_share_for_create.connect_string = table_share->connect_string;
@@ -4735,11 +4735,8 @@ int ha_mroonga::storage_open_columns(void)
if (table_share->blob_fields)
{
- if (blob_buffers)
- {
- ::delete [] blob_buffers;
- }
- if (!(blob_buffers = ::new String[n_columns]))
+ DBUG_ASSERT(!blob_buffers);
+ if (!(blob_buffers = new (&table->mem_root) String[n_columns]))
{
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
}
@@ -14571,8 +14568,8 @@ enum_alter_inplace_result ha_mroonga::wrapper_check_if_supported_inplace_alter(
) {
DBUG_RETURN(HA_ALTER_ERROR);
}
- memcpy(wrap_altered_table, altered_table, sizeof(TABLE));
- memcpy(wrap_altered_table_share, altered_table->s, sizeof(TABLE_SHARE));
+ *wrap_altered_table= *altered_table;
+ *wrap_altered_table_share= *altered_table->s;
mrn_init_sql_alloc(ha_thd(), &(wrap_altered_table_share->mem_root));
n_keys = ha_alter_info->index_drop_count;
diff --git a/storage/myisam/mi_write.c b/storage/myisam/mi_write.c
index 81af85acfc2..9658f8458c4 100644
--- a/storage/myisam/mi_write.c
+++ b/storage/myisam/mi_write.c
@@ -929,13 +929,14 @@ static int keys_compare(bulk_insert_param *param, uchar *key1, uchar *key2)
}
-static int keys_free(uchar *key, TREE_FREE mode, bulk_insert_param *param)
+static int keys_free(void* key_arg, TREE_FREE mode, void *param_arg)
{
/*
Probably I can use info->lastkey here, but I'm not sure,
and to be safe I'd better use local lastkey.
*/
- uchar lastkey[HA_MAX_KEY_BUFF];
+ bulk_insert_param *param= (bulk_insert_param*)param_arg;
+ uchar lastkey[HA_MAX_KEY_BUFF], *key= (uchar*)key_arg;
uint keylen;
MI_KEYDEF *keyinfo;
@@ -951,14 +952,15 @@ static int keys_free(uchar *key, TREE_FREE mode, bulk_insert_param *param)
keyinfo=param->info->s->keyinfo+param->keynr;
keylen=_mi_keylength(keyinfo, key);
memcpy(lastkey, key, keylen);
- return _mi_ck_write_btree(param->info,param->keynr,lastkey,
- keylen - param->info->s->rec_reflength);
+ _mi_ck_write_btree(param->info, param->keynr, lastkey,
+ keylen - param->info->s->rec_reflength);
+ return 0;
case free_end:
if (param->info->s->concurrent_insert)
mysql_rwlock_unlock(&param->info->s->key_root_lock[param->keynr]);
return 0;
}
- return -1;
+ return 0;
}
@@ -1014,8 +1016,7 @@ int mi_init_bulk_insert(MI_INFO *info, size_t cache_size, ha_rows rows)
init_tree(&info->bulk_insert[i],
cache_size * key[i].maxlength,
cache_size * key[i].maxlength, 0,
- (qsort_cmp2)keys_compare,
- (tree_element_free) keys_free, (void *)params++, MYF(0));
+ (qsort_cmp2)keys_compare, keys_free, (void *)params++, MYF(0));
}
else
info->bulk_insert[i].root=0;
diff --git a/storage/myisam/myisamlog.c b/storage/myisam/myisamlog.c
index eb06c75f0e0..51884c3ecca 100644
--- a/storage/myisam/myisamlog.c
+++ b/storage/myisam/myisamlog.c
@@ -63,7 +63,7 @@ static int test_if_open(struct file_info *key,element_count count,
static void fix_blob_pointers(MI_INFO *isam,uchar *record);
static int test_when_accessed(struct file_info *key,element_count count,
struct st_access_param *access_param);
-static void file_info_free(struct file_info *info);
+static int file_info_free(void*, TREE_FREE, void *);
static int close_some_file(TREE *tree);
static int reopen_closed_file(TREE *tree,struct file_info *file_info);
static int find_record_with_key(struct file_info *file_info,uchar *record);
@@ -330,8 +330,7 @@ static int examine_log(char * file_name, char **table_names)
init_io_cache(&cache,file,0,READ_CACHE,start_offset,0,MYF(0));
bzero((uchar*) com_count,sizeof(com_count));
init_tree(&tree,0,0,sizeof(file_info),(qsort_cmp2) file_info_compare,
- (tree_element_free) file_info_free, NULL,
- MYF(MY_TREE_WITH_DELETE));
+ file_info_free, NULL, MYF(MY_TREE_WITH_DELETE));
(void) init_key_cache(dflt_key_cache,KEY_CACHE_BLOCK_SIZE,KEY_CACHE_SIZE,
0, 0, 0, 0);
@@ -751,8 +750,9 @@ static int test_when_accessed (struct file_info *key,
}
-static void file_info_free(struct file_info *fileinfo)
+static int file_info_free(void* arg, TREE_FREE mode, void *unused)
{
+ struct file_info *fileinfo= arg;
DBUG_ENTER("file_info_free");
if (update)
{
@@ -763,7 +763,7 @@ static void file_info_free(struct file_info *fileinfo)
}
my_free(fileinfo->name);
my_free(fileinfo->show_name);
- DBUG_VOID_RETURN;
+ DBUG_RETURN(0);
}
diff --git a/storage/myisammrg/ha_myisammrg.cc b/storage/myisammrg/ha_myisammrg.cc
index 18860b31839..10d1de0fb7e 100644
--- a/storage/myisammrg/ha_myisammrg.cc
+++ b/storage/myisammrg/ha_myisammrg.cc
@@ -1467,51 +1467,43 @@ void ha_myisammrg::update_create_info(HA_CREATE_INFO *create_info)
if (!(create_info->used_fields & HA_CREATE_USED_UNION))
{
- TABLE_LIST *child_table;
- THD *thd=current_thd;
-
- create_info->merge_list.next= &create_info->merge_list.first;
- create_info->merge_list.elements=0;
+ TABLE_LIST *child_table, *end= NULL;
+ THD *thd=ha_thd();
if (children_l != NULL)
{
- for (child_table= children_l;;
- child_table= child_table->next_global)
+ for (child_table= children_l;; child_table= child_table->next_global)
{
TABLE_LIST *ptr;
if (!(ptr= (TABLE_LIST *) thd->calloc(sizeof(TABLE_LIST))))
- goto err;
+ DBUG_VOID_RETURN;
if (!(ptr->table_name.str= thd->strmake(child_table->table_name.str,
child_table->table_name.length)))
- goto err;
+ DBUG_VOID_RETURN;
ptr->table_name.length= child_table->table_name.length;
if (child_table->db.str && !(ptr->db.str= thd->strmake(child_table->db.str,
child_table->db.length)))
- goto err;
+ DBUG_VOID_RETURN;
ptr->db.length= child_table->db.length;
- create_info->merge_list.elements++;
- (*create_info->merge_list.next)= ptr;
- create_info->merge_list.next= &ptr->next_local;
+ if (create_info->merge_list)
+ end->next_local= ptr;
+ else
+ create_info->merge_list= ptr;
+ end= ptr;
if (&child_table->next_global == children_last_l)
break;
}
}
- *create_info->merge_list.next=0;
}
if (!(create_info->used_fields & HA_CREATE_USED_INSERT_METHOD))
{
create_info->merge_insert_method = file->merge_insert_method;
}
DBUG_VOID_RETURN;
-
-err:
- create_info->merge_list.elements=0;
- create_info->merge_list.first=0;
- DBUG_VOID_RETURN;
}
@@ -1519,18 +1511,21 @@ int ha_myisammrg::create_mrg(const char *name, HA_CREATE_INFO *create_info)
{
char buff[FN_REFLEN];
const char **table_names, **pos;
- TABLE_LIST *tables= create_info->merge_list.first;
- THD *thd= current_thd;
+ TABLE_LIST *tables= create_info->merge_list;
+ THD *thd= ha_thd();
size_t dirlgt= dirname_length(name);
+ uint ntables= 0;
DBUG_ENTER("ha_myisammrg::create_mrg");
+ for (tables= create_info->merge_list; tables; tables= tables->next_local)
+ ntables++;
+
/* Allocate a table_names array in thread mem_root. */
- if (!(table_names= (const char**)
- thd->alloc((create_info->merge_list.elements+1) * sizeof(char*))))
+ if (!(pos= table_names= (const char**) thd->alloc((ntables + 1) * sizeof(char*))))
DBUG_RETURN(HA_ERR_OUT_OF_MEM); /* purecov: inspected */
/* Create child path names. */
- for (pos= table_names; tables; tables= tables->next_local)
+ for (tables= create_info->merge_list; tables; tables= tables->next_local)
{
const char *table_name= buff;
diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc
index a940e451f75..13a729bd77b 100644
--- a/storage/rocksdb/ha_rocksdb.cc
+++ b/storage/rocksdb/ha_rocksdb.cc
@@ -676,7 +676,7 @@ static void rocksdb_set_rocksdb_info_log_level(
RDB_MUTEX_LOCK_CHECK(rdb_sysvars_mutex);
rocksdb_info_log_level = *static_cast<const uint64_t *>(save);
rocksdb_db_options->info_log->SetInfoLogLevel(
- static_cast<const rocksdb::InfoLogLevel>(rocksdb_info_log_level));
+ static_cast<rocksdb::InfoLogLevel>(rocksdb_info_log_level));
RDB_MUTEX_UNLOCK_CHECK(rdb_sysvars_mutex);
}
diff --git a/storage/rocksdb/rdb_datadic.cc b/storage/rocksdb/rdb_datadic.cc
index e41a2885ad6..a3a811e1a6f 100644
--- a/storage/rocksdb/rdb_datadic.cc
+++ b/storage/rocksdb/rdb_datadic.cc
@@ -127,9 +127,9 @@ Rdb_key_def::Rdb_key_def(const Rdb_key_def &k)
m_total_index_flags_length == 0);
if (k.m_pack_info) {
const size_t size = sizeof(Rdb_field_packing) * k.m_key_parts;
- m_pack_info =
- reinterpret_cast<Rdb_field_packing *>(my_malloc(size, MYF(0)));
- memcpy(m_pack_info, k.m_pack_info, size);
+ void *pack_info= my_malloc(size, MYF(0));
+ memcpy(pack_info, k.m_pack_info, size);
+ m_pack_info = reinterpret_cast<Rdb_field_packing *>(pack_info);
}
if (k.m_pk_part_no) {
@@ -1090,7 +1090,7 @@ uint Rdb_key_def::pack_record(
// Insert TTL timestamp
if (has_ttl() && ttl_bytes) {
write_index_flag_field(unpack_info,
- reinterpret_cast<const uchar *const>(ttl_bytes),
+ reinterpret_cast<const uchar *>(ttl_bytes),
Rdb_key_def::TTL_FLAG);
}
}
diff --git a/storage/rocksdb/rdb_threads.cc b/storage/rocksdb/rdb_threads.cc
index 53286239c4e..0f331bdaeb2 100644
--- a/storage/rocksdb/rdb_threads.cc
+++ b/storage/rocksdb/rdb_threads.cc
@@ -28,7 +28,7 @@ namespace myrocks {
void *Rdb_thread::thread_func(void *const thread_ptr) {
DBUG_ASSERT(thread_ptr != nullptr);
- Rdb_thread *const thread = static_cast<Rdb_thread *const>(thread_ptr);
+ Rdb_thread *const thread = static_cast<Rdb_thread *>(thread_ptr);
if (!thread->m_run_once.exchange(true)) {
thread->setname();
thread->run();
diff --git a/storage/sequence/sequence.cc b/storage/sequence/sequence.cc
index 3e56303973d..9d391be624b 100644
--- a/storage/sequence/sequence.cc
+++ b/storage/sequence/sequence.cc
@@ -348,7 +348,9 @@ static int discover_table_existence(handlerton *hton, const char *db,
return !parse_table_name(table_name, strlen(table_name), &from, &to, &step);
}
-static int dummy_ret_int() { return 0; }
+static int dummy_commit_rollback(handlerton *, THD *, bool) { return 0; }
+
+static int dummy_savepoint(handlerton *, THD *, void *) { return 0; }
/*****************************************************************************
Example of a simple group by handler for queries like:
@@ -487,10 +489,9 @@ static int init(void *p)
hton->create= create_handler;
hton->discover_table= discover_table;
hton->discover_table_existence= discover_table_existence;
- hton->commit= hton->rollback=
- (int (*)(handlerton *, THD *, bool)) &dummy_ret_int;
+ hton->commit= hton->rollback= dummy_commit_rollback;
hton->savepoint_set= hton->savepoint_rollback= hton->savepoint_release=
- (int (*)(handlerton *, THD *, void *)) &dummy_ret_int;
+ dummy_savepoint;
hton->create_group_by= create_group_by_handler;
return 0;
}
diff --git a/storage/spider/ha_spider.cc b/storage/spider/ha_spider.cc
index cc97a19988d..c892bd8828c 100644
--- a/storage/spider/ha_spider.cc
+++ b/storage/spider/ha_spider.cc
@@ -11295,7 +11295,7 @@ int ha_spider::create(
error_num = ER_SPIDER_ALTER_BEFORE_UNLOCK_NUM;
goto error_alter_before_unlock;
}
- memset(&tmp_share, 0, sizeof(SPIDER_SHARE));
+ memset((void*)&tmp_share, 0, sizeof(SPIDER_SHARE));
tmp_share.table_name = (char*) name;
tmp_share.table_name_length = strlen(name);
#ifdef SPIDER_HAS_HASH_VALUE_TYPE
diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc
index 0e706219432..467eed97a29 100644
--- a/storage/spider/spd_table.cc
+++ b/storage/spider/spd_table.cc
@@ -6281,7 +6281,7 @@ int spider_open_all_tables(
}
SPD_INIT_ALLOC_ROOT(&mem_root, 4096, 0, MYF(MY_WME));
- memset(&tmp_share, 0, sizeof(SPIDER_SHARE));
+ memset((void*)&tmp_share, 0, sizeof(SPIDER_SHARE));
memset(&tmp_connect_info, 0,
sizeof(char *) * SPIDER_TMP_SHARE_CHAR_PTR_COUNT);
memset(tmp_connect_info_length, 0,
@@ -6415,7 +6415,7 @@ int spider_open_all_tables(
free_root(&mem_root, MYF(0));
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
}
- memcpy(share, &tmp_share, sizeof(*share));
+ memcpy((void*)share, &tmp_share, sizeof(*share));
spider_set_tmp_share_pointer(share, connect_info,
connect_info_length, long_info, longlong_info);
memcpy(connect_info, &tmp_connect_info, sizeof(char *) *
diff --git a/storage/spider/spd_trx.cc b/storage/spider/spd_trx.cc
index 6204ca9852c..78a95c5e38a 100644
--- a/storage/spider/spd_trx.cc
+++ b/storage/spider/spd_trx.cc
@@ -253,7 +253,7 @@ int spider_trx_another_lock_tables(
sql_str.init_calc_mem(188);
sql_str.length(0);
memset((void*)&tmp_spider, 0, sizeof(ha_spider));
- memset(&tmp_share, 0, sizeof(SPIDER_SHARE));
+ memset((void*)&tmp_share, 0, sizeof(SPIDER_SHARE));
tmp_spider.share = &tmp_share;
tmp_spider.trx = trx;
tmp_share.access_charset = system_charset_info;
@@ -2944,7 +2944,7 @@ int spider_internal_xa_commit_by_xid(
}
}
- memset(&tmp_share, 0, sizeof(SPIDER_SHARE));
+ memset((void*)&tmp_share, 0, sizeof(SPIDER_SHARE));
memset(&tmp_connect_info, 0,
sizeof(char *) * SPIDER_TMP_SHARE_CHAR_PTR_COUNT);
spider_set_tmp_share_pointer(&tmp_share, tmp_connect_info,
@@ -3177,7 +3177,7 @@ int spider_internal_xa_rollback_by_xid(
}
}
- memset(&tmp_share, 0, sizeof(SPIDER_SHARE));
+ memset((void*)&tmp_share, 0, sizeof(SPIDER_SHARE));
memset(&tmp_connect_info, 0,
sizeof(char *) * SPIDER_TMP_SHARE_CHAR_PTR_COUNT);
spider_set_tmp_share_pointer(&tmp_share, tmp_connect_info,
diff --git a/unittest/sql/mf_iocache-t.cc b/unittest/sql/mf_iocache-t.cc
index 27c4b8d0e2a..464730ee08e 100644
--- a/unittest/sql/mf_iocache-t.cc
+++ b/unittest/sql/mf_iocache-t.cc
@@ -50,6 +50,12 @@ uint encryption_key_get_func(uint, uint, uchar* key, uint* size)
return 0;
}
+uint encryption_ctx_size_func(unsigned int, unsigned int)
+{
+ return MY_AES_CTX_SIZE;
+}
+
+
#ifdef HAVE_EncryptAes128Gcm
enum my_aes_mode aes_mode= MY_AES_GCM;
#else
@@ -73,7 +79,7 @@ struct encryption_service_st encryption_handler=
{
encryption_key_get_latest_version_func,
encryption_key_get_func,
- (uint (*)(unsigned int, unsigned int))my_aes_ctx_size,
+ encryption_ctx_size_func,
encryption_ctx_init_func,
my_aes_crypt_update,
my_aes_crypt_finish,