diff options
147 files changed, 1440 insertions, 772 deletions
diff --git a/client/mysqlbinlog.cc b/client/mysqlbinlog.cc index 4f6f19f5f02..c2409836142 100644 --- a/client/mysqlbinlog.cc +++ b/client/mysqlbinlog.cc @@ -3229,17 +3229,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 5e366c5e3d1..a0cbf4d972f 100644 --- a/client/mysqlcheck.c +++ b/client/mysqlcheck.c @@ -968,7 +968,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 051a1cffeac..89dcf6593b4 100644 --- a/client/mysqltest.cc +++ b/client/mysqltest.cc @@ -8302,6 +8302,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 */ @@ -8839,18 +8845,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 6c04780b64d..831433b43e2 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", >id_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; } @@ -1822,4 +1807,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 41ab48ee53f..8c2411edec0 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 @@ -2010,7 +2007,6 @@ xtrabackup_read_metadata(char *filename) { FILE *fp; my_bool r = TRUE; - int t; fp = fopen(filename,"r"); if(!fp) { @@ -2041,9 +2037,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); @@ -2062,13 +2055,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); } /*********************************************************************** @@ -5279,27 +5270,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) { @@ -5565,20 +5535,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 90f5e28e2c7..3dc0891f3b4 100644 --- a/extra/mariabackup/xtrabackup.h +++ b/extra/mariabackup/xtrabackup.h @@ -140,7 +140,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/mysql/service_wsrep.h b/include/mysql/service_wsrep.h index 461b1064633..934a43fa55b 100644 --- a/include/mysql/service_wsrep.h +++ b/include/mysql/service_wsrep.h @@ -114,6 +114,7 @@ extern struct wsrep_service_st { int (*wsrep_trx_order_before_func)(MYSQL_THD, MYSQL_THD); void (*wsrep_unlock_rollback_func)(); void (*wsrep_set_data_home_dir_func)(const char *data_dir); + my_bool (*wsrep_thd_is_applier_func)(MYSQL_THD); } *wsrep_service; #ifdef MYSQL_DYNAMIC_PLUGIN @@ -159,6 +160,7 @@ extern struct wsrep_service_st { #define wsrep_trx_order_before(T1,T2) wsrep_service->wsrep_trx_order_before_func(T1,T2) #define wsrep_unlock_rollback() wsrep_service->wsrep_unlock_rollback_func() #define wsrep_set_data_home_dir(A) wsrep_service->wsrep_set_data_home_dir_func(A) +#define wsrep_thd_is_applier(T) wsrep_service->wsrep_thd_is_applier(T) #define wsrep_debug get_wsrep_debug() #define wsrep_log_conflicts get_wsrep_log_conflicts() @@ -220,7 +222,7 @@ void wsrep_thd_set_conflict_state(THD *thd, enum wsrep_conflict_state state); bool wsrep_thd_ignore_table(THD *thd); void wsrep_unlock_rollback(); void wsrep_set_data_home_dir(const char *data_dir); - +my_bool wsrep_thd_is_applier(MYSQL_THD thd); #endif #ifdef __cplusplus diff --git a/include/thread_pool_priv.h b/include/thread_pool_priv.h index f5fdbfbdf47..ef3cd6f269c 100644 --- a/include/thread_pool_priv.h +++ b/include/thread_pool_priv.h @@ -97,8 +97,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/include/wsrep.h b/include/wsrep.h index 843b9c51198..dc85670d60e 100644 --- a/include/wsrep.h +++ b/include/wsrep.h @@ -50,9 +50,9 @@ #define WSREP_WARN(...) WSREP_LOG(sql_print_warning, ##__VA_ARGS__) #define WSREP_ERROR(...) WSREP_LOG(sql_print_error, ##__VA_ARGS__) -#define WSREP_SYNC_WAIT(thd_, before_) \ - { if (WSREP_CLIENT(thd_) && \ - wsrep_sync_wait(thd_, before_)) goto wsrep_error_label; } +#define WSREP_SYNC_WAIT(thd_, before_) \ + do { if (WSREP_CLIENT(thd_) && \ + wsrep_sync_wait(thd_, before_)) goto wsrep_error_label; } while(0) #define WSREP_ERROR_LABEL wsrep_error_label #else #define IF_WSREP(A,B) B @@ -65,7 +65,7 @@ #define WSREP_TO_ISOLATION_BEGIN_ALTER(db_, table_, table_list_, alter_info_) #define WSREP_TO_ISOLATION_END #define WSREP_TO_ISOLATION_BEGIN_WRTCHK(db_, table_, table_list_) -#define WSREP_SYNC_WAIT(thd_, before_) +#define WSREP_SYNC_WAIT(thd_, before_) do { } while(0) #define WSREP_ERROR_LABEL goto wsrep_error_label; wsrep_error_label #endif /* WITH_WSREP */ 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 56364509f31..3c164eef8b6 100644 --- a/mysql-test/include/check-testcase.test +++ b/mysql-test/include/check-testcase.test @@ -86,6 +86,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 c3c98593210..3ae49c5eeb6 100644 --- a/mysql-test/main/analyze_stmt.result +++ b/mysql-test/main/analyze_stmt.result @@ -247,7 +247,7 @@ 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 drop table t1; @@ -281,10 +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 -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 9a60f3e2718..51f882aeafc 100644 --- a/mysql-test/main/func_time.result +++ b/mysql-test/main/func_time.result @@ -3421,6 +3421,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 be203c99c69..232cb16939e 100644 --- a/mysql-test/main/func_time.test +++ b/mysql-test/main/func_time.test @@ -1907,6 +1907,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/mysql_client_test.result b/mysql-test/main/mysql_client_test.result index 6f65979517b..6ecf03946ab 100644 --- a/mysql-test/main/mysql_client_test.result +++ b/mysql-test/main/mysql_client_test.result @@ -149,7 +149,7 @@ ANALYZE number of fields: 13 - 6: name: 'key_len'/''; table: ''/''; db: ''; catalog: 'def'; length: 12288; max_length: 0; type: 253; decimals: 39 - 7: name: 'ref'/''; table: ''/''; db: ''; catalog: 'def'; length: 6144; max_length: 0; type: 253; decimals: 39 - 8: name: 'rows'/''; table: ''/''; db: ''; catalog: 'def'; length: 10; max_length: 0; type: 8; decimals: 0 - - 9: name: 'r_rows'/''; table: ''/''; db: ''; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 10 + - 9: name: 'r_rows'/''; table: ''/''; db: ''; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2 - 10: name: 'filtered'/''; table: ''/''; db: ''; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2 - 11: name: 'r_filtered'/''; table: ''/''; db: ''; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2 - 12: name: 'Extra'/''; table: ''/''; db: ''; catalog: 'def'; length: 765; max_length: 0; type: 253; decimals: 39 @@ -178,7 +178,7 @@ ANALYZE INSERT number of fields: 13 - 6: name: 'key_len'/''; table: ''/''; db: ''; catalog: 'def'; length: 12288; max_length: 0; type: 253; decimals: 39 - 7: name: 'ref'/''; table: ''/''; db: ''; catalog: 'def'; length: 6144; max_length: 0; type: 253; decimals: 39 - 8: name: 'rows'/''; table: ''/''; db: ''; catalog: 'def'; length: 10; max_length: 0; type: 8; decimals: 0 - - 9: name: 'r_rows'/''; table: ''/''; db: ''; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 10 + - 9: name: 'r_rows'/''; table: ''/''; db: ''; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2 - 10: name: 'filtered'/''; table: ''/''; db: ''; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2 - 11: name: 'r_filtered'/''; table: ''/''; db: ''; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2 - 12: name: 'Extra'/''; table: ''/''; db: ''; catalog: 'def'; length: 765; max_length: 0; type: 253; decimals: 39 @@ -207,7 +207,7 @@ ANALYZE UPDATE number of fields: 13 - 6: name: 'key_len'/''; table: ''/''; db: ''; catalog: 'def'; length: 12288; max_length: 0; type: 253; decimals: 39 - 7: name: 'ref'/''; table: ''/''; db: ''; catalog: 'def'; length: 6144; max_length: 0; type: 253; decimals: 39 - 8: name: 'rows'/''; table: ''/''; db: ''; catalog: 'def'; length: 10; max_length: 0; type: 8; decimals: 0 - - 9: name: 'r_rows'/''; table: ''/''; db: ''; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 10 + - 9: name: 'r_rows'/''; table: ''/''; db: ''; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2 - 10: name: 'filtered'/''; table: ''/''; db: ''; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2 - 11: name: 'r_filtered'/''; table: ''/''; db: ''; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2 - 12: name: 'Extra'/''; table: ''/''; db: ''; catalog: 'def'; length: 765; max_length: 0; type: 253; decimals: 39 @@ -236,7 +236,7 @@ ANALYZE DELETE number of fields: 13 - 6: name: 'key_len'/''; table: ''/''; db: ''; catalog: 'def'; length: 12288; max_length: 0; type: 253; decimals: 39 - 7: name: 'ref'/''; table: ''/''; db: ''; catalog: 'def'; length: 6144; max_length: 0; type: 253; decimals: 39 - 8: name: 'rows'/''; table: ''/''; db: ''; catalog: 'def'; length: 10; max_length: 0; type: 8; decimals: 0 - - 9: name: 'r_rows'/''; table: ''/''; db: ''; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 10 + - 9: name: 'r_rows'/''; table: ''/''; db: ''; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2 - 10: name: 'filtered'/''; table: ''/''; db: ''; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2 - 11: name: 'r_filtered'/''; table: ''/''; db: ''; catalog: 'def'; length: 4; max_length: 0; type: 5; decimals: 2 - 12: name: 'Extra'/''; table: ''/''; db: ''; catalog: 'def'; length: 765; max_length: 0; type: 253; decimals: 39 diff --git a/mysql-test/main/old-mode.test b/mysql-test/main/old-mode.test index d7e8ce8ee55..e092ee78a2e 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 bf5d45846a5..064817446b0 100644 --- a/mysql-test/main/partition.result +++ b/mysql-test/main/partition.result @@ -1321,7 +1321,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/show_check.test b/mysql-test/main/show_check.test index a24fa632ea5..6e622ffec27 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 191b889b078..61ba2116969 100644 --- a/mysql-test/main/sp.result +++ b/mysql-test/main/sp.result @@ -6798,7 +6798,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 b0c9120007f..658d41a4736 100644 --- a/mysql-test/main/sp.test +++ b/mysql-test/main/sp.test @@ -8053,7 +8053,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 8edb9e79b70..d337d50e18a 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 41bfd871c39..1b481767fbe 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 ef802279c9c..deb0d6797fe 100644 --- a/mysql-test/main/sp_trans.result +++ b/mysql-test/main/sp_trans.result @@ -640,7 +640,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 7853b528e8f..4bd8dfdf058 100644 --- a/mysql-test/main/subselect_sj_mat.test +++ b/mysql-test/main/subselect_sj_mat.test @@ -1570,7 +1570,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 c4b72483c99..99c3c50ea8c 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 5a02c038caa..af26a69c581 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/userstat.result b/mysql-test/main/userstat.result index 1db891e0184..c838036f118 100644 --- a/mysql-test/main/userstat.result +++ b/mysql-test/main/userstat.result @@ -146,7 +146,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 @@ -157,14 +157,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 @@ -175,13 +174,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 2629eb46200..08d570b86b1 100644 --- a/mysql-test/main/view.result +++ b/mysql-test/main/view.result @@ -6694,6 +6694,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 643f050cee5..ef4a7acd3ef 100644 --- a/mysql-test/main/view.test +++ b/mysql-test/main/view.test @@ -2369,6 +2369,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 +2380,7 @@ show create view v1; drop view v1; // delimiter ;// +--enable_ps_protocol # @@ -3889,7 +3891,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; @@ -6399,6 +6403,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 73f9c65b41f..d9fab5f60f0 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 15e96ec7e8e..6ebe1d653cf 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/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 f4de101fef8..b6393590629 100644 --- a/mysql-test/suite/galera/r/galera_kill_largechanges.result +++ b/mysql-test/suite/galera/r/galera_kill_largechanges.result @@ -1,8 +1,7 @@ -call mtr.add_suppression("WSREP: Last Applied Action message in non-primary configuration from member .*"); 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 ... @@ -10,12 +9,11 @@ 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 -connection node_1; +SELECT COUNT(*) FROM t1; +COUNT(*) +1771561 +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +VARIABLE_VALUE +2 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 2ee291004b0..f500db8871b 100644 --- a/mysql-test/suite/galera/r/galera_kill_smallchanges.result +++ b/mysql-test/suite/galera/r/galera_kill_smallchanges.result @@ -1,4 +1,5 @@ -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; @@ -8,8 +9,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..f0737b944e1 --- /dev/null +++ b/mysql-test/suite/galera/r/galera_load_data.result @@ -0,0 +1,80 @@ +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 1aabc697db1..faea228b6b0 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 61c81ee9dff..9a94a081abe 100644 --- a/mysql-test/suite/innodb/r/doublewrite.result +++ b/mysql-test/suite/innodb/r/doublewrite.result @@ -231,7 +231,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/r/restart.result b/mysql-test/suite/innodb/r/restart.result index c70adac3a55..5e3315be204 100644 --- a/mysql-test/suite/innodb/r/restart.result +++ b/mysql-test/suite/innodb/r/restart.result @@ -5,7 +5,6 @@ # of tables with .isl file or DATA DIRECTORY attribute. call mtr.add_suppression("\\[ERROR\\] InnoDB: Invalid flags 0x7a207879 in .*td\\.ibd"); # FIXME: This is much more noisy than MariaDB 10.1! -call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot read first page in datafile: .*td\\.ibd, Space ID:2048948345, Flags: 2048948345"); call mtr.add_suppression("\\[ERROR\\] InnoDB: Operating system error number .* in a file operation\\."); call mtr.add_suppression("\\[ERROR\\] InnoDB: The error means the system cannot find the path specified\\."); call mtr.add_suppression("\\[ERROR\\] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them\\."); diff --git a/mysql-test/suite/innodb/t/alter_kill.test b/mysql-test/suite/innodb/t/alter_kill.test index 2a130a6ed2c..17b88a00155 100644 --- a/mysql-test/suite/innodb/t/alter_kill.test +++ b/mysql-test/suite/innodb/t/alter_kill.test @@ -8,8 +8,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 a5b2ffef4c8..448f934558c 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"); @@ -403,7 +401,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/innodb/t/restart.test b/mysql-test/suite/innodb/t/restart.test index 2fd7ca244e5..d7582306492 100644 --- a/mysql-test/suite/innodb/t/restart.test +++ b/mysql-test/suite/innodb/t/restart.test @@ -16,7 +16,6 @@ let page_size= `select @@innodb_page_size`; --echo # of tables with .isl file or DATA DIRECTORY attribute. call mtr.add_suppression("\\[ERROR\\] InnoDB: Invalid flags 0x7a207879 in .*td\\.ibd"); --echo # FIXME: This is much more noisy than MariaDB 10.1! -call mtr.add_suppression("\\[ERROR\\] InnoDB: Cannot read first page in datafile: .*td\\.ibd, Space ID:2048948345, Flags: 2048948345"); call mtr.add_suppression("\\[ERROR\\] InnoDB: Operating system error number .* in a file operation\\."); call mtr.add_suppression("\\[ERROR\\] InnoDB: The error means the system cannot find the path specified\\."); call mtr.add_suppression("\\[ERROR\\] InnoDB: If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them\\."); 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/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/handler.h b/sql/handler.h index 84231d77c63..8aaedcc69b9 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -2072,6 +2072,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; @@ -2099,14 +2100,11 @@ 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; void init() { Table_scope_and_contents_source_pod_st::init(); - merge_list.empty(); vers_info.init(); } diff --git a/sql/item.cc b/sql/item.cc index ada79fcb9df..7f4e69a3523 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -2401,7 +2401,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 fe8784a7073..960a6e9ccc8 100644 --- a/sql/item_jsonfunc.cc +++ b/sql/item_jsonfunc.cc @@ -680,11 +680,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 25fecd0a134..2339c6afbdc 100644 --- a/sql/item_timefunc.cc +++ b/sql/item_timefunc.cc @@ -456,7 +456,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) { @@ -471,7 +471,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) @@ -591,7 +591,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) - @@ -1992,6 +1992,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; @@ -2001,7 +2002,7 @@ String *Item_func_date_format::val_str(String *str) if ((null_value= args[0]->get_date(&l_time, is_time_format ? TIME_TIME_ONLY : 0))) 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())) @@ -2015,18 +2016,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 952d97d301c..848b2497f43 100644 --- a/sql/mdl.h +++ b/sql/mdl.h @@ -470,6 +470,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 e0905a6f3ac..7a6a87a1412 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -9769,7 +9769,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/opt_range.cc b/sql/opt_range.cc index 2ea632675a3..b19504cff22 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -1344,14 +1344,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)); @@ -5109,6 +5107,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; @@ -5245,8 +5253,7 @@ bool prepare_search_best_index_intersect(PARAM *param, if (!n_index_scans) 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 6397e3dd5e6..1a6cb3bdc3c 100644 --- a/sql/protocol.h +++ b/sql/protocol.h @@ -230,60 +230,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 16c70b3ed92..0b1749fd10d 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -681,7 +681,7 @@ enum enum_acl_tables ROLES_MAPPING_TABLE, TABLES_MAX // <== 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; @@ -762,7 +762,7 @@ class Grant_table_base Grant_table_base() : start_privilege_column(0), num_privilege_cols(0) { - bzero(&tl, sizeof(tl)); + tl.reset(); }; /* Initialization sequence common for all grant tables. This should be called @@ -8483,60 +8483,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) { @@ -8548,7 +8494,7 @@ bool mysql_show_create_user(THD *thd, LEX_USER *lex_user) uint head_length; DBUG_ENTER("mysql_show_create_user"); - 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; @@ -8624,6 +8570,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 @@ -8648,15 +8645,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 914cd4d826b..4afe34ba18d 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 5fc9ff8209c..0408808d800 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 @@ -519,8 +516,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 6626a054052..48e61177774 100644 --- a/sql/sql_analyse.cc +++ b/sql/sql_analyse.cc @@ -298,9 +298,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; } @@ -1242,4 +1242,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 9c9fa228e2a..4ff57856cd9 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -2586,17 +2586,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); } @@ -2606,11 +2604,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; } @@ -2685,7 +2682,7 @@ void THD::make_explain_field_list(List<Item> &field_list, uint8 explain_flags, if (is_analyze) { field_list.push_back(item= new (mem_root) - Item_float(this, "r_rows", 0.1234, 10, 4), + Item_float(this, "r_rows", 0.1234, 2, 4), mem_root); item->maybe_null=1; } diff --git a/sql/sql_class.h b/sql/sql_class.h index 69e6f58f854..e8083c5981b 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -3801,8 +3801,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, @@ -4836,11 +4836,6 @@ public: Item *sp_fix_func_item(Item **it_addr); 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; - } }; inline void add_to_active_threads(THD *thd) @@ -4945,6 +4940,7 @@ public: void reset(THD *thd_arg) { thd= thd_arg; } }; +class select_result_interceptor; /* Interface for sending tabular data, together with some other stuff: @@ -5043,11 +5039,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 @@ -5123,7 +5118,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 @@ -5257,7 +5252,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; } }; @@ -6297,21 +6292,26 @@ 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) /* Bits in server_command_flags */ diff --git a/sql/sql_cmd.h b/sql/sql_cmd.h index 83dd1b1da4f..017dbca3e5e 100644 --- a/sql/sql_cmd.h +++ b/sql/sql_cmd.h @@ -160,8 +160,6 @@ public: */ virtual bool execute(THD *thd) = 0; - virtual bool log_slow_enabled_statement(const THD *thd) const; - protected: Sql_cmd() {} @@ -179,17 +177,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. */ @@ -219,5 +206,4 @@ public: } }; - #endif // SQL_CMD_INCLUDED diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc index 6881ca5956e..21cd164e2a8 100644 --- a/sql/sql_connect.cc +++ b/sql/sql_connect.cc @@ -1189,7 +1189,6 @@ void end_connection(THD *thd) } thd->wsrep_client_thread= 0; #endif - plugin_thdvar_cleanup(thd); if (thd->user_connect) { diff --git a/sql/sql_cte.cc b/sql/sql_cte.cc index 24fd2c60503..01caeda1325 100644 --- a/sql/sql_cte.cc +++ b/sql/sql_cte.cc @@ -706,6 +706,7 @@ void With_element::move_anchors_ahead() } } first_recursive= new_pos; + spec->first_select()->linkage= DERIVED_TABLE_TYPE; } diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc index 817447fe917..f0a395d63d5 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; if (table->vcol_set) @@ -470,9 +470,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 c6c14bd6ffb..abe4254db3e 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -4490,14 +4490,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 d6cc62c9dbf..e75433eb417 100644 --- a/sql/sql_lex.cc +++ b/sql/sql_lex.cc @@ -5104,20 +5104,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 8eeb0fa3415..b8ed887b52d 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -545,12 +545,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; @@ -566,8 +568,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; @@ -747,10 +750,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; @@ -1638,10 +1645,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 */ @@ -2086,7 +2089,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; @@ -2470,33 +2473,11 @@ com_multi_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 @@ -2527,11 +2508,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 */ @@ -2543,7 +2529,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; /* @@ -2558,8 +2552,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); @@ -3729,6 +3722,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(); @@ -3792,12 +3790,14 @@ mysql_execute_command(THD *thd) case SQLCOM_SHOW_PROFILE: case SQLCOM_SELECT: { -#ifdef WITH_WSREP if (lex->sql_command == SQLCOM_SELECT) - WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_READ) + WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_READ); else - WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW) -#endif /* WITH_WSREP */ + { + WSREP_SYNC_WAIT(thd, WSREP_SYNC_WAIT_BEFORE_SHOW); + if (lex->sql_command == SQLCOM_SHOW_PROFILE) + thd->profiling.discard_current_query(); + } thd->status_var.last_query_cost= 0.0; @@ -4370,12 +4370,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; @@ -4538,48 +4532,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 @@ -4932,7 +4884,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); if (WSREP_CLIENT(thd) && wsrep_sync_wait(thd, WSREP_SYNC_WAIT_BEFORE_UPDATE_DELETE)) @@ -4963,16 +4915,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) { @@ -6325,8 +6276,6 @@ end_with_restore_list: DBUG_ASSERT(first_table == all_tables && first_table != 0); /* fall through */ case SQLCOM_ALTER_SEQUENCE: - thd->query_plan_flags|= QPLAN_ADMIN; - /* fall through */ case SQLCOM_SIGNAL: case SQLCOM_RESIGNAL: case SQLCOM_GET_DIAGNOSTICS: @@ -6579,8 +6528,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); @@ -7137,7 +7086,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); @@ -9664,7 +9613,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 @@ -9702,8 +9651,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 2d3c640b758..cba4949ccd3 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: diff --git a/sql/sql_plugin_services.ic b/sql/sql_plugin_services.ic index f0ec917d411..db73dbb6913 100644 --- a/sql/sql_plugin_services.ic +++ b/sql/sql_plugin_services.ic @@ -183,7 +183,8 @@ static struct wsrep_service_st wsrep_handler = { wsrep_trx_is_aborting, wsrep_trx_order_before, wsrep_unlock_rollback, - wsrep_set_data_home_dir + wsrep_set_data_home_dir, + wsrep_thd_is_applier }; static struct thd_specifics_service_st thd_specifics_handler= diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index d83e88a8d13..63fbc9e29f6 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -1901,8 +1901,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*/ @@ -1926,7 +1938,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)); } @@ -2464,6 +2476,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: @@ -2483,6 +2496,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: @@ -2492,6 +2506,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: @@ -2520,14 +2535,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 b179ae6ae40..ae6c691ae56 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_FOUND_COMMENT (1ULL << 39) // SELECT, intern, parser diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 831bd66166c..7ce4ea49c73 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -2833,7 +2833,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; @@ -2923,7 +2923,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; @@ -3051,7 +3051,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 */ @@ -4431,7 +4431,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; @@ -9585,7 +9585,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; @@ -18003,7 +18003,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; diff --git a/sql/sql_select.h b/sql/sql_select.h index 57d8dab8258..88959f84fdb 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -241,7 +241,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 */ @@ -2134,9 +2133,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 426f40d1729..0003d546ed3 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1238,13 +1238,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; { /* @@ -1259,20 +1302,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), @@ -1287,7 +1330,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; @@ -6655,7 +6698,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 23783405b19..7c920cafc4f 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; @@ -126,7 +127,7 @@ uint convert_to_printable(char *to, size_t to_len, const char *from, size_t from_len, CHARSET_INFO *from_cs, size_t nbytes= 0); -class String +class String : public Sql_alloc { char *Ptr; uint32 str_length,Alloced_length, extra_alloc; @@ -176,23 +177,6 @@ public: alloced= thread_specific= 0; str_charset=str.str_charset; } - 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 */ } - ~String() { free(); } /* Mark variable thread specific it it's not allocated already */ diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 36357ce765d..b2d9ea3bdaf 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -10627,8 +10627,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 d03807c63d5..632822a8e87 100644 --- a/sql/sql_trigger.cc +++ b/sql/sql_trigger.cc @@ -1806,7 +1806,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)); @@ -2058,7 +2058,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_union.cc b/sql/sql_union.cc index 7b0e79620ff..87fbbebe4ba 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 07230b2205b..c2cb5902371 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -215,7 +215,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; + } } } } @@ -911,15 +911,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; @@ -2180,7 +2173,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 98ead67011c..b9f6a64b378 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -6383,7 +6383,7 @@ create_table_option: from the global list. */ LEX *lex=Lex; - lex->create_info.merge_list= lex->select_lex.table_list; + lex->create_info.merge_list= lex->select_lex.table_list.first; lex->select_lex.table_list= lex->save_list; /* When excluding union list from the global list we assume that @@ -6392,7 +6392,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; @@ -14769,6 +14769,7 @@ load: LOAD data_or_xml { LEX *lex= thd->lex; + mysql_init_select(lex); if (unlikely(lex->sphead)) { diff --git a/sql/sql_yacc_ora.yy b/sql/sql_yacc_ora.yy index f7aa1c937c6..61f2426427e 100644 --- a/sql/sql_yacc_ora.yy +++ b/sql/sql_yacc_ora.yy @@ -6229,7 +6229,7 @@ create_table_option: from the global list. */ LEX *lex=Lex; - lex->create_info.merge_list= lex->select_lex.table_list; + lex->create_info.merge_list= lex->select_lex.table_list.first; lex->select_lex.table_list= lex->save_list; /* When excluding union list from the global list we assume that @@ -6238,7 +6238,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/table.h b/sql/table.h index 9156390a0eb..72f516aebdb 100644 --- a/sql/table.h +++ b/sql/table.h @@ -793,6 +793,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. @@ -1351,6 +1353,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; @@ -1932,6 +1936,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, @@ -1945,7 +1950,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); @@ -2461,8 +2466,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()); @@ -2474,12 +2478,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/sql/wsrep_dummy.cc b/sql/wsrep_dummy.cc index 4438ede9c1c..9afdb36a643 100644 --- a/sql/wsrep_dummy.cc +++ b/sql/wsrep_dummy.cc @@ -150,3 +150,6 @@ void wsrep_unlock_rollback() void wsrep_set_data_home_dir(const char *) { } + +my_bool wsrep_thd_is_applier(MYSQL_THD thd) +{ return false; } diff --git a/sql/wsrep_thd.cc b/sql/wsrep_thd.cc index 6d4e4f6bc5f..f28063849ea 100644 --- a/sql/wsrep_thd.cc +++ b/sql/wsrep_thd.cc @@ -697,3 +697,13 @@ void wsrep_thd_auto_increment_variables(THD* thd, *increment= thd->variables.auto_increment_increment; } } + +my_bool wsrep_thd_is_applier(MYSQL_THD thd) +{ + my_bool is_applier= false; + + if (thd && thd->wsrep_applier) + is_applier= true; + + return (is_applier); +} diff --git a/storage/connect/plugutil.cpp b/storage/connect/plugutil.cpp index 048f00be75f..6790e7eb45c 100644 --- a/storage/connect/plugutil.cpp +++ b/storage/connect/plugutil.cpp @@ -526,7 +526,7 @@ BOOL PlugSubSet(void *memp, uint size) /***********************************************************************/ /* Use it to export a function that do throwing. */ /***********************************************************************/ -void *DoThrow(int n) +static void *DoThrow(int n) { throw n; } /* end of DoThrow */ 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/dict/dict0mem.cc b/storage/innobase/dict/dict0mem.cc index 077fab8f131..d3333de5ced 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 @@ -1076,14 +1076,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..7f4b12d302b 100644 --- a/storage/innobase/dict/dict0stats_bg.cc +++ b/storage/innobase/dict/dict0stats_bg.cc @@ -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_applier(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 3070f989c04..f32cf18b774 100644 --- a/storage/innobase/fsp/fsp0file.cc +++ b/storage/innobase/fsp/fsp0file.cc @@ -513,9 +513,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); @@ -562,8 +562,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 f33527b156d..8f45da30f9d 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -2914,7 +2914,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 @@ -13000,8 +12999,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); @@ -13349,12 +13346,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; } } diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index c2c93ad823c..ba34b739587 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -468,10 +468,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; @@ -564,15 +560,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 //extern "C" int wsrep_trx_order_before(void *thd1, void *thd2); diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index ae634c791b1..5d921f10793 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -6897,7 +6897,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, @@ -7028,7 +7028,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, diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h index ef2a505085b..ea8460c1376 100644 --- a/storage/innobase/include/dict0mem.h +++ b/storage/innobase/include/dict0mem.h @@ -2,7 +2,7 @@ Copyright (c) 1996, 2017, 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 @@ -476,14 +476,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..18321774cd4 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(). */ diff --git a/storage/innobase/os/os0file.cc b/storage/innobase/os/os0file.cc index 82f792ad0fa..7890ea4e6dc 100644 --- a/storage/innobase/os/os0file.cc +++ b/storage/innobase/os/os0file.cc @@ -5726,7 +5726,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 1d5357f7473..772d5487a0f 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -2686,10 +2686,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/row/row0trunc.cc b/storage/innobase/row/row0trunc.cc index ce98717b3c9..5f8a60b83c9 100644 --- a/storage/innobase/row/row0trunc.cc +++ b/storage/innobase/row/row0trunc.cc @@ -263,7 +263,7 @@ TruncateLogParser::scan( while (fil_file_readdir_next_file( &err, dir_path, dir, &fileinfo) == 0) { - ulint nm_len = strlen(fileinfo.name); + const size_t nm_len = strlen(fileinfo.name); if (fileinfo.type == OS_FILE_TYPE_FILE && nm_len > sizeof "ib_trunc.log" @@ -286,18 +286,13 @@ TruncateLogParser::scan( err = DB_OUT_OF_MEMORY; break; } - memset(log_file_name, 0, sz); - strncpy(log_file_name, dir_path, dir_len); - ulint log_file_name_len = strlen(log_file_name); - if (log_file_name[log_file_name_len - 1] - != OS_PATH_SEPARATOR) { - - log_file_name[log_file_name_len] - = OS_PATH_SEPARATOR; - log_file_name_len = strlen(log_file_name); + memcpy(log_file_name, dir_path, dir_len); + char* e = log_file_name + dir_len; + if (e[-1] != OS_PATH_SEPARATOR) { + *e++ = OS_PATH_SEPARATOR; } - strcat(log_file_name, fileinfo.name); + strcpy(e, fileinfo.name); log_files.push_back(log_file_name); } } diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc index 1c9450fb26d..b77e09c898f 100644 --- a/storage/innobase/trx/trx0purge.cc +++ b/storage/innobase/trx/trx0purge.cc @@ -1447,7 +1447,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/ut/ut0new.cc b/storage/innobase/ut/ut0new.cc index 14f2748218c..f1d5eb7407a 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 d1cb2d584b3..27e46873f3b 100644 --- a/storage/maria/ma_recovery.c +++ b/storage/maria/ma_recovery.c @@ -1410,6 +1410,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), @@ -3623,8 +3628,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 a3f34f3cc42..925298c15e8 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); @@ -3001,9 +3001,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; @@ -4733,11 +4733,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); } @@ -14569,8 +14566,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(¶m->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 f09e263fe75..97443f0d22d 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/unittest/sql/mf_iocache-t.cc b/unittest/sql/mf_iocache-t.cc index cfa19102779..40fd9509a88 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, |