mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-9101 Limit size of created disk temporary files and tables
Two new variables added: - max_tmp_space_usage : Limits the the temporary space allowance per user - max_total_tmp_space_usage: Limits the temporary space allowance for all users. New status variables: tmp_space_used & max_tmp_space_used New field in information_schema.process_list: TMP_SPACE_USED The temporary space is counted for: - All SQL level temporary files. This includes files for filesort, transaction temporary space, analyze, binlog_stmt_cache etc. It does not include engine internal temporary files used for repair, alter table, index pre sorting etc. - All internal on disk temporary tables created as part of resolving a SELECT, multi-source update etc. Special cases: - When doing a commit, the last flush of the binlog_stmt_cache will not cause an error even if the temporary space limit is exceeded. This is to avoid giving errors on commit. This means that a user can temporary go over the limit with up to binlog_stmt_cache_size. Noteworthy issue: - One has to be careful when using small values for max_tmp_space_limit together with binary logging and with non transactional tables. If a the binary log entry for the query is bigger than binlog_stmt_cache_size and one hits the limit of max_tmp_space_limit when flushing the entry to disk, the query will abort and the binary log will not contain the last changes to the table. This will also stop the slave! This is also true for all Aria tables as Aria cannot do rollback (except in case of crashes)! One way to avoid it is to use @@binlog_format=statement for queries that updates a lot of rows. Implementation: - All writes to temporary files or internal temporary tables, that increases the file size, are routed through temp_file_size_cb_func() which updates and checks the temp space usage. - Most of the temporary file monitoring is done inside IO_CACHE. Temporary file monitoring is done inside the Aria engine. - MY_TRACK and MY_TRACK_WITH_LIMIT are new flags for ini_io_cache(). MY_TRACK means that we track the file usage. TRACK_WITH_LIMIT means that we track the file usage and we give an error if the limit is breached. This is used to not give an error on commit when binlog_stmp_cache is flushed. - global_tmp_space_used contains the total tmp space used so far. This is needed quickly check against max_total_tmp_space_usage. - Temporary space errors are using EE_LOCAL_TMP_SPACE_FULL and handler errors are using HA_ERR_LOCAL_TMP_SPACE_FULL. This is needed until we move general errors to it's own error space so that they cannot conflict with system error numbers. - Return value of my_chsize() and mysql_file_chsize() has changed so that -1 is returned in the case my_chsize() could not decrease the file size (very unlikely and will not happen on modern systems). All calls to _chsize() are updated to check for > 0 as the error condition. - At the destruction of THD we check that THD::tmp_file_space == 0 - At server end we check that global_tmp_space_used == 0 - As a precaution against errors in the tmp_space_used code, one can set max_tmp_space_usage and max_total_tmp_space_usage to 0 to disable the tmp space quota errors. - truncate_io_cache() function added. - Aria tables using static or dynamic row length are registered in 8K increments to avoid some calls to update_tmp_file_size(). Other things: - Ensure that all handler errors are registered. Before, some engine errors could be printed as "Unknown error". - Fixed bug in filesort() that causes a assert if there was an error when writing to the temporay file. - Fixed that compute_window_func() now takes into account write errors. - In case of parallel replication, rpl_group_info::cleanup_context() could call trans_rollback() with thd->error set, which would cause an assert. Fixed by resetting the error before calling trans_rollback(). - Fixed bug in subselect3.inc which caused following test to use heap tables with low value for max_heap_table_size - Fixed bug in sql_expression_cache where it did not overflow heap table to Aria table. - Added Max_tmp_disk_space_used to slow query log. - Fixed some bugs in log_slow_innodb.test
This commit is contained in:
@@ -50,6 +50,7 @@
|
||||
#define HA_OPEN_FOR_CREATE 4096U
|
||||
#define HA_OPEN_FOR_DROP (1U << 13) /* Open part of drop */
|
||||
#define HA_OPEN_GLOBAL_TMP_TABLE (1U << 14) /* TMP table used by repliction */
|
||||
#define HA_OPEN_SIZE_TRACKING (1U << 15)
|
||||
|
||||
/*
|
||||
Allow opening even if table is incompatible as this is for ALTER TABLE which
|
||||
@@ -543,7 +544,9 @@ enum ha_base_keytype {
|
||||
#define HA_ERR_COMMIT_ERROR 197
|
||||
#define HA_ERR_PARTITION_LIST 198
|
||||
#define HA_ERR_NO_ENCRYPTION 199
|
||||
#define HA_ERR_LAST 199 /* Copy of last error nr * */
|
||||
#define HA_ERR_LOCAL_TMP_SPACE_FULL 200
|
||||
#define HA_ERR_GLOBAL_TMP_SPACE_FULL 201
|
||||
#define HA_ERR_LAST 201 /* Copy of last error nr * */
|
||||
|
||||
/* Number of different errors */
|
||||
#define HA_ERR_ERRORS (HA_ERR_LAST - HA_ERR_FIRST + 1)
|
||||
|
@@ -110,7 +110,10 @@ static const char *handler_error_messages[]=
|
||||
"Sequence values are conflicting",
|
||||
"Error during commit",
|
||||
"Cannot select partitions",
|
||||
"Cannot initialize encryption. Check that all encryption parameters have been set"
|
||||
"Cannot initialize encryption. Check that all encryption parameters have been set",
|
||||
/* 200 */
|
||||
"Local temporary space limit reached",
|
||||
"Global temporary space limit reached"
|
||||
};
|
||||
|
||||
#endif /* MYSYS_MY_HANDLER_ERRORS_INCLUDED */
|
||||
|
@@ -94,6 +94,8 @@ C_MODE_START
|
||||
#define MY_ROOT_USE_MPROTECT 0x20000U /* init_alloc_root: read only segments */
|
||||
/* Tree that should delete things automatically */
|
||||
#define MY_TREE_WITH_DELETE 0x40000U
|
||||
#define MY_TRACK 0x80000U /* Track tmp usage */
|
||||
#define MY_TRACK_WITH_LIMIT 0x100000U /* Give error if over tmp_file_usage */
|
||||
|
||||
#define MY_CHECK_ERROR 1U /* Params to my_end; Check open-close */
|
||||
#define MY_GIVE_INFO 2U /* Give time info about process*/
|
||||
@@ -178,6 +180,17 @@ uchar *my_large_malloc(size_t *size, myf my_flags);
|
||||
void my_large_free(void *ptr, size_t size);
|
||||
void my_large_page_truncate(size_t *size);
|
||||
|
||||
/* Tracking tmp file usage */
|
||||
|
||||
struct tmp_file_tracking
|
||||
{
|
||||
ulonglong previous_file_size;
|
||||
ulonglong file_size;
|
||||
};
|
||||
|
||||
typedef int (*TMPFILE_SIZE_CB)(struct tmp_file_tracking *track, int no_error);
|
||||
extern TMPFILE_SIZE_CB update_tmp_file_size;
|
||||
|
||||
#ifdef _WIN32
|
||||
extern BOOL my_obtain_privilege(LPCSTR lpPrivilege);
|
||||
#endif
|
||||
@@ -431,6 +444,8 @@ typedef struct st_io_cache /* Used when caching files */
|
||||
*/
|
||||
IO_CACHE_SHARE *share;
|
||||
|
||||
/* Track tmpfile usage. Done if (myflags & MY_TRACK) is true */
|
||||
struct tmp_file_tracking tracking;
|
||||
/*
|
||||
A caller will use my_b_read() macro to read from the cache
|
||||
if the data is already in cache, it will be simply copied with
|
||||
@@ -498,6 +513,8 @@ extern PSI_file_key key_file_io_cache;
|
||||
/* inline functions for mf_iocache */
|
||||
|
||||
extern int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock);
|
||||
extern void end_tracking_io_cache(IO_CACHE *info);
|
||||
extern void truncate_io_cache(IO_CACHE *info);
|
||||
extern int _my_b_get(IO_CACHE *info);
|
||||
extern int _my_b_read(IO_CACHE *info,uchar *Buffer,size_t Count);
|
||||
extern int _my_b_write(IO_CACHE *info,const uchar *Buffer,size_t Count);
|
||||
@@ -831,8 +848,10 @@ extern my_bool open_cached_file(IO_CACHE *cache,const char *dir,
|
||||
myf cache_myflags);
|
||||
extern my_bool real_open_cached_file(IO_CACHE *cache);
|
||||
extern void close_cached_file(IO_CACHE *cache);
|
||||
File create_temp_file(char *to, const char *dir, const char *pfx,
|
||||
extern File create_temp_file(char *to, const char *dir, const char *pfx,
|
||||
int mode, myf MyFlags);
|
||||
extern my_bool io_cache_tmp_file_track(IO_CACHE *info, ulonglong file_size);
|
||||
|
||||
#define my_init_dynamic_array(A,B,C,D,E,F) init_dynamic_array2(A,B,C,NULL,D,E,F)
|
||||
#define my_init_dynamic_array2(A,B,C,D,E,F,G) init_dynamic_array2(A,B,C,D,E,F,G)
|
||||
extern my_bool init_dynamic_array2(PSI_memory_key psi_key, DYNAMIC_ARRAY *array,
|
||||
|
@@ -74,7 +74,9 @@ extern const char *globerrs[]; /* my_error_messages is here */
|
||||
#define EE_MEMCNTL 38
|
||||
#define EE_DUPLICATE_CHARSET 39
|
||||
#define EE_NAME_DEPRECATED 40
|
||||
#define EE_ERROR_LAST 40 /* Copy last error nr */
|
||||
#define EE_LOCAL_TMP_SPACE_FULL 41
|
||||
#define EE_GLOBAL_TMP_SPACE_FULL 42
|
||||
#define EE_ERROR_LAST 42 /* Copy last error nr */
|
||||
|
||||
/* Add error numbers before EE_ERROR_LAST and change it accordingly. */
|
||||
|
||||
|
@@ -54,7 +54,8 @@ perl;
|
||||
while (<FILE>) {
|
||||
print ;
|
||||
}
|
||||
print $command_file "--let \$log_grep_failed= 1;\n";
|
||||
print $command_file "--let \$log_grep_failed= 1\n";
|
||||
print $command_file "--let \$log_grep_lines= $lines\n";
|
||||
} else {
|
||||
print "[log_grep.inc] found expected match count: $log_expected_matches\n";
|
||||
}
|
||||
@@ -69,6 +70,14 @@ EOF
|
||||
--remove_file $LOG_GREP_PERL_RESULT
|
||||
if ($log_grep_failed)
|
||||
{
|
||||
--echo #
|
||||
--echo # ERROR: report
|
||||
--echo #
|
||||
--echo log_file: $log_file
|
||||
--echo grep_pattern: $grep_pattern
|
||||
--echo Expected_matches: $log_expected_matches
|
||||
--echo Found_matches: $log_grep_lines
|
||||
|
||||
SHOW SESSION STATUS LIKE 'Slow_queries';
|
||||
SHOW GLOBAL VARIABLES LIKE 'log%';
|
||||
SHOW GLOBAL VARIABLES LIKE 'long_query_time';
|
||||
@@ -80,5 +89,5 @@ if ($log_grep_failed)
|
||||
SHOW SESSION VARIABLES LIKE 'min_examined_row_limit';
|
||||
SHOW SESSION VARIABLES LIKE 'query_cache%';
|
||||
SHOW SESSION VARIABLES LIKE 'slow_query%';
|
||||
--die Testcase failed!
|
||||
--die Testcase failed! Error rapport above.
|
||||
}
|
||||
|
@@ -1089,7 +1089,8 @@ t1 CREATE TABLE `t1` (
|
||||
`SENT_ROWS` bigint(10) NOT NULL,
|
||||
`QUERY_ID` bigint(10) NOT NULL,
|
||||
`INFO_BINARY` blob,
|
||||
`TID` bigint(10) NOT NULL
|
||||
`TID` bigint(10) NOT NULL,
|
||||
`TMP_SPACE_USED` bigint(10) NOT NULL
|
||||
) DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
|
||||
drop table t1;
|
||||
create temporary table t1 like information_schema.processlist;
|
||||
@@ -1114,7 +1115,8 @@ t1 CREATE TEMPORARY TABLE `t1` (
|
||||
`SENT_ROWS` bigint(10) NOT NULL,
|
||||
`QUERY_ID` bigint(10) NOT NULL,
|
||||
`INFO_BINARY` blob,
|
||||
`TID` bigint(10) NOT NULL
|
||||
`TID` bigint(10) NOT NULL,
|
||||
`TMP_SPACE_USED` bigint(10) NOT NULL
|
||||
) DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
|
||||
drop table t1;
|
||||
create table t1 like information_schema.character_sets;
|
||||
|
@@ -43,36 +43,53 @@ SELECT 1;
|
||||
[log_grep.inc] lines: 0
|
||||
[log_grep.inc] file: log_slow_innodb-verbosity_2 pattern: ^# Tmp_tables: \d+ Tmp_disk_tables: \d+$
|
||||
[log_grep.inc] lines: 0
|
||||
#
|
||||
# Test 'query_plan'
|
||||
#
|
||||
SET SESSION log_slow_verbosity='query_plan';
|
||||
[slow_log_start.inc] log_slow_innodb-verbosity_3
|
||||
INSERT INTO t1 VALUE(1001,1001);
|
||||
[log_slow_stop.inc] log_slow_innodb-verbosity_3
|
||||
--source include/log_slow_start.inc
|
||||
INSERT INTO t1 VALUE(1000)
|
||||
[log_grep.inc] file: log_slow_innodb-verbosity_3
|
||||
--source include/log_slow_start.inc
|
||||
INSERT INTO t1 VALUE(1000) pattern: ^# Thread_id: .+ Schema: .+ QC_hit: (Yes|No)$ expected_matches: 2
|
||||
[log_grep.inc] file: log_slow_innodb-verbosity_3 pattern: ^# Thread_id: .+ Schema: .+ QC_hit: (Yes|No)$ expected_matches: 2
|
||||
[log_grep.inc] found expected match count: 2
|
||||
[log_grep.inc] file: log_slow_innodb-verbosity_3
|
||||
--source include/log_slow_start.inc
|
||||
INSERT INTO t1 VALUE(1000) pattern: ^# Query_time: \d+\.\d+ Lock_time: \d+\.\d+ Rows_sent: \d+ Rows_examined: \d+$ expected_matches: 2
|
||||
[log_grep.inc] file: log_slow_innodb-verbosity_3 pattern: ^# Query_time: \d+\.\d+ Lock_time: \d+\.\d+ Rows_sent: \d+ Rows_examined: \d+$ expected_matches: 2
|
||||
[log_grep.inc] found expected match count: 2
|
||||
[log_grep.inc] file: log_slow_innodb-verbosity_3
|
||||
--source include/log_slow_start.inc
|
||||
INSERT INTO t1 VALUE(1000) pattern: ^# Rows_affected: \d+ Bytes_sent: \d+$ expected_matches: 2
|
||||
[log_grep.inc] file: log_slow_innodb-verbosity_3 pattern: ^# Rows_affected: \d+ Bytes_sent: \d+$ expected_matches: 2
|
||||
[log_grep.inc] found expected match count: 2
|
||||
[log_grep.inc] file: log_slow_innodb-verbosity_3
|
||||
--source include/log_slow_start.inc
|
||||
INSERT INTO t1 VALUE(1000) pattern: ^# Full_scan: (Yes|No) Full_join: (Yes|No) Tmp_table: (Yes|No) Tmp_table_on_disk: (Yes|No)$
|
||||
[log_grep.inc] file: log_slow_innodb-verbosity_3 pattern: ^# Full_scan: (Yes|No) Full_join: (Yes|No) Tmp_table: (Yes|No) Tmp_table_on_disk: (Yes|No)$
|
||||
[log_grep.inc] lines: 0
|
||||
[log_grep.inc] file: log_slow_innodb-verbosity_3
|
||||
--source include/log_slow_start.inc
|
||||
INSERT INTO t1 VALUE(1000) pattern: ^# Filesort: (Yes|No) Filesort_on_disk: (Yes|No) Merge_passes: \d+\ Priority_queue: (Yes|No)$
|
||||
[log_grep.inc] file: log_slow_innodb-verbosity_3 pattern: ^# Filesort: (Yes|No) Filesort_on_disk: (Yes|No) Merge_passes: \d+\ Priority_queue: (Yes|No)$
|
||||
[log_grep.inc] lines: 0
|
||||
[log_grep.inc] file: log_slow_innodb-verbosity_3
|
||||
--source include/log_slow_start.inc
|
||||
INSERT INTO t1 VALUE(1000) pattern: ^# Filesort: (Yes|No) Filesort_on_disk: (Yes|No) Merge_passes: \d+\ Priority_queue: (Yes|No)$
|
||||
[log_grep.inc] file: log_slow_innodb-verbosity_3 pattern: ^# Filesort: (Yes|No) Filesort_on_disk: (Yes|No) Merge_passes: \d+\ Priority_queue: (Yes|No)$
|
||||
[log_grep.inc] lines: 0
|
||||
[log_grep.inc] file: log_slow_innodb-verbosity_3
|
||||
--source include/log_slow_start.inc
|
||||
INSERT INTO t1 VALUE(1000) pattern: ^# Tmp_tables: \d+ Tmp_disk_tables: \d+$
|
||||
[log_grep.inc] file: log_slow_innodb-verbosity_3 pattern: ^# Tmp_tables: \d+ Tmp_disk_tables: \d+$
|
||||
[log_grep.inc] lines: 0
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Test max_tmp_disk_space_used
|
||||
#
|
||||
CREATE TABLE t1(a INT primary key, c varchar(1024)) ENGINE=InnoDB;
|
||||
insert into t1 select seq, concat(repeat(char(65+mod(seq,61)),32),repeat(char(65+mod(seq,59)),32)) from seq_1_to_1000;
|
||||
SET SESSION log_slow_verbosity='query_plan';
|
||||
SET SESSION sort_buffer_size=16384;
|
||||
SET SESSION long_query_time=0;
|
||||
[slow_log_start.inc] log_slow_innodb-verbosity_4
|
||||
SELECT c, count(*) from t1 group by c order by 2 limit 700,10;
|
||||
c count(*)
|
||||
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM 2
|
||||
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN 2
|
||||
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO 2
|
||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP 2
|
||||
GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ 2
|
||||
HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR 2
|
||||
IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIISSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS 2
|
||||
JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT 2
|
||||
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU 2
|
||||
LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV 2
|
||||
[log_slow_stop.inc] log_slow_innodb-verbosity_4
|
||||
[log_grep.inc] file: log_slow_innodb-verbosity_4 pattern: ^# Max_tmp_disk_space_used.* expected_matches: 1
|
||||
[log_grep.inc] found expected match count: 1
|
||||
drop table t1;
|
||||
#
|
||||
# Cleanup
|
||||
#
|
||||
|
@@ -61,19 +61,49 @@ SELECT 1;
|
||||
--let log_slow_verbosity_innodb_expected_matches= 0
|
||||
--source include/log_slow_grep.inc
|
||||
|
||||
#
|
||||
# Test 'query_plan'
|
||||
#
|
||||
--echo #
|
||||
--echo # Test 'query_plan'
|
||||
--echo #
|
||||
|
||||
SET SESSION log_slow_verbosity='query_plan';
|
||||
let log_file=$log_slow_prefix-verbosity_3
|
||||
--let log_file=$log_slow_prefix-verbosity_3
|
||||
|
||||
--source include/log_slow_start.inc
|
||||
INSERT INTO t1 VALUE(1000);
|
||||
INSERT INTO t1 VALUE(1001,1001);
|
||||
--source include/log_slow_stop.inc
|
||||
|
||||
--let log_slow_verbosity_innodb_expected_matches= 1
|
||||
--source include/log_slow_grep.inc
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Test max_tmp_disk_space_used
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1(a INT primary key, c varchar(1024)) ENGINE=InnoDB;
|
||||
insert into t1 select seq, concat(repeat(char(65+mod(seq,61)),32),repeat(char(65+mod(seq,59)),32)) from seq_1_to_1000;
|
||||
|
||||
SET SESSION log_slow_verbosity='query_plan';
|
||||
SET SESSION sort_buffer_size=16384;
|
||||
SET SESSION long_query_time=0;
|
||||
--let log_file=$log_slow_prefix-verbosity_4
|
||||
|
||||
--disable_ps_protocol
|
||||
--source include/log_slow_start.inc
|
||||
SELECT c, count(*) from t1 group by c order by 2 limit 700,10;
|
||||
--source include/log_slow_stop.inc
|
||||
--enable_ps_protocol
|
||||
|
||||
--let grep_pattern = ^# Max_tmp_disk_space_used.*
|
||||
|
||||
--let log_expected_matches= 1
|
||||
--source include/log_grep.inc
|
||||
|
||||
drop table t1;
|
||||
|
||||
--echo #
|
||||
--echo # Cleanup
|
||||
--echo #
|
||||
|
||||
--source include/log_slow_cleanup.inc
|
||||
|
@@ -670,6 +670,13 @@ The following specify which files/extra groups are read (specified before remain
|
||||
seconds will be aborted. The argument will be treated as
|
||||
a decimal value with microsecond precision. A value of 0
|
||||
(default) means no timeout
|
||||
--max-tmp-session-space-usage=#
|
||||
The maximum total size of temporary file and temporary
|
||||
table usage. A value of 0 disables this feature
|
||||
--max-tmp-total-space-usage=#
|
||||
The maximum total size of all temporary file and
|
||||
temporary table usage over all connections. A value of 0
|
||||
disables this feature
|
||||
--max-user-connections=#
|
||||
The maximum number of active connections for a single
|
||||
user (0 = no limit)
|
||||
@@ -1766,6 +1773,8 @@ max-session-mem-used 9223372036854775807
|
||||
max-sort-length 1024
|
||||
max-sp-recursion-depth 0
|
||||
max-statement-time 0
|
||||
max-tmp-session-space-usage 1099511627776
|
||||
max-tmp-total-space-usage 1099511627776
|
||||
max-user-connections 0
|
||||
max-write-lock-count 18446744073709551615
|
||||
memlock FALSE
|
||||
|
@@ -183,7 +183,7 @@ show status like 'hand%write%';
|
||||
Variable_name Value
|
||||
Handler_tmp_write 0
|
||||
Handler_write 0
|
||||
show status like '%tmp%';
|
||||
show status like '%\_tmp%';
|
||||
Variable_name Value
|
||||
Created_tmp_disk_tables 0
|
||||
Created_tmp_files 0
|
||||
@@ -191,12 +191,13 @@ Created_tmp_tables 0
|
||||
Handler_tmp_delete 0
|
||||
Handler_tmp_update 0
|
||||
Handler_tmp_write 0
|
||||
Max_tmp_space_used 0
|
||||
Rows_tmp_read 5
|
||||
show status like 'hand%write%';
|
||||
Variable_name Value
|
||||
Handler_tmp_write 0
|
||||
Handler_write 0
|
||||
show status like '%tmp%';
|
||||
show status like '%\_tmp%';
|
||||
Variable_name Value
|
||||
Created_tmp_disk_tables 0
|
||||
Created_tmp_files 0
|
||||
@@ -204,12 +205,13 @@ Created_tmp_tables 0
|
||||
Handler_tmp_delete 0
|
||||
Handler_tmp_update 0
|
||||
Handler_tmp_write 0
|
||||
Rows_tmp_read 14
|
||||
Max_tmp_space_used 0
|
||||
Rows_tmp_read 15
|
||||
show status like 'com_show_status';
|
||||
Variable_name Value
|
||||
Com_show_status 8
|
||||
rnd_diff tmp_table_diff
|
||||
30 8
|
||||
32 8
|
||||
disconnect con1;
|
||||
connection default;
|
||||
flush status;
|
||||
@@ -340,7 +342,7 @@ Handler_tmp_update 2
|
||||
Handler_tmp_write 7
|
||||
Handler_update 0
|
||||
Handler_write 4
|
||||
show status like '%tmp%';
|
||||
show status like '%_tmp%';
|
||||
Variable_name Value
|
||||
Created_tmp_disk_tables 1
|
||||
Created_tmp_files 0
|
||||
@@ -348,6 +350,7 @@ Created_tmp_tables 2
|
||||
Handler_tmp_delete 0
|
||||
Handler_tmp_update 2
|
||||
Handler_tmp_write 7
|
||||
Max_tmp_space_used 32768
|
||||
Rows_tmp_read 44
|
||||
drop table t1;
|
||||
CREATE TABLE t1 (i int(11) DEFAULT NULL, KEY i (i) ) ENGINE=MyISAM;
|
||||
|
@@ -244,9 +244,9 @@ let $rnd_next = `show global status like 'handler_read_rnd_next'`;
|
||||
let $tmp_table = `show global status like 'Created_tmp_tables'`;
|
||||
show status like 'com_show_status';
|
||||
show status like 'hand%write%';
|
||||
show status like '%tmp%';
|
||||
show status like '%\_tmp%';
|
||||
show status like 'hand%write%';
|
||||
show status like '%tmp%';
|
||||
show status like '%\_tmp%';
|
||||
show status like 'com_show_status';
|
||||
let $rnd_next2 = `show global status like 'handler_read_rnd_next'`;
|
||||
let $tmp_table2 = `show global status like 'Created_tmp_tables'`;
|
||||
@@ -367,7 +367,7 @@ select b, count(*) from t1 group by b;
|
||||
select g, count(*) from t1 group by g;
|
||||
show status like 'Row%';
|
||||
show status like 'Handler%';
|
||||
show status like '%tmp%';
|
||||
show status like '%_tmp%';
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
|
@@ -985,7 +985,7 @@ flush status;
|
||||
select count(*) from t0 A, t0 B, t0 C, t0 D where D.a in (select a from t1 E where a+1 < 10000 + A.a + B.a +C.a+D.a);
|
||||
--enable_ps2_protocol
|
||||
show status like 'Created_tmp_disk_tables';
|
||||
set @save_max_heap_table_size=@@max_heap_table_size;
|
||||
set @@max_heap_table_size=@save_max_heap_table_size;
|
||||
set @@optimizer_switch=@save_optimizer_switch;
|
||||
drop table t0, t1;
|
||||
|
||||
@@ -1137,6 +1137,7 @@ set @@optimizer_switch=@save_optimizer_switch;
|
||||
--echo
|
||||
--echo BUG#37842: Assertion in DsMrr_impl::dsmrr_init, at handler.cc:4307
|
||||
--echo
|
||||
|
||||
CREATE TABLE t1 (
|
||||
`pk` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`int_key` int(11) DEFAULT NULL,
|
||||
|
@@ -1179,7 +1179,7 @@ count(*)
|
||||
show status like 'Created_tmp_disk_tables';
|
||||
Variable_name Value
|
||||
Created_tmp_disk_tables 1
|
||||
set @save_max_heap_table_size=@@max_heap_table_size;
|
||||
set @@max_heap_table_size=@save_max_heap_table_size;
|
||||
set @@optimizer_switch=@save_optimizer_switch;
|
||||
drop table t0, t1;
|
||||
create table t0 (a int);
|
||||
|
@@ -1182,7 +1182,7 @@ count(*)
|
||||
show status like 'Created_tmp_disk_tables';
|
||||
Variable_name Value
|
||||
Created_tmp_disk_tables 1
|
||||
set @save_max_heap_table_size=@@max_heap_table_size;
|
||||
set @@max_heap_table_size=@save_max_heap_table_size;
|
||||
set @@optimizer_switch=@save_optimizer_switch;
|
||||
drop table t0, t1;
|
||||
create table t0 (a int);
|
||||
|
4
mysql-test/main/tmp_space_usage-master.opt
Normal file
4
mysql-test/main/tmp_space_usage-master.opt
Normal file
@@ -0,0 +1,4 @@
|
||||
--log-bin
|
||||
--binlog-format=row
|
||||
--max_tmp_session_space_usage=512K
|
||||
--max_tmp_total_space_usage=768K
|
153
mysql-test/main/tmp_space_usage.result
Normal file
153
mysql-test/main/tmp_space_usage.result
Normal file
@@ -0,0 +1,153 @@
|
||||
call mtr.add_suppression("Write to binary log failed: .* temporary space limit reached. An incident event is written to binary log.*");
|
||||
flush status;
|
||||
flush global status;
|
||||
show session status like "max_tmp_space_used";
|
||||
Variable_name Value
|
||||
Max_tmp_space_used 0
|
||||
show global status like "max_tmp_space_used";
|
||||
Variable_name Value
|
||||
Max_tmp_space_used 0
|
||||
#
|
||||
# MDEV-9101 Limit size of total size of created disk temporary files
|
||||
# and tables.
|
||||
show session status like "tmp_space_used";
|
||||
Variable_name Value
|
||||
Tmp_space_used 0
|
||||
show global status like "tmp_space_used";
|
||||
Variable_name Value
|
||||
Tmp_space_used 0
|
||||
select @@global.max_tmp_session_space_usage, @@global.max_tmp_total_space_usage;
|
||||
@@global.max_tmp_session_space_usage @@global.max_tmp_total_space_usage
|
||||
524288 786432
|
||||
select @@binlog_stmt_cache_size,@@binlog_format;
|
||||
@@binlog_stmt_cache_size @@binlog_format
|
||||
32768 ROW
|
||||
create table t1 (a int primary key, v varchar(256), c int default(0)) engine=innodb;
|
||||
insert into t1 (a,v) select seq, repeat(char(64+mod(seq,32)),mod(seq,254)+1) from seq_1_to_65536;
|
||||
ERROR HY000: Local temporary space limit reached
|
||||
set @@max_tmp_session_space_usage=1024*1024*1024;
|
||||
insert into t1 (a,v) select seq, repeat(char(64+mod(seq,32)),mod(seq,254)+1) from seq_1_to_65536;
|
||||
ERROR HY000: Global temporary space limit reached
|
||||
set @@max_tmp_session_space_usage=default;
|
||||
set @@binlog_format="statement";
|
||||
insert into t1 (a,v) select seq, repeat(char(64+mod(seq,32)),mod(seq,254)+1) from seq_1_to_65536;
|
||||
insert into t1 (a,v) select seq, repeat(char(64+mod(seq,32)),mod(seq,254)+1) from seq_65537_to_131072;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
131072
|
||||
create table t2 (a int, b int) engine=innodb select seq as a, 0 as b from seq_1_to_131072;
|
||||
set @@binlog_format="row";
|
||||
set @@tmp_memory_table_size=32*1024;
|
||||
# The following queries should fail because of tmp_space_usage
|
||||
select * from t1 order by a,v;
|
||||
ERROR HY000: Local temporary space limit reached
|
||||
select v,count(*) from t1 group by v limit 2;
|
||||
ERROR HY000: Local temporary space limit reached
|
||||
update t1 set v=right(v,2);
|
||||
ERROR HY000: Local temporary space limit reached
|
||||
set @@binlog_format="statement";
|
||||
set @@max_tmp_session_space_usage=65536;
|
||||
set @@tmp_memory_table_size=0;
|
||||
update t1,t2 set t1.c=t2.a, t2.b=1 where t1.a=t2.a;
|
||||
ERROR HY000: Local temporary space limit reached
|
||||
set @@binlog_format="row";
|
||||
set @@max_tmp_session_space_usage=default;
|
||||
drop table t1,t2;
|
||||
#
|
||||
# Check max_tmp_total_space_usage & processlist
|
||||
#
|
||||
set @@tmp_memory_table_size=1024*1024;
|
||||
show session status like "tmp_space_used";
|
||||
Variable_name Value
|
||||
Tmp_space_used 0
|
||||
set @@tmp_memory_table_size=0;
|
||||
flush status;
|
||||
# session.max_tmp_session_space_usage == global.max_tmp_session_space_usage
|
||||
connect c1, localhost, root,,;
|
||||
connection default;
|
||||
create table t1 (a int primary key, v varchar(256), c int default(0)) engine=innodb;
|
||||
create table t2 (a int primary key, v varchar(256), c int default(0)) engine=innodb;
|
||||
begin;
|
||||
insert into t1 (a,v) select seq, repeat(char(64+mod(seq,32)),mod(seq,254)+1) from seq_1_to_3000;
|
||||
connection c1;
|
||||
# information_schema.process_list.tmp_space_used == status.tmp_space_used
|
||||
insert into t2 (a,v) select seq, repeat(char(64+mod(seq,32)),mod(seq,254)+1) from seq_1_to_3000;
|
||||
ERROR HY000: Global temporary space limit reached
|
||||
# Test setting tmp_space_usage to 0 to disable quotas
|
||||
set @save_max_tmp_total_space_usage=@@global.max_tmp_total_space_usage;
|
||||
set @@global.max_tmp_total_space_usage=0;
|
||||
set @@max_tmp_session_space_usage=0;
|
||||
insert into t2 (a,v) select seq, repeat(char(64+mod(seq,32)),mod(seq,254)+1) from seq_1_to_3000;
|
||||
set @@global.max_tmp_total_space_usage=@save_max_tmp_total_space_usage;
|
||||
set @@max_tmp_session_space_usage=0;
|
||||
connection default;
|
||||
insert into t1 (a,v) values(9999990,0);
|
||||
commit;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
3001
|
||||
disconnect c1;
|
||||
drop table t1,t2;
|
||||
#
|
||||
# Test case from Elena
|
||||
#
|
||||
SET @@max_tmp_session_space_usage= 64*1024;
|
||||
set @@binlog_format="statement";
|
||||
CREATE OR REPLACE TABLE t1 (a INT, b INT);
|
||||
select benchmark(1,1);
|
||||
benchmark(1,1)
|
||||
0
|
||||
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_100000;
|
||||
ALTER TABLE t1 ORDER BY a, b;
|
||||
ERROR HY000: Local temporary space limit reached
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# Show that setting max tmp space too low value can stop binary logging
|
||||
# if non transactional tables are used.
|
||||
#
|
||||
set @save_max_tmp_total_space_usage=@@global.max_tmp_total_space_usage;
|
||||
SET @@global.max_tmp_total_space_usage=64*1024;
|
||||
set @@binlog_format="row";
|
||||
create table t1 (a int primary key, v varchar(256)) engine=myisam;
|
||||
insert into t1 (a,v) select seq, repeat(char(64+mod(seq,32)),mod(seq,254)+1) from seq_1_to_65536;
|
||||
Got one of the listed errors
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 42 Global temporary space limit reached
|
||||
Error 1534 Writing one row to the row-based binary log failed
|
||||
Warning 1196 Some non-transactional changed tables couldn't be rolled back
|
||||
select count(*) <> 0 from t1;
|
||||
count(*) <> 0
|
||||
1
|
||||
truncate table t1;
|
||||
alter table t1 engine=innodb;
|
||||
insert into t1 (a,v) select seq, repeat(char(64+mod(seq,32)),mod(seq,254)+1) from seq_1_to_65536;
|
||||
Got one of the listed errors
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Error 42 Global temporary space limit reached
|
||||
Error 1534 Writing one row to the row-based binary log failed
|
||||
select count(*) <> 0 from t1;
|
||||
count(*) <> 0
|
||||
0
|
||||
drop table t1;
|
||||
set @@global.max_tmp_total_space_usage=@save_max_tmp_total_space_usage;
|
||||
#
|
||||
# Check updating non transactional table
|
||||
#
|
||||
SET max_tmp_session_space_usage= 64*1024;
|
||||
CREATE TABLE t1 (
|
||||
a varchar(1024), b varchar(1024), c varchar(1024), d varchar(1024), e varchar(1024), f varchar(1024), g varchar(1024)
|
||||
) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES
|
||||
(REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024)),
|
||||
(REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024)),
|
||||
(REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024)),
|
||||
(REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024)),
|
||||
(REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024)),
|
||||
(REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024)),
|
||||
('x','x','x','x','x','x','x');
|
||||
UPDATE t1 SET a = '' LIMIT 100;
|
||||
ERROR HY000: Local temporary space limit reached
|
||||
DROP TABLE t1;
|
||||
# End of 11.5 tests
|
203
mysql-test/main/tmp_space_usage.test
Normal file
203
mysql-test/main/tmp_space_usage.test
Normal file
@@ -0,0 +1,203 @@
|
||||
--source include/have_sequence.inc
|
||||
--source include/have_innodb.inc
|
||||
--source include/big_test.inc
|
||||
--source include/not_valgrind.inc
|
||||
--source include/have_log_bin.inc
|
||||
|
||||
call mtr.add_suppression("Write to binary log failed: .* temporary space limit reached. An incident event is written to binary log.*");
|
||||
|
||||
#
|
||||
# Test tmp_space_usage
|
||||
#
|
||||
|
||||
# flush global status is needed because of max_tmp_space_used
|
||||
flush status;
|
||||
flush global status;
|
||||
show session status like "max_tmp_space_used";
|
||||
show global status like "max_tmp_space_used";
|
||||
|
||||
--echo #
|
||||
--echo # MDEV-9101 Limit size of total size of created disk temporary files
|
||||
--echo # and tables.
|
||||
|
||||
# Print variables that can affect the test result
|
||||
show session status like "tmp_space_used";
|
||||
show global status like "tmp_space_used";
|
||||
select @@global.max_tmp_session_space_usage, @@global.max_tmp_total_space_usage;
|
||||
select @@binlog_stmt_cache_size,@@binlog_format;
|
||||
|
||||
create table t1 (a int primary key, v varchar(256), c int default(0)) engine=innodb;
|
||||
--error 41
|
||||
insert into t1 (a,v) select seq, repeat(char(64+mod(seq,32)),mod(seq,254)+1) from seq_1_to_65536;
|
||||
set @@max_tmp_session_space_usage=1024*1024*1024;
|
||||
--error 42
|
||||
insert into t1 (a,v) select seq, repeat(char(64+mod(seq,32)),mod(seq,254)+1) from seq_1_to_65536;
|
||||
set @@max_tmp_session_space_usage=default;
|
||||
|
||||
set @@binlog_format="statement";
|
||||
insert into t1 (a,v) select seq, repeat(char(64+mod(seq,32)),mod(seq,254)+1) from seq_1_to_65536;
|
||||
insert into t1 (a,v) select seq, repeat(char(64+mod(seq,32)),mod(seq,254)+1) from seq_65537_to_131072;
|
||||
select count(*) from t1;
|
||||
|
||||
create table t2 (a int, b int) engine=innodb select seq as a, 0 as b from seq_1_to_131072;
|
||||
|
||||
# Force usage of on disk tmp tables
|
||||
set @@binlog_format="row";
|
||||
set @@tmp_memory_table_size=32*1024;
|
||||
|
||||
--echo # The following queries should fail because of tmp_space_usage
|
||||
--error 41
|
||||
select * from t1 order by a,v;
|
||||
--error 200
|
||||
select v,count(*) from t1 group by v limit 2;
|
||||
--error 41
|
||||
update t1 set v=right(v,2);
|
||||
|
||||
set @@binlog_format="statement";
|
||||
set @@max_tmp_session_space_usage=65536;
|
||||
set @@tmp_memory_table_size=0;
|
||||
--error 200
|
||||
update t1,t2 set t1.c=t2.a, t2.b=1 where t1.a=t2.a;
|
||||
set @@binlog_format="row";
|
||||
set @@max_tmp_session_space_usage=default;
|
||||
|
||||
drop table t1,t2;
|
||||
|
||||
--echo #
|
||||
--echo # Check max_tmp_total_space_usage & processlist
|
||||
--echo #
|
||||
|
||||
# We have to set tmp_memory_table_size to ensure we do not use disk for
|
||||
# the following two show commands.
|
||||
set @@tmp_memory_table_size=1024*1024;
|
||||
show session status like "tmp_space_used";
|
||||
# The following is disabled until we can do "show status" without using
|
||||
# temporary files
|
||||
# show global status like "tmp_space_used";
|
||||
set @@tmp_memory_table_size=0;
|
||||
|
||||
let $tmp_usage1=`select variable_value from information_schema.session_status where variable_name="max_tmp_space_used"`;
|
||||
flush status;
|
||||
let $tmp_usage2=`select variable_value from information_schema.global_status where variable_name="max_tmp_space_used"`;
|
||||
|
||||
--disable_query_log
|
||||
if ($tmp_usage1 == $tmp_usage2)
|
||||
{
|
||||
--echo # session.max_tmp_session_space_usage == global.max_tmp_session_space_usage
|
||||
}
|
||||
if ($tmp_usage1 != $tmp_usage2)
|
||||
{
|
||||
--echo session.max_tmp_session_space_usage ($tmp_usage1) != global.max_tmp_session_space_usage ($tmp_usage2)
|
||||
}
|
||||
--enable_query_log
|
||||
|
||||
|
||||
connect(c1, localhost, root,,);
|
||||
connection default;
|
||||
|
||||
create table t1 (a int primary key, v varchar(256), c int default(0)) engine=innodb;
|
||||
create table t2 (a int primary key, v varchar(256), c int default(0)) engine=innodb;
|
||||
|
||||
begin;
|
||||
insert into t1 (a,v) select seq, repeat(char(64+mod(seq,32)),mod(seq,254)+1) from seq_1_to_3000;
|
||||
|
||||
let $id=`select connection_id()`;
|
||||
let $tmp_usage1=`select variable_value from information_schema.session_status where variable_name="tmp_space_used"`;
|
||||
|
||||
connection c1;
|
||||
--disable_query_log
|
||||
let $tmp_usage2=`select tmp_space_used from information_schema.processlist where id=$id`;
|
||||
if ($tmp_usage1 == $tmp_usage2)
|
||||
{
|
||||
--echo # information_schema.process_list.tmp_space_used == status.tmp_space_used
|
||||
}
|
||||
if ($tmp_usage1 != $tmp_usage2)
|
||||
{
|
||||
--echo tmp_space_used difference: $tmp_usage1 != $tmp_usage2
|
||||
}
|
||||
--enable_query_log
|
||||
|
||||
--error 42
|
||||
insert into t2 (a,v) select seq, repeat(char(64+mod(seq,32)),mod(seq,254)+1) from seq_1_to_3000;
|
||||
--echo # Test setting tmp_space_usage to 0 to disable quotas
|
||||
set @save_max_tmp_total_space_usage=@@global.max_tmp_total_space_usage;
|
||||
set @@global.max_tmp_total_space_usage=0;
|
||||
set @@max_tmp_session_space_usage=0;
|
||||
insert into t2 (a,v) select seq, repeat(char(64+mod(seq,32)),mod(seq,254)+1) from seq_1_to_3000;
|
||||
set @@global.max_tmp_total_space_usage=@save_max_tmp_total_space_usage;
|
||||
set @@max_tmp_session_space_usage=0;
|
||||
connection default;
|
||||
insert into t1 (a,v) values(9999990,0);
|
||||
commit;
|
||||
select count(*) from t1;
|
||||
|
||||
disconnect c1;
|
||||
drop table t1,t2;
|
||||
|
||||
--echo #
|
||||
--echo # Test case from Elena
|
||||
--echo #
|
||||
|
||||
SET @@max_tmp_session_space_usage= 64*1024;
|
||||
set @@binlog_format="statement";
|
||||
|
||||
CREATE OR REPLACE TABLE t1 (a INT, b INT);
|
||||
select benchmark(1,1);
|
||||
INSERT INTO t1 SELECT seq, seq FROM seq_1_to_100000;
|
||||
--error 41
|
||||
ALTER TABLE t1 ORDER BY a, b;
|
||||
|
||||
# Cleanup
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo #
|
||||
--echo # Show that setting max tmp space too low value can stop binary logging
|
||||
--echo # if non transactional tables are used.
|
||||
--echo #
|
||||
|
||||
set @save_max_tmp_total_space_usage=@@global.max_tmp_total_space_usage;
|
||||
SET @@global.max_tmp_total_space_usage=64*1024;
|
||||
set @@binlog_format="row";
|
||||
|
||||
create table t1 (a int primary key, v varchar(256)) engine=myisam;
|
||||
--error 41,42
|
||||
insert into t1 (a,v) select seq, repeat(char(64+mod(seq,32)),mod(seq,254)+1) from seq_1_to_65536;
|
||||
show warnings;
|
||||
select count(*) <> 0 from t1;
|
||||
|
||||
# Shhow that this problem does not exists with transactional tables
|
||||
truncate table t1;
|
||||
alter table t1 engine=innodb;
|
||||
--error 41,42
|
||||
insert into t1 (a,v) select seq, repeat(char(64+mod(seq,32)),mod(seq,254)+1) from seq_1_to_65536;
|
||||
show warnings;
|
||||
select count(*) <> 0 from t1;
|
||||
drop table t1;
|
||||
|
||||
set @@global.max_tmp_total_space_usage=@save_max_tmp_total_space_usage;
|
||||
|
||||
--echo #
|
||||
--echo # Check updating non transactional table
|
||||
--echo #
|
||||
|
||||
SET max_tmp_session_space_usage= 64*1024;
|
||||
|
||||
CREATE TABLE t1 (
|
||||
a varchar(1024), b varchar(1024), c varchar(1024), d varchar(1024), e varchar(1024), f varchar(1024), g varchar(1024)
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
INSERT INTO t1 VALUES
|
||||
(REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024)),
|
||||
(REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024)),
|
||||
(REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024)),
|
||||
(REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024)),
|
||||
(REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024)),
|
||||
(REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024),REPEAT('x',1024)),
|
||||
('x','x','x','x','x','x','x');
|
||||
|
||||
--error 41
|
||||
UPDATE t1 SET a = '' LIMIT 100;
|
||||
|
||||
DROP TABLE t1;
|
||||
|
||||
--echo # End of 11.5 tests
|
@@ -92,7 +92,7 @@ echo
|
||||
# - INFO must contain the corresponding SHOW/SELECT PROCESSLIST
|
||||
#
|
||||
# 1. Just dump what we get
|
||||
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <E_ROWS> 16 <S_ROWS> 17 <QUERY_ID> 19 <TID>
|
||||
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <E_ROWS> 16 <S_ROWS> 17 <QUERY_ID> 19 <TID> 20 <SPACE>
|
||||
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>
|
||||
@@ -160,7 +160,7 @@ let $wait_condition= SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
|
||||
WHERE COMMAND = 'Sleep' AND USER = 'test_user';
|
||||
--source include/wait_condition.inc
|
||||
# 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 <E_ROWS> 16 <S_ROWS> 17 <QUERY_ID> 19 <TID>
|
||||
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 7 <STATE> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <E_ROWS> 16 <S_ROWS> 17 <QUERY_ID> 19 <TID> 20 <SPACE>
|
||||
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
|
||||
--replace_result Execute Query
|
||||
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
|
||||
@@ -203,7 +203,7 @@ echo
|
||||
#----------------------------------------------------------------------------
|
||||
;
|
||||
connection con1;
|
||||
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <E_ROWS> 16 <S_ROWS> 17 <QUERY_ID> 19 <TID>
|
||||
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <E_ROWS> 16 <S_ROWS> 17 <QUERY_ID> 19 <TID> 20 <SPACE>
|
||||
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
|
||||
--replace_result Execute Query
|
||||
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
|
||||
@@ -229,7 +229,7 @@ let $wait_condition= SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST
|
||||
--source include/wait_condition.inc
|
||||
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 <E_ROWS> 16 <S_ROWS> 17 <QUERY_ID> 19 <TID>
|
||||
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <E_ROWS> 16 <S_ROWS> 17 <QUERY_ID> 19 <TID> 20 <SPACE>
|
||||
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
|
||||
--replace_result Execute Query
|
||||
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
|
||||
@@ -281,7 +281,7 @@ WHERE ID = @test_user_con2_id AND Command IN('Query','Execute')
|
||||
AND State = 'User sleep' AND INFO IS NOT NULL ;
|
||||
--source include/wait_condition.inc
|
||||
# 1. Just dump what we get
|
||||
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <E_ROWS> 16 <S_ROWS> 17 <QUERY_ID> 19 <TID>
|
||||
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <E_ROWS> 16 <S_ROWS> 17 <QUERY_ID> 19 <TID> 20 <SPACE>
|
||||
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
|
||||
--replace_result Execute Query
|
||||
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
|
||||
@@ -341,7 +341,7 @@ let $wait_condition= SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST
|
||||
#
|
||||
# Expect to see the state 'Waiting for table metadata lock' for the third
|
||||
# connection because the SELECT collides with the WRITE TABLE LOCK.
|
||||
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <E_ROWS> 16 <S_ROWS> 17 <QUERY_ID> 19 <TID>
|
||||
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <E_ROWS> 16 <S_ROWS> 17 <QUERY_ID> 19 <TID> 20 <SPACE>
|
||||
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
|
||||
UNLOCK TABLES;
|
||||
#
|
||||
@@ -388,7 +388,7 @@ echo
|
||||
# SHOW FULL PROCESSLIST Complete statement
|
||||
# SHOW PROCESSLIST statement truncated after 100 char
|
||||
;
|
||||
--replace_column 1 <ID> 3 <HOST_NAME> 5 <COMMAND> 6 <TIME> 7 <STATE> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <E_ROWS> 16 <S_ROWS> 17 <QUERY_ID> 19 <TID>
|
||||
--replace_column 1 <ID> 3 <HOST_NAME> 5 <COMMAND> 6 <TIME> 7 <STATE> 9 <TIME_MS> 13 <MEMORY> 14 <MAX_MEMORY> 15 <E_ROWS> 16 <S_ROWS> 17 <QUERY_ID> 19 <TID> 20 <SPACE>
|
||||
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
|
||||
--replace_result Execute Query
|
||||
--replace_column 1 <ID> 3 <HOST_NAME> 5 <COMMAND> 6 <TIME> 7 <STATE>
|
||||
|
@@ -315,6 +315,7 @@ def information_schema PROCESSLIST STATE 7 NULL YES varchar 64 192 NULL NULL NUL
|
||||
def information_schema PROCESSLIST TID 19 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) select NEVER NULL NO NO
|
||||
def information_schema PROCESSLIST TIME 6 NULL NO int NULL NULL 10 0 NULL NULL NULL int(7) select NEVER NULL NO NO
|
||||
def information_schema PROCESSLIST TIME_MS 9 NULL NO decimal NULL NULL 22 3 NULL NULL NULL decimal(22,3) select NEVER NULL NO NO
|
||||
def information_schema PROCESSLIST TMP_SPACE_USED 20 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) select NEVER NULL NO NO
|
||||
def information_schema PROCESSLIST USER 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) select NEVER NULL NO NO
|
||||
def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) select NEVER NULL NO NO
|
||||
def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) select NEVER NULL NO NO
|
||||
@@ -909,6 +910,7 @@ NULL information_schema PROCESSLIST SENT_ROWS bigint NULL NULL NULL NULL bigint(
|
||||
NULL information_schema PROCESSLIST QUERY_ID bigint NULL NULL NULL NULL bigint(10)
|
||||
1.0000 information_schema PROCESSLIST INFO_BINARY blob 65535 65535 NULL NULL blob
|
||||
NULL information_schema PROCESSLIST TID bigint NULL NULL NULL NULL bigint(10)
|
||||
NULL information_schema PROCESSLIST TMP_SPACE_USED bigint NULL NULL NULL NULL bigint(10)
|
||||
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG varchar 512 1536 utf8mb3 utf8mb3_general_ci varchar(512)
|
||||
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
|
||||
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
|
||||
|
@@ -315,6 +315,7 @@ def information_schema PROCESSLIST STATE 7 NULL YES varchar 64 192 NULL NULL NUL
|
||||
def information_schema PROCESSLIST TID 19 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) NEVER NULL NO NO
|
||||
def information_schema PROCESSLIST TIME 6 NULL NO int NULL NULL 10 0 NULL NULL NULL int(7) NEVER NULL NO NO
|
||||
def information_schema PROCESSLIST TIME_MS 9 NULL NO decimal NULL NULL 22 3 NULL NULL NULL decimal(22,3) NEVER NULL NO NO
|
||||
def information_schema PROCESSLIST TMP_SPACE_USED 20 NULL NO bigint NULL NULL 19 0 NULL NULL NULL bigint(10) NEVER NULL NO NO
|
||||
def information_schema PROCESSLIST USER 2 NULL NO varchar 128 384 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(128) NEVER NULL NO NO
|
||||
def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG 1 NULL NO varchar 512 1536 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(512) NEVER NULL NO NO
|
||||
def information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME 3 NULL NO varchar 64 192 NULL NULL NULL utf8mb3 utf8mb3_general_ci varchar(64) NEVER NULL NO NO
|
||||
@@ -909,6 +910,7 @@ NULL information_schema PROCESSLIST SENT_ROWS bigint NULL NULL NULL NULL bigint(
|
||||
NULL information_schema PROCESSLIST QUERY_ID bigint NULL NULL NULL NULL bigint(10)
|
||||
1.0000 information_schema PROCESSLIST INFO_BINARY blob 65535 65535 NULL NULL blob
|
||||
NULL information_schema PROCESSLIST TID bigint NULL NULL NULL NULL bigint(10)
|
||||
NULL information_schema PROCESSLIST TMP_SPACE_USED bigint NULL NULL NULL NULL bigint(10)
|
||||
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_CATALOG varchar 512 1536 utf8mb3 utf8mb3_general_ci varchar(512)
|
||||
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_SCHEMA varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
|
||||
3.0000 information_schema REFERENTIAL_CONSTRAINTS CONSTRAINT_NAME varchar 64 192 utf8mb3 utf8mb3_general_ci varchar(64)
|
||||
|
@@ -44,16 +44,17 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
|
||||
`SENT_ROWS` bigint(10) NOT NULL,
|
||||
`QUERY_ID` bigint(10) NOT NULL,
|
||||
`INFO_BINARY` blob,
|
||||
`TID` bigint(10) NOT NULL
|
||||
`TID` bigint(10) NOT NULL,
|
||||
`TMP_SPACE_USED` bigint(10) NOT NULL
|
||||
) DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
|
||||
SHOW processlist;
|
||||
Id User Host db Command Time State Info Progress
|
||||
ID root HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
SELECT * FROM processlist ORDER BY id;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID root HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM processlist ORDER BY id TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID root HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM processlist ORDER BY id TID 16384
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY
|
||||
ID root HOST_NAME information_schema Query TIME Filling schema table SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id
|
||||
@@ -125,14 +126,15 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
|
||||
`SENT_ROWS` bigint(10) NOT NULL,
|
||||
`QUERY_ID` bigint(10) NOT NULL,
|
||||
`INFO_BINARY` blob,
|
||||
`TID` bigint(10) NOT NULL
|
||||
`TID` bigint(10) NOT NULL,
|
||||
`TMP_SPACE_USED` bigint(10) NOT NULL
|
||||
) DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
|
||||
SHOW processlist;
|
||||
Id User Host db Command Time State Info Progress
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
|
||||
SELECT * FROM processlist ORDER BY id;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM processlist ORDER BY id TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM processlist ORDER BY id TID 0
|
||||
SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id
|
||||
@@ -198,8 +200,8 @@ SHOW processlist;
|
||||
Id User Host db Command Time State Info Progress
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
|
||||
SELECT * FROM information_schema.processlist;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0
|
||||
####################################################################################
|
||||
4.2 New connection con101 (ddicttestuser1 with PROCESS privilege)
|
||||
SHOW/SELECT shows all processes/threads.
|
||||
@@ -215,10 +217,10 @@ ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
|
||||
SELECT * FROM information_schema.processlist;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
####################################################################################
|
||||
5 Grant PROCESS privilege to anonymous user.
|
||||
connection default (user=root)
|
||||
@@ -242,11 +244,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
|
||||
SELECT * FROM information_schema.processlist;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
####################################################################################
|
||||
6 Revoke PROCESS privilege from ddicttestuser1
|
||||
connection default (user=root)
|
||||
@@ -269,10 +271,10 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
|
||||
SELECT * FROM information_schema.processlist;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
####################################################################################
|
||||
7 Revoke PROCESS privilege from anonymous user
|
||||
connection default (user=root)
|
||||
@@ -289,9 +291,9 @@ SHOW GRANTS FOR ''@'localhost';
|
||||
Grants for @localhost
|
||||
GRANT USAGE ON *.* TO ``@`localhost`
|
||||
SELECT * FROM information_schema.processlist;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
|
||||
ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0
|
||||
ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
####################################################################################
|
||||
8 Grant SUPER (does not imply PROCESS) privilege to ddicttestuser1
|
||||
connection default (user=root)
|
||||
@@ -314,11 +316,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
|
||||
SELECT * FROM information_schema.processlist;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
####################################################################################
|
||||
9 Revoke SUPER privilege from user ddicttestuser1
|
||||
connection default (user=root)
|
||||
@@ -343,12 +345,12 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
|
||||
SELECT * FROM information_schema.processlist;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
####################################################################################
|
||||
10 Grant SUPER privilege with grant option to user ddicttestuser1.
|
||||
connection default (user=root)
|
||||
@@ -405,18 +407,18 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser2 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
|
||||
SELECT * FROM information_schema.processlist;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID ddicttestuser2 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID ddicttestuser2 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
####################################################################################
|
||||
11 User ddicttestuser1 revokes PROCESS privilege from user ddicttestuser2
|
||||
connection ddicttestuser1;
|
||||
@@ -437,9 +439,9 @@ Id User Host db Command Time State Info Progress
|
||||
ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser2 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
|
||||
SELECT * FROM information_schema.processlist;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID ddicttestuser2 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
|
||||
ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID ddicttestuser2 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0
|
||||
ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
####################################################################################
|
||||
11.2 Revoke SUPER,PROCESS,GRANT OPTION privilege from user ddicttestuser1
|
||||
connection default (user=root)
|
||||
@@ -469,15 +471,15 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
|
||||
SELECT * FROM information_schema.processlist;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
####################################################################################
|
||||
12 Revoke the SELECT privilege from user ddicttestuser1
|
||||
connection default (user=root)
|
||||
@@ -508,16 +510,16 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
|
||||
SELECT * FROM information_schema.processlist;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
####################################################################################
|
||||
12.2 Revoke only the SELECT privilege on the information_schema from ddicttestuser1.
|
||||
connection default (user=root)
|
||||
|
@@ -44,16 +44,17 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
|
||||
`SENT_ROWS` bigint(10) NOT NULL,
|
||||
`QUERY_ID` bigint(10) NOT NULL,
|
||||
`INFO_BINARY` blob,
|
||||
`TID` bigint(10) NOT NULL
|
||||
`TID` bigint(10) NOT NULL,
|
||||
`TMP_SPACE_USED` bigint(10) NOT NULL
|
||||
) DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
|
||||
SHOW processlist;
|
||||
Id User Host db Command Time State Info Progress
|
||||
ID root HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
SELECT * FROM processlist ORDER BY id;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID root HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM processlist ORDER BY id TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID root HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM processlist ORDER BY id TID 16384
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY
|
||||
ID root HOST_NAME information_schema Execute TIME Filling schema table SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id
|
||||
@@ -125,14 +126,15 @@ PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
|
||||
`SENT_ROWS` bigint(10) NOT NULL,
|
||||
`QUERY_ID` bigint(10) NOT NULL,
|
||||
`INFO_BINARY` blob,
|
||||
`TID` bigint(10) NOT NULL
|
||||
`TID` bigint(10) NOT NULL,
|
||||
`TMP_SPACE_USED` bigint(10) NOT NULL
|
||||
) DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci
|
||||
SHOW processlist;
|
||||
Id User Host db Command Time State Info Progress
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
|
||||
SELECT * FROM processlist ORDER BY id;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM processlist ORDER BY id TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM processlist ORDER BY id TID 0
|
||||
SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY
|
||||
ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id TIME_MS 0 0 0.000 MEMORY ROWS QUERY_ID SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO, TIME_MS, STAGE, MAX_STAGE, PROGRESS, MEMORY_USED, EXAMINED_ROWS, QUERY_ID, INFO_BINARY FROM processlist ORDER BY id
|
||||
@@ -198,8 +200,8 @@ SHOW processlist;
|
||||
Id User Host db Command Time State Info Progress
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
|
||||
SELECT * FROM information_schema.processlist;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0
|
||||
####################################################################################
|
||||
4.2 New connection con101 (ddicttestuser1 with PROCESS privilege)
|
||||
SHOW/SELECT shows all processes/threads.
|
||||
@@ -215,10 +217,10 @@ ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
|
||||
SELECT * FROM information_schema.processlist;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
####################################################################################
|
||||
5 Grant PROCESS privilege to anonymous user.
|
||||
connection default (user=root)
|
||||
@@ -242,11 +244,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
|
||||
SELECT * FROM information_schema.processlist;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
####################################################################################
|
||||
6 Revoke PROCESS privilege from ddicttestuser1
|
||||
connection default (user=root)
|
||||
@@ -269,10 +271,10 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
|
||||
SELECT * FROM information_schema.processlist;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
####################################################################################
|
||||
7 Revoke PROCESS privilege from anonymous user
|
||||
connection default (user=root)
|
||||
@@ -289,9 +291,9 @@ SHOW GRANTS FOR ''@'localhost';
|
||||
Grants for @localhost
|
||||
GRANT USAGE ON *.* TO ``@`localhost`
|
||||
SELECT * FROM information_schema.processlist;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
|
||||
ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0
|
||||
ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
####################################################################################
|
||||
8 Grant SUPER (does not imply PROCESS) privilege to ddicttestuser1
|
||||
connection default (user=root)
|
||||
@@ -314,11 +316,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
|
||||
SELECT * FROM information_schema.processlist;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
####################################################################################
|
||||
9 Revoke SUPER privilege from user ddicttestuser1
|
||||
connection default (user=root)
|
||||
@@ -343,12 +345,12 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
|
||||
SELECT * FROM information_schema.processlist;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
####################################################################################
|
||||
10 Grant SUPER privilege with grant option to user ddicttestuser1.
|
||||
connection default (user=root)
|
||||
@@ -405,18 +407,18 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser2 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
|
||||
SELECT * FROM information_schema.processlist;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID ddicttestuser2 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID ddicttestuser2 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
####################################################################################
|
||||
11 User ddicttestuser1 revokes PROCESS privilege from user ddicttestuser2
|
||||
connection ddicttestuser1;
|
||||
@@ -437,9 +439,9 @@ Id User Host db Command Time State Info Progress
|
||||
ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser2 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
|
||||
SELECT * FROM information_schema.processlist;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID ddicttestuser2 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
|
||||
ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID ddicttestuser2 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0
|
||||
ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
####################################################################################
|
||||
11.2 Revoke SUPER,PROCESS,GRANT OPTION privilege from user ddicttestuser1
|
||||
connection default (user=root)
|
||||
@@ -469,15 +471,15 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
|
||||
SELECT * FROM information_schema.processlist;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
####################################################################################
|
||||
12 Revoke the SELECT privilege from user ddicttestuser1
|
||||
connection default (user=root)
|
||||
@@ -508,16 +510,16 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS
|
||||
ID ddicttestuser1 HOST_NAME information_schema Query TIME starting SHOW processlist TIME_MS
|
||||
SELECT * FROM information_schema.processlist;
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID
|
||||
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED MAX_MEMORY_USED EXAMINED_ROWS SENT_ROWS QUERY_ID INFO_BINARY TID TMP_SPACE_USED
|
||||
ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table SELECT * FROM information_schema.processlist TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID SELECT * FROM information_schema.processlist TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY MAX_MEMORY E_ROWS S_ROWS QUERY_ID NULL TID 0
|
||||
####################################################################################
|
||||
12.2 Revoke only the SELECT privilege on the information_schema from ddicttestuser1.
|
||||
connection default (user=root)
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
25
mysql-test/suite/rpl/r/tmp_space_usage.result
Normal file
25
mysql-test/suite/rpl/r/tmp_space_usage.result
Normal file
@@ -0,0 +1,25 @@
|
||||
include/master-slave.inc
|
||||
[connection master]
|
||||
call mtr.add_suppression("Global temporary space limit reached.*");
|
||||
call mtr.add_suppression("Writing one row to the row-based binary log failed.*");
|
||||
connection slave;
|
||||
STOP SLAVE;
|
||||
SET GLOBAL slave_parallel_threads=2, max_tmp_total_space_usage=64*1024;
|
||||
START SLAVE;
|
||||
connection master;
|
||||
CREATE TABLE t1 (
|
||||
a bigint primary key auto_increment,
|
||||
v blob
|
||||
) engine=innodb;
|
||||
start transaction;
|
||||
insert into t1 (v) select repeat("a", seq) from seq_1000_to_1032;
|
||||
insert into t1 (v) select repeat("b", seq) from seq_1000_to_1032;
|
||||
insert into t1 (v) select repeat("c", seq) from seq_1000_to_1032;
|
||||
commit;
|
||||
drop table t1;
|
||||
connection slave;
|
||||
include/wait_for_slave_sql_error_and_skip.inc [errno=42]
|
||||
connection slave;
|
||||
STOP SLAVE;
|
||||
SET GLOBAL max_tmp_total_space_usage=default;
|
||||
set GLOBAL slave_parallel_threads=default;
|
38
mysql-test/suite/rpl/t/tmp_space_usage.test
Normal file
38
mysql-test/suite/rpl/t/tmp_space_usage.test
Normal file
@@ -0,0 +1,38 @@
|
||||
--source include/have_innodb.inc
|
||||
--source include/have_binlog_format_row.inc
|
||||
--source include/master-slave.inc
|
||||
--source include/have_sequence.inc
|
||||
|
||||
call mtr.add_suppression("Global temporary space limit reached.*");
|
||||
call mtr.add_suppression("Writing one row to the row-based binary log failed.*");
|
||||
|
||||
--connection slave
|
||||
STOP SLAVE;
|
||||
SET GLOBAL slave_parallel_threads=2, max_tmp_total_space_usage=64*1024;
|
||||
START SLAVE;
|
||||
|
||||
--connection master
|
||||
CREATE TABLE t1 (
|
||||
a bigint primary key auto_increment,
|
||||
v blob
|
||||
) engine=innodb;
|
||||
|
||||
start transaction;
|
||||
insert into t1 (v) select repeat("a", seq) from seq_1000_to_1032;
|
||||
insert into t1 (v) select repeat("b", seq) from seq_1000_to_1032;
|
||||
insert into t1 (v) select repeat("c", seq) from seq_1000_to_1032;
|
||||
commit;
|
||||
drop table t1;
|
||||
|
||||
# The slave SQL thread should die because of Global temporary space limit
|
||||
--connection slave
|
||||
let $show_slave_sql_error=0;
|
||||
let $slave_sql_errno=42;
|
||||
let $slave_skip_counter=2;
|
||||
--source include/wait_for_slave_sql_error_and_skip.inc
|
||||
|
||||
# cleanup
|
||||
--connection slave
|
||||
STOP SLAVE;
|
||||
SET GLOBAL max_tmp_total_space_usage=default;
|
||||
set GLOBAL slave_parallel_threads=default;
|
@@ -2102,6 +2102,26 @@ NUMERIC_BLOCK_SIZE NULL
|
||||
ENUM_VALUE_LIST NULL
|
||||
READ_ONLY NO
|
||||
COMMAND_LINE_ARGUMENT REQUIRED
|
||||
VARIABLE_NAME MAX_TMP_SESSION_SPACE_USAGE
|
||||
VARIABLE_SCOPE SESSION
|
||||
VARIABLE_TYPE BIGINT UNSIGNED
|
||||
VARIABLE_COMMENT The maximum total size of temporary file and temporary table usage. A value of 0 disables this feature
|
||||
NUMERIC_MIN_VALUE 0
|
||||
NUMERIC_MAX_VALUE 18446744073709551615
|
||||
NUMERIC_BLOCK_SIZE 65536
|
||||
ENUM_VALUE_LIST NULL
|
||||
READ_ONLY NO
|
||||
COMMAND_LINE_ARGUMENT REQUIRED
|
||||
VARIABLE_NAME MAX_TMP_TOTAL_SPACE_USAGE
|
||||
VARIABLE_SCOPE GLOBAL
|
||||
VARIABLE_TYPE BIGINT UNSIGNED
|
||||
VARIABLE_COMMENT The maximum total size of all temporary file and temporary table usage over all connections. A value of 0 disables this feature
|
||||
NUMERIC_MIN_VALUE 0
|
||||
NUMERIC_MAX_VALUE 18446744073709551615
|
||||
NUMERIC_BLOCK_SIZE 65536
|
||||
ENUM_VALUE_LIST NULL
|
||||
READ_ONLY NO
|
||||
COMMAND_LINE_ARGUMENT REQUIRED
|
||||
VARIABLE_NAME MAX_USER_CONNECTIONS
|
||||
VARIABLE_SCOPE SESSION
|
||||
VARIABLE_TYPE INT
|
||||
|
@@ -2312,6 +2312,26 @@ NUMERIC_BLOCK_SIZE NULL
|
||||
ENUM_VALUE_LIST NULL
|
||||
READ_ONLY NO
|
||||
COMMAND_LINE_ARGUMENT REQUIRED
|
||||
VARIABLE_NAME MAX_TMP_SESSION_SPACE_USAGE
|
||||
VARIABLE_SCOPE SESSION
|
||||
VARIABLE_TYPE BIGINT UNSIGNED
|
||||
VARIABLE_COMMENT The maximum total size of temporary file and temporary table usage. A value of 0 disables this feature
|
||||
NUMERIC_MIN_VALUE 0
|
||||
NUMERIC_MAX_VALUE 18446744073709551615
|
||||
NUMERIC_BLOCK_SIZE 65536
|
||||
ENUM_VALUE_LIST NULL
|
||||
READ_ONLY NO
|
||||
COMMAND_LINE_ARGUMENT REQUIRED
|
||||
VARIABLE_NAME MAX_TMP_TOTAL_SPACE_USAGE
|
||||
VARIABLE_SCOPE GLOBAL
|
||||
VARIABLE_TYPE BIGINT UNSIGNED
|
||||
VARIABLE_COMMENT The maximum total size of all temporary file and temporary table usage over all connections. A value of 0 disables this feature
|
||||
NUMERIC_MIN_VALUE 0
|
||||
NUMERIC_MAX_VALUE 18446744073709551615
|
||||
NUMERIC_BLOCK_SIZE 65536
|
||||
ENUM_VALUE_LIST NULL
|
||||
READ_ONLY NO
|
||||
COMMAND_LINE_ARGUMENT REQUIRED
|
||||
VARIABLE_NAME MAX_USER_CONNECTIONS
|
||||
VARIABLE_SCOPE SESSION
|
||||
VARIABLE_TYPE INT
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
#ifndef SHARED_LIBRARY
|
||||
|
||||
const char *globerrs[GLOBERRS]=
|
||||
const char *globerrs[GLOBERRS+1]=
|
||||
{
|
||||
"Can't create/write to file '%s' (Errcode: %M)",
|
||||
"Error reading file '%s' (Errcode: %M)",
|
||||
@@ -60,7 +60,10 @@ const char *globerrs[GLOBERRS]=
|
||||
"Lock Pages in memory access rights required",
|
||||
"Memcntl %s cmd %s error",
|
||||
"Warning: Charset id '%d' csname '%s' trying to replace existing csname '%s'",
|
||||
"Deprecated program name. It will be removed in a future release, use '%s' instead"
|
||||
"Deprecated program name. It will be removed in a future release, use '%s' instead",
|
||||
"Local temporary space limit reached",
|
||||
"Global temporary space limit reached",
|
||||
""
|
||||
};
|
||||
|
||||
void init_glob_errs(void)
|
||||
@@ -110,7 +113,9 @@ void init_glob_errs()
|
||||
EE(EE_PERM_LOCK_MEMORY)= "Lock Pages in memory access rights required";
|
||||
EE(EE_MEMCNTL) = "Memcntl %s cmd %s error";
|
||||
EE(EE_DUPLICATE_CHARSET)= "Warning: Charset id %d trying to replace csname %s with %s";
|
||||
EE(EE_NAME_DEPRECATED) = "Notice: %s is deprecated and will be removed in a future release, use command '%s'"
|
||||
EE(EE_NAME_DEPRECATED) = "Notice: %s is deprecated and will be removed in a future release, use command '%s'";
|
||||
EE(EE_LOCAL_TMP_SPACE_FULL) = "Local temporary space limit reached";
|
||||
EE(EE_GLOBAL_TMP_SPACE_FULL) = "Global temporary space limit reached";
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@@ -43,7 +43,7 @@ my_bool open_cached_file(IO_CACHE *cache, const char* dir, const char *prefix,
|
||||
cache->file_name=0;
|
||||
cache->buffer=0; /* Mark that not open */
|
||||
if (!init_io_cache(cache, -1, cache_size, WRITE_CACHE, 0L, 0,
|
||||
MYF(cache_myflags | MY_NABP)))
|
||||
MYF(cache_myflags | MY_NABP | MY_TRACK)))
|
||||
{
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
@@ -74,8 +74,6 @@ void close_cached_file(IO_CACHE *cache)
|
||||
if (my_b_inited(cache))
|
||||
{
|
||||
File file= cache->file;
|
||||
cache->file= -1; /* Don't flush data */
|
||||
(void) end_io_cache(cache);
|
||||
if (file >= 0)
|
||||
{
|
||||
(void) my_close(file,MYF(0));
|
||||
@@ -87,6 +85,8 @@ void close_cached_file(IO_CACHE *cache)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
cache->file= -1; /* Don't flush data */
|
||||
(void) end_io_cache(cache);
|
||||
}
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
@@ -54,6 +54,7 @@ TODO:
|
||||
#include "mysql/psi/mysql_file.h"
|
||||
|
||||
PSI_file_key key_file_io_cache;
|
||||
TMPFILE_SIZE_CB update_tmp_file_size= 0;
|
||||
|
||||
#define lock_append_buffer(info) \
|
||||
mysql_mutex_lock(&(info)->append_buffer_lock)
|
||||
@@ -73,6 +74,58 @@ int (*_my_b_encr_read)(IO_CACHE *info,uchar *Buffer,size_t Count)= 0;
|
||||
int (*_my_b_encr_write)(IO_CACHE *info,const uchar *Buffer,size_t Count)= 0;
|
||||
|
||||
|
||||
static inline my_bool tmp_file_track(IO_CACHE *info, ulonglong file_size)
|
||||
{
|
||||
if ((info->myflags & (MY_TRACK | MY_TRACK_WITH_LIMIT)) &&
|
||||
update_tmp_file_size)
|
||||
{
|
||||
if (info->tracking.file_size < file_size)
|
||||
{
|
||||
int error;
|
||||
info->tracking.file_size= file_size;
|
||||
if ((error= update_tmp_file_size(&info->tracking,
|
||||
!(info->myflags &
|
||||
MY_TRACK_WITH_LIMIT))))
|
||||
{
|
||||
if (info->myflags & MY_WME)
|
||||
my_error(my_errno, MYF(0));
|
||||
info->error= -1;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
my_bool io_cache_tmp_file_track(IO_CACHE *info, ulonglong file_size)
|
||||
{
|
||||
return tmp_file_track(info, file_size);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
End tmp space tracking for the data in the io cache
|
||||
|
||||
This is called when deleting or truncating the
|
||||
cached file.
|
||||
*/
|
||||
|
||||
void end_tracking_io_cache(IO_CACHE *info)
|
||||
{
|
||||
if ((info->myflags & (MY_TRACK | MY_TRACK_WITH_LIMIT)) &&
|
||||
info->tracking.file_size)
|
||||
{
|
||||
info->tracking.file_size= 0;
|
||||
update_tmp_file_size(&info->tracking, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void truncate_io_cache(IO_CACHE *info)
|
||||
{
|
||||
if (my_chsize(info->file, 0, 0, MYF(MY_WME)) == 0)
|
||||
end_tracking_io_cache(info);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
init_functions(IO_CACHE* info)
|
||||
@@ -169,6 +222,8 @@ int init_io_cache_ext(IO_CACHE *info, File file, size_t cachesize,
|
||||
info->buffer=0;
|
||||
info->seek_not_done= 0;
|
||||
info->next_file_user= NULL;
|
||||
info->tracking.previous_file_size= 0;
|
||||
info->tracking.file_size= 0;
|
||||
|
||||
if (file >= 0)
|
||||
{
|
||||
@@ -407,11 +462,18 @@ void seek_io_cache(IO_CACHE *cache, my_off_t needed_offset)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/**
|
||||
Use this to reset cache to re-start reading or to change the type
|
||||
between READ_CACHE <-> WRITE_CACHE
|
||||
If we are doing a reinit of a cache where we have the start of the file
|
||||
in the cache, we are reusing this memory without flushing it to disk.
|
||||
|
||||
@param info IO_CACHE
|
||||
@param type READ_CACHE or WRITE_CACHE
|
||||
@param seek_offset Where to start reading or writing
|
||||
@param use_async_io Not used
|
||||
@param clear_cache 0 No clear, keep all information
|
||||
1 truncate file. seek_offset has to be 0.
|
||||
*/
|
||||
|
||||
my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type,
|
||||
@@ -478,8 +540,24 @@ my_bool reinit_io_cache(IO_CACHE *info, enum cache_type type,
|
||||
}
|
||||
}
|
||||
/* flush cache if we want to reuse it */
|
||||
if (!clear_cache && my_b_flush_io_cache(info,1))
|
||||
DBUG_RETURN(1);
|
||||
if (!clear_cache && info->type == WRITE_CACHE)
|
||||
{
|
||||
int ret;
|
||||
myf save_flags;
|
||||
if (type == WRITE_CACHE && seek_offset > info->pos_in_file)
|
||||
{
|
||||
/* Write only up to where we will start next write */
|
||||
my_off_t buffer_used= seek_offset - info->pos_in_file;
|
||||
info->write_pos= info->write_buffer + buffer_used;
|
||||
}
|
||||
save_flags= info->myflags;
|
||||
/* Allow temporary space over usage. Will be detected on next write */
|
||||
info->myflags&= ~MY_TRACK_WITH_LIMIT;
|
||||
ret= my_b_flush_io_cache(info,1);
|
||||
info->myflags= save_flags;
|
||||
if (ret)
|
||||
DBUG_RETURN(ret);
|
||||
}
|
||||
info->pos_in_file=seek_offset;
|
||||
/* Better to do always do a seek */
|
||||
info->seek_not_done=1;
|
||||
@@ -1523,7 +1601,8 @@ int _my_b_cache_write(IO_CACHE *info, const uchar *Buffer, size_t Count)
|
||||
}
|
||||
info->seek_not_done=0;
|
||||
}
|
||||
if (mysql_file_write(info->file, Buffer, Count, info->myflags | MY_NABP))
|
||||
if (tmp_file_track(info, info->pos_in_file + Count) ||
|
||||
mysql_file_write(info->file, Buffer, Count, info->myflags | MY_NABP))
|
||||
return info->error= -1;
|
||||
|
||||
info->pos_in_file+= Count;
|
||||
@@ -1592,7 +1671,8 @@ int my_b_append(IO_CACHE *info, const uchar *Buffer, size_t Count)
|
||||
if (Count >= IO_SIZE)
|
||||
{ /* Fill first intern buffer */
|
||||
length= IO_ROUND_DN(Count);
|
||||
if (mysql_file_write(info->file,Buffer, length, info->myflags | MY_NABP))
|
||||
if (tmp_file_track(info, info->end_of_file + length) ||
|
||||
mysql_file_write(info->file,Buffer, length, info->myflags | MY_NABP))
|
||||
{
|
||||
unlock_append_buffer(info);
|
||||
return info->error= -1;
|
||||
@@ -1710,15 +1790,18 @@ int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock)
|
||||
|
||||
if ((length=(size_t) (info->write_pos - info->write_buffer)))
|
||||
{
|
||||
my_off_t eof= info->end_of_file + info->write_pos - info->append_read_pos;
|
||||
if (append_cache)
|
||||
{
|
||||
if (mysql_file_write(info->file, info->write_buffer, length,
|
||||
if (tmp_file_track(info, eof) ||
|
||||
mysql_file_write(info->file, info->write_buffer, length,
|
||||
info->myflags | MY_NABP))
|
||||
{
|
||||
UNLOCK_APPEND_BUFFER;
|
||||
info->error= -1;
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
info->end_of_file+= info->write_pos - info->append_read_pos;
|
||||
info->end_of_file= eof;
|
||||
info->append_read_pos= info->write_buffer;
|
||||
DBUG_ASSERT(info->end_of_file == mysql_file_tell(info->file, MYF(0)));
|
||||
}
|
||||
@@ -1726,8 +1809,10 @@ int my_b_flush_io_cache(IO_CACHE *info, int need_append_buffer_lock)
|
||||
{
|
||||
int res= info->write_function(info, info->write_buffer, length);
|
||||
if (res)
|
||||
{
|
||||
UNLOCK_APPEND_BUFFER;
|
||||
DBUG_RETURN(res);
|
||||
|
||||
}
|
||||
set_if_bigger(info->end_of_file, info->pos_in_file);
|
||||
}
|
||||
info->write_end= (info->write_buffer + info->buffer_length -
|
||||
@@ -1785,14 +1870,15 @@ int end_io_cache(IO_CACHE *info)
|
||||
/* Destroy allocated mutex */
|
||||
mysql_mutex_destroy(&info->append_buffer_lock);
|
||||
}
|
||||
end_tracking_io_cache(info);
|
||||
info->share= 0;
|
||||
info->type= TYPE_NOT_SET; /* Ensure that flush_io_cache() does nothing */
|
||||
info->write_end= 0; /* Ensure that my_b_write() fails */
|
||||
info->write_function= 0; /* my_b_write will crash if used */
|
||||
|
||||
DBUG_RETURN(error);
|
||||
} /* end_io_cache */
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
Testing of MF_IOCACHE
|
||||
**********************************************************************/
|
||||
|
@@ -36,12 +36,14 @@
|
||||
|
||||
RETURN VALUE
|
||||
0 Ok
|
||||
-1 OS does not support truncate. Filled space with 0
|
||||
1 Error
|
||||
*/
|
||||
int my_chsize(File fd, my_off_t newlength, int filler, myf MyFlags)
|
||||
{
|
||||
my_off_t oldsize;
|
||||
uchar buff[IO_SIZE];
|
||||
int res= 0;
|
||||
DBUG_ENTER("my_chsize");
|
||||
DBUG_PRINT("my",("fd: %d length: %lu MyFlags: %lu",fd,(ulong) newlength,
|
||||
MyFlags));
|
||||
@@ -77,6 +79,7 @@ int my_chsize(File fd, my_off_t newlength, int filler, myf MyFlags)
|
||||
{
|
||||
goto err;
|
||||
}
|
||||
res= -1; /* Warn that file was zerofilled, not truncated */
|
||||
swap_variables(my_off_t, newlength, oldsize);
|
||||
#endif
|
||||
}
|
||||
@@ -91,7 +94,7 @@ int my_chsize(File fd, my_off_t newlength, int filler, myf MyFlags)
|
||||
}
|
||||
if (my_write(fd,buff,(size_t) (newlength-oldsize), MYF(MY_NABP)))
|
||||
goto err;
|
||||
DBUG_RETURN(0);
|
||||
DBUG_RETURN(res);
|
||||
|
||||
err:
|
||||
DBUG_PRINT("error", ("errno: %d", errno));
|
||||
|
@@ -257,7 +257,8 @@ ret:
|
||||
the effect of the background thread on SHOW STATUS.
|
||||
*/
|
||||
server_threads.erase(thd);
|
||||
thd->set_status_var_init();
|
||||
DBUG_ASSERT(thd->status_var.tmp_space_used == 0);
|
||||
thd->set_status_var_init(clear_for_new_connection);
|
||||
thd->killed= KILL_CONNECTION;
|
||||
delete thd;
|
||||
thd= 0;
|
||||
|
@@ -399,7 +399,8 @@ SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort,
|
||||
goto err;
|
||||
|
||||
if (open_cached_file(&buffpek_pointers, mysql_tmpdir, TEMP_PREFIX,
|
||||
DISK_CHUNK_SIZE, MYF(MY_WME)))
|
||||
DISK_CHUNK_SIZE,
|
||||
MYF(MY_WME | MY_TRACK_WITH_LIMIT)))
|
||||
goto err;
|
||||
|
||||
param.local_sortorder=
|
||||
@@ -452,7 +453,7 @@ SORT_INFO *filesort(THD *thd, TABLE *table, Filesort *filesort,
|
||||
/* Open cached file if it isn't open */
|
||||
if (!my_b_inited(outfile) &&
|
||||
open_cached_file(outfile, mysql_tmpdir, TEMP_PREFIX, DISK_CHUNK_SIZE,
|
||||
MYF(MY_WME)))
|
||||
MYF(MY_WME | MY_TRACK_WITH_LIMIT)))
|
||||
goto err;
|
||||
if (reinit_io_cache(outfile,WRITE_CACHE,0L,0,0))
|
||||
goto err;
|
||||
@@ -974,11 +975,6 @@ static ha_rows find_all_keys(THD *thd, Sort_param *param, SQL_SELECT *select,
|
||||
if (unlikely(thd->check_killed()))
|
||||
{
|
||||
DBUG_PRINT("info",("Sort killed by user"));
|
||||
if (!quick_select)
|
||||
{
|
||||
(void) file->extra(HA_EXTRA_NO_CACHE);
|
||||
file->ha_rnd_end();
|
||||
}
|
||||
goto err; /* purecov: inspected */
|
||||
}
|
||||
|
||||
@@ -1083,6 +1079,11 @@ static ha_rows find_all_keys(THD *thd, Sort_param *param, SQL_SELECT *select,
|
||||
DBUG_RETURN(num_records);
|
||||
|
||||
err:
|
||||
if (!quick_select)
|
||||
{
|
||||
(void) file->extra(HA_EXTRA_NO_CACHE);
|
||||
file->ha_rnd_end();
|
||||
}
|
||||
sort_form->column_bitmaps_set(save_read_set, save_write_set);
|
||||
DBUG_RETURN(HA_POS_ERROR);
|
||||
} /* find_all_keys */
|
||||
@@ -1121,7 +1122,7 @@ write_keys(Sort_param *param, SORT_INFO *fs_info, uint count,
|
||||
|
||||
if (!my_b_inited(tempfile) &&
|
||||
open_cached_file(tempfile, mysql_tmpdir, TEMP_PREFIX, DISK_CHUNK_SIZE,
|
||||
MYF(MY_WME)))
|
||||
MYF(MY_WME | MY_TRACK_WITH_LIMIT)))
|
||||
DBUG_RETURN(1); /* purecov: inspected */
|
||||
/* check we won't have more buffpeks than we can possibly keep in memory */
|
||||
if (my_b_tell(buffpek_pointers) + sizeof(Merge_chunk) > (ulonglong)UINT_MAX)
|
||||
@@ -1563,7 +1564,7 @@ int merge_many_buff(Sort_param *param, Sort_buffer sort_buffer,
|
||||
DBUG_RETURN(0); /* purecov: inspected */
|
||||
if (flush_io_cache(t_file) ||
|
||||
open_cached_file(&t_file2, mysql_tmpdir, TEMP_PREFIX, DISK_CHUNK_SIZE,
|
||||
MYF(MY_WME)))
|
||||
MYF(MY_WME | MY_TRACK_WITH_LIMIT)))
|
||||
DBUG_RETURN(1); /* purecov: inspected */
|
||||
|
||||
from_file= t_file; to_file= &t_file2;
|
||||
|
@@ -431,18 +431,21 @@ C_MODE_END
|
||||
@retval
|
||||
!=0 Error
|
||||
*/
|
||||
#include "my_handler_errors.h"
|
||||
|
||||
int ha_init_errors(void)
|
||||
{
|
||||
#define SETMSG(nr, msg) handler_errmsgs[(nr) - HA_ERR_FIRST]= (msg)
|
||||
|
||||
/* Allocate a pointer array for the error message strings. */
|
||||
/* Zerofill it to avoid uninitialized gaps. */
|
||||
if (! (handler_errmsgs= (const char**) my_malloc(key_memory_handler_errmsgs,
|
||||
HA_ERR_ERRORS * sizeof(char*),
|
||||
MYF(MY_WME | MY_ZEROFILL))))
|
||||
MYF(MY_WME))))
|
||||
return 1;
|
||||
|
||||
/* Copy default handler error messages */
|
||||
memcpy(handler_errmsgs, handler_error_messages, HA_ERR_ERRORS * sizeof(char*));
|
||||
|
||||
/* Set the dedicated error messages. */
|
||||
SETMSG(HA_ERR_KEY_NOT_FOUND, ER_DEFAULT(ER_KEY_NOT_FOUND));
|
||||
SETMSG(HA_ERR_FOUND_DUPP_KEY, ER_DEFAULT(ER_DUP_KEY));
|
||||
@@ -4616,6 +4619,12 @@ void handler::print_error(int error, myf errflag)
|
||||
textno= ER_DISK_FULL;
|
||||
SET_FATAL_ERROR; // Ensure error is logged
|
||||
break;
|
||||
case EE_GLOBAL_TMP_SPACE_FULL: // Safety
|
||||
case EE_LOCAL_TMP_SPACE_FULL: // Safety
|
||||
case HA_ERR_GLOBAL_TMP_SPACE_FULL:
|
||||
case HA_ERR_LOCAL_TMP_SPACE_FULL:
|
||||
textno= error;
|
||||
break;
|
||||
case HA_ERR_KEY_NOT_FOUND:
|
||||
case HA_ERR_NO_ACTIVE_RECORD:
|
||||
case HA_ERR_RECORD_DELETED:
|
||||
|
@@ -734,7 +734,8 @@ bool Create_json_table::finalize(THD *thd, TABLE *table,
|
||||
|
||||
table->db_stat= HA_OPEN_KEYFILE;
|
||||
if (unlikely(table->file->ha_open(table, table->s->path.str, O_RDWR,
|
||||
HA_OPEN_TMP_TABLE | HA_OPEN_INTERNAL_TABLE)))
|
||||
HA_OPEN_TMP_TABLE | HA_OPEN_INTERNAL_TABLE |
|
||||
HA_OPEN_SIZE_TRACKING)))
|
||||
DBUG_RETURN(true);
|
||||
|
||||
table->set_created();
|
||||
|
60
sql/log.cc
60
sql/log.cc
@@ -41,6 +41,7 @@
|
||||
#include "mysqld.h"
|
||||
#include "ddl_log.h"
|
||||
#include "gtid_index.h"
|
||||
#include "mysys_err.h" // EE_LOCAL_TMP_SPACE_FULL
|
||||
|
||||
#include <my_dir.h>
|
||||
#include <m_ctype.h> // For test_if_number
|
||||
@@ -310,11 +311,6 @@ void make_default_log_name(char **out, const char* log_ext, bool once)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Helper classes to store non-transactional and transactional data
|
||||
before copying it to the binary log.
|
||||
*/
|
||||
|
||||
void Log_event_writer::add_status(enum_logged_status status)
|
||||
{
|
||||
if (likely(cache_data))
|
||||
@@ -2381,6 +2377,8 @@ bool Event_log::check_write_error(THD *thd)
|
||||
case ER_TRANS_CACHE_FULL:
|
||||
case ER_STMT_CACHE_FULL:
|
||||
case ER_ERROR_ON_WRITE:
|
||||
case EE_LOCAL_TMP_SPACE_FULL:
|
||||
case EE_GLOBAL_TMP_SPACE_FULL:
|
||||
case ER_BINLOG_LOGGING_IMPOSSIBLE:
|
||||
checked= TRUE;
|
||||
break;
|
||||
@@ -3259,8 +3257,9 @@ bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time,
|
||||
goto err;
|
||||
}
|
||||
|
||||
if ((log_slow_verbosity & LOG_SLOW_VERBOSITY_QUERY_PLAN) &&
|
||||
thd->tmp_tables_used &&
|
||||
if ((log_slow_verbosity & LOG_SLOW_VERBOSITY_QUERY_PLAN))
|
||||
{
|
||||
if (thd->tmp_tables_used &&
|
||||
my_b_printf(&log_file,
|
||||
"# Tmp_tables: %lu Tmp_disk_tables: %lu "
|
||||
"Tmp_table_sizes: %s\n",
|
||||
@@ -3268,6 +3267,12 @@ bool MYSQL_QUERY_LOG::write(THD *thd, time_t current_time,
|
||||
(ulong) thd->tmp_tables_disk_used,
|
||||
llstr(thd->tmp_tables_size, llbuff)))
|
||||
goto err;
|
||||
if (thd->max_tmp_space_used &&
|
||||
my_b_printf(&log_file,
|
||||
"# Max_tmp_disk_space_used: %s\n",
|
||||
llstr(thd->max_tmp_space_used, llbuff)))
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (thd->spcont &&
|
||||
my_b_printf(&log_file, "# Stored_routine: %s\n",
|
||||
@@ -4162,7 +4167,7 @@ static bool copy_up_file_and_fill(IO_CACHE *index_file, my_off_t offset)
|
||||
goto err;
|
||||
}
|
||||
/* The following will either truncate the file or fill the end with \n' */
|
||||
if (mysql_file_chsize(file, offset - init_offset, '\n', MYF(MY_WME)) ||
|
||||
if (mysql_file_chsize(file, offset - init_offset, '\n', MYF(MY_WME)) > 0 ||
|
||||
mysql_file_sync(file, MYF(MY_WME)))
|
||||
goto err;
|
||||
|
||||
@@ -6115,9 +6120,11 @@ static binlog_cache_mngr *binlog_setup_cache_mngr(THD *thd)
|
||||
MYF(MY_ZEROFILL));
|
||||
if (!cache_mngr ||
|
||||
open_cached_file(&cache_mngr->stmt_cache.cache_log, mysql_tmpdir,
|
||||
LOG_PREFIX, (size_t)binlog_stmt_cache_size, MYF(MY_WME)) ||
|
||||
LOG_PREFIX, (size_t)binlog_stmt_cache_size,
|
||||
MYF(MY_WME | MY_TRACK_WITH_LIMIT)) ||
|
||||
open_cached_file(&cache_mngr->trx_cache.cache_log, mysql_tmpdir,
|
||||
LOG_PREFIX, (size_t)binlog_cache_size, MYF(MY_WME)))
|
||||
LOG_PREFIX, (size_t)binlog_cache_size,
|
||||
MYF(MY_WME | MY_TRACK_WITH_LIMIT)))
|
||||
{
|
||||
my_free(cache_mngr);
|
||||
return NULL;
|
||||
@@ -6268,7 +6275,8 @@ THD::binlog_start_trans_and_stmt()
|
||||
// Replicated events in writeset doesn't have checksum
|
||||
Log_event_writer writer(&tmp_io_cache, 0, BINLOG_CHECKSUM_ALG_OFF, NULL);
|
||||
if(!open_cached_file(&tmp_io_cache, mysql_tmpdir, TEMP_PREFIX,
|
||||
128, MYF(MY_WME)))
|
||||
128,
|
||||
MYF(MY_WME | MY_TRACK_WITH_LIMIT)))
|
||||
{
|
||||
uint64 seqno= this->variables.gtid_seq_no;
|
||||
uint32 domain_id= this->variables.gtid_domain_id;
|
||||
@@ -6643,7 +6651,8 @@ Event_log::flush_and_set_pending_rows_event(THD *thd, Rows_log_event* event,
|
||||
{
|
||||
set_write_error(thd, is_transactional);
|
||||
if (check_cache_error(thd, cache_data) &&
|
||||
stmt_has_updated_non_trans_table(thd))
|
||||
(stmt_has_updated_non_trans_table(thd) ||
|
||||
!is_transactional))
|
||||
cache_data->set_incident();
|
||||
delete pending;
|
||||
cache_data->set_pending(NULL);
|
||||
@@ -7814,6 +7823,11 @@ int Event_log::write_cache_raw(THD *thd, IO_CACHE *cache)
|
||||
|
||||
IO_CACHE *file= get_log_file();
|
||||
IF_DBUG(size_t total= cache->end_of_file,);
|
||||
|
||||
/*
|
||||
Note that for the first loop there is nothing to write if
|
||||
the full file fits into the cache.
|
||||
*/
|
||||
do
|
||||
{
|
||||
size_t read_len= cache->read_end - cache->read_pos;
|
||||
@@ -7845,8 +7859,10 @@ int Event_log::write_cache_raw(THD *thd, IO_CACHE *cache)
|
||||
|
||||
int Event_log::write_cache(THD *thd, binlog_cache_data *cache_data)
|
||||
{
|
||||
DBUG_ENTER("Event_log::write_cache");
|
||||
int res;
|
||||
IO_CACHE *cache= &cache_data->cache_log;
|
||||
DBUG_ENTER("Event_log::write_cache");
|
||||
|
||||
mysql_mutex_assert_owner(&LOCK_log);
|
||||
|
||||
/*
|
||||
@@ -7862,8 +7878,16 @@ int Event_log::write_cache(THD *thd, binlog_cache_data *cache_data)
|
||||
DBUG_RETURN(res ? ER_ERROR_ON_WRITE : 0);
|
||||
}
|
||||
|
||||
if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0))
|
||||
/*
|
||||
Allow flush of transaction logs to temporary go over the tmp space limit
|
||||
as we do not want the commit to fail
|
||||
*/
|
||||
cache->myflags&= ~MY_TRACK_WITH_LIMIT;
|
||||
res= reinit_io_cache(cache, READ_CACHE, 0, 0, 0);
|
||||
cache->myflags|= MY_TRACK_WITH_LIMIT;
|
||||
if (res)
|
||||
DBUG_RETURN(ER_ERROR_ON_WRITE);
|
||||
|
||||
/* Amount of remaining bytes in the IO_CACHE read buffer. */
|
||||
size_t log_file_pos;
|
||||
uchar header_buf[LOG_EVENT_HEADER_LEN];
|
||||
@@ -10060,7 +10084,7 @@ int TC_LOG_MMAP::open(const char *opt_name)
|
||||
goto err;
|
||||
inited=1;
|
||||
file_length= opt_tc_log_size;
|
||||
if (mysql_file_chsize(fd, file_length, 0, MYF(MY_WME)))
|
||||
if (mysql_file_chsize(fd, file_length, 0, MYF(MY_WME)) > 0)
|
||||
goto err;
|
||||
}
|
||||
else
|
||||
@@ -10677,7 +10701,7 @@ bool MYSQL_BIN_LOG::truncate_and_remove_binlogs(const char *file_name,
|
||||
|
||||
// Trim index file
|
||||
error= mysql_file_chsize(index_file.file, index_file_offset, '\n',
|
||||
MYF(MY_WME));
|
||||
MYF(MY_WME) > 0);
|
||||
if (!error)
|
||||
error= mysql_file_sync(index_file.file, MYF(MY_WME));
|
||||
if (error)
|
||||
@@ -10719,14 +10743,14 @@ bool MYSQL_BIN_LOG::truncate_and_remove_binlogs(const char *file_name,
|
||||
old_size= s.st_size;
|
||||
clear_inuse_flag_when_closing(file);
|
||||
/* Change binlog file size to truncate_pos */
|
||||
error= mysql_file_chsize(file, pos, 0, MYF(MY_WME));
|
||||
error= mysql_file_chsize(file, pos, 0, MYF(MY_WME)) > 0;
|
||||
if (!error)
|
||||
error= mysql_file_sync(file, MYF(MY_WME));
|
||||
if (error)
|
||||
{
|
||||
sql_print_error("Failed to truncate the "
|
||||
"binlog file: %s to size: %llu. Error: %d",
|
||||
file_name, pos, error);
|
||||
file_name, pos, my_errno);
|
||||
goto end;
|
||||
}
|
||||
else
|
||||
|
@@ -23,6 +23,11 @@ static constexpr my_off_t MY_OFF_T_UNDEF= ~0ULL;
|
||||
static constexpr my_off_t CACHE_FILE_TRUNC_SIZE = 65536;
|
||||
|
||||
|
||||
/*
|
||||
Helper classes to store non-transactional and transactional data
|
||||
before copying it to the binary log.
|
||||
*/
|
||||
|
||||
class binlog_cache_data
|
||||
{
|
||||
public:
|
||||
@@ -90,15 +95,15 @@ public:
|
||||
{
|
||||
bool cache_was_empty= empty();
|
||||
bool truncate_file= (cache_log.file != -1 &&
|
||||
my_b_write_tell(&cache_log) > CACHE_FILE_TRUNC_SIZE);
|
||||
my_b_write_tell(&cache_log) >
|
||||
MY_MIN(CACHE_FILE_TRUNC_SIZE, binlog_stmt_cache_size));
|
||||
truncate(0,1); // Forget what's in cache
|
||||
checksum_opt= !precompute_checksums ? BINLOG_CHECKSUM_ALG_OFF :
|
||||
(enum_binlog_checksum_alg)binlog_checksum_options;
|
||||
if (!cache_was_empty)
|
||||
compute_statistics();
|
||||
if (truncate_file)
|
||||
my_chsize(cache_log.file, 0, 0, MYF(MY_WME));
|
||||
|
||||
truncate_io_cache(&cache_log);
|
||||
status= 0;
|
||||
incident= FALSE;
|
||||
before_stmt_pos= MY_OFF_T_UNDEF;
|
||||
|
@@ -1010,7 +1010,8 @@ Rows_log_event::print_verbose_one_row(IO_CACHE *file, table_def *td,
|
||||
IO_CACHE tmp_cache;
|
||||
|
||||
// Using a tmp IO_CACHE to get the value output
|
||||
open_cached_file(&tmp_cache, NULL, NULL, 0, MYF(MY_WME | MY_NABP));
|
||||
open_cached_file(&tmp_cache, NULL, NULL, 0,
|
||||
MYF(MY_WME | MY_NABP | MY_TRACK_WITH_LIMIT));
|
||||
size= log_event_print_value(&tmp_cache, print_event_info,
|
||||
is_null ? NULL: value,
|
||||
td->type(i), td->field_metadata(i),
|
||||
@@ -1831,7 +1832,8 @@ bool Log_event::print_base64(IO_CACHE* file,
|
||||
IO_CACHE tmp_cache;
|
||||
|
||||
if (open_cached_file(&tmp_cache, NULL, NULL, 0,
|
||||
MYF(MY_WME | MY_NABP)))
|
||||
MYF(MY_WME | MY_NABP |
|
||||
MY_TRACK_WITH_LIMIT)))
|
||||
{
|
||||
delete ev;
|
||||
goto err;
|
||||
@@ -3719,7 +3721,7 @@ bool Ignorable_log_event::print(FILE *file,
|
||||
*/
|
||||
st_print_event_info::st_print_event_info()
|
||||
{
|
||||
myf const flags = MYF(MY_WME | MY_NABP);
|
||||
myf const flags = MYF(MY_WME | MY_NABP | MY_TRACK_WITH_LIMIT);
|
||||
/*
|
||||
Currently we only use static PRINT_EVENT_INFO objects, so zeroed at
|
||||
program's startup, but these explicit bzero() is for the day someone
|
||||
|
@@ -218,7 +218,8 @@ static int my_b_encr_write(IO_CACHE *info, const uchar *Buffer, size_t Count)
|
||||
crypt_data->last_block_length= wlength;
|
||||
}
|
||||
|
||||
if (mysql_file_write(info->file, wbuffer, wlength, info->myflags | MY_NABP))
|
||||
if (io_cache_tmp_file_track(info, info->pos_in_file + wlength) ||
|
||||
mysql_file_write(info->file, wbuffer, wlength, info->myflags | MY_NABP))
|
||||
DBUG_RETURN(info->error= -1);
|
||||
|
||||
Buffer+= length;
|
||||
|
@@ -285,6 +285,7 @@ extern "C"
|
||||
{
|
||||
static void my_malloc_size_cb_func(long long size,
|
||||
my_bool is_thread_specific);
|
||||
static int temp_file_size_cb_func(struct tmp_file_tracking *track, int no_error);
|
||||
}
|
||||
|
||||
/* Constants */
|
||||
@@ -480,6 +481,8 @@ ulong slave_run_triggers_for_rbr= 0;
|
||||
ulong slave_ddl_exec_mode_options= SLAVE_EXEC_MODE_IDEMPOTENT;
|
||||
ulonglong slave_type_conversions_options;
|
||||
ulong thread_cache_size=0;
|
||||
ulonglong global_max_tmp_space_usage;
|
||||
Atomic_counter<ulonglong> global_tmp_space_used;
|
||||
ulonglong binlog_cache_size=0;
|
||||
ulonglong binlog_file_cache_size=0;
|
||||
uint slave_connections_needed_for_purge;
|
||||
@@ -1942,6 +1945,11 @@ static void mysqld_exit(int exit_code)
|
||||
if (exit_code == 0 || opt_endinfo)
|
||||
SAFEMALLOC_REPORT_MEMORY(0);
|
||||
}
|
||||
if (global_tmp_space_used)
|
||||
fprintf(stderr, "Warning: Internal tmp_space accounting error of %lld "
|
||||
"bytes\n",
|
||||
(longlong) global_tmp_space_used);
|
||||
|
||||
DBUG_LEAVE;
|
||||
#ifdef _WIN32
|
||||
my_report_svc_status(SERVICE_STOPPED, exit_code, 0);
|
||||
@@ -3762,6 +3770,68 @@ static void my_malloc_size_cb_func(long long size, my_bool is_thread_specific)
|
||||
update_global_memory_status(size);
|
||||
}
|
||||
|
||||
|
||||
/* Collect temporary file space usage */
|
||||
|
||||
static int temp_file_size_cb_func(struct tmp_file_tracking *track,
|
||||
int no_error)
|
||||
{
|
||||
THD *thd= current_thd;
|
||||
longlong size_change= (longlong) (track->file_size -
|
||||
track->previous_file_size);
|
||||
DBUG_ENTER("temp_file_size_cb_func");
|
||||
DBUG_PRINT("enter", ("last: %llu current: %llu diff: %lld",
|
||||
track->previous_file_size,
|
||||
track->file_size,
|
||||
(longlong) (track->file_size -
|
||||
track->previous_file_size)));
|
||||
DBUG_ASSERT(thd);
|
||||
if (thd)
|
||||
{
|
||||
/*
|
||||
This has to be true as thd must contain all tmp space used and
|
||||
any thus must have been called before with an allocation of
|
||||
track->previous_file_size.
|
||||
*/
|
||||
DBUG_ASSERT(thd->status_var.tmp_space_used >= track->previous_file_size);
|
||||
|
||||
global_tmp_space_used+= size_change;
|
||||
if (size_change > 0)
|
||||
{
|
||||
/* Cache to avoid reading global_tmp_space_used too many times */
|
||||
ulonglong cached_space= global_tmp_space_used;
|
||||
|
||||
if (cached_space > global_max_tmp_space_usage && !no_error &&
|
||||
global_max_tmp_space_usage)
|
||||
{
|
||||
global_tmp_space_used-= size_change;
|
||||
DBUG_RETURN(my_errno= EE_GLOBAL_TMP_SPACE_FULL);
|
||||
}
|
||||
if (thd->status_var.tmp_space_used + size_change >
|
||||
thd->variables.max_tmp_space_usage && !no_error &&
|
||||
thd->variables.max_tmp_space_usage)
|
||||
{
|
||||
global_tmp_space_used-= size_change;
|
||||
DBUG_RETURN(my_errno= EE_LOCAL_TMP_SPACE_FULL);
|
||||
}
|
||||
set_if_bigger(global_status_var.max_tmp_space_used, cached_space);
|
||||
}
|
||||
thd->status_var.tmp_space_used+= size_change;
|
||||
/* Max value for the connection */
|
||||
set_if_bigger(thd->status_var.max_tmp_space_used,
|
||||
thd->status_var.tmp_space_used);
|
||||
/* Max value for the query */
|
||||
set_if_bigger(thd->max_tmp_space_used,
|
||||
thd->status_var.tmp_space_used);
|
||||
DBUG_ASSERT((longlong) global_tmp_space_used >= 0);
|
||||
DBUG_ASSERT((longlong) thd->status_var.tmp_space_used >= 0);
|
||||
|
||||
/* Record that we have registered the change */
|
||||
track->previous_file_size= track->file_size;
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
int json_escape_string(const char *str,const char *str_end,
|
||||
char *json, char *json_end)
|
||||
{
|
||||
@@ -3824,6 +3894,7 @@ static int init_early_variables()
|
||||
{
|
||||
set_current_thd(0);
|
||||
set_malloc_size_cb(my_malloc_size_cb_func);
|
||||
update_tmp_file_size= temp_file_size_cb_func;
|
||||
global_status_var.global_memory_used= 0;
|
||||
init_alloc_root(PSI_NOT_INSTRUMENTED, &startup_root, 1024, 0, MYF(0));
|
||||
init_alloc_root(PSI_NOT_INSTRUMENTED, &read_only_root, 1024, 0,
|
||||
@@ -7501,6 +7572,7 @@ SHOW_VAR status_vars[]= {
|
||||
{"Master_gtid_wait_count", (char*) offsetof(STATUS_VAR, master_gtid_wait_count), SHOW_LONG_STATUS},
|
||||
{"Master_gtid_wait_timeouts", (char*) offsetof(STATUS_VAR, master_gtid_wait_timeouts), SHOW_LONG_STATUS},
|
||||
{"Master_gtid_wait_time", (char*) offsetof(STATUS_VAR, master_gtid_wait_time), SHOW_LONG_STATUS},
|
||||
{"Max_tmp_space_used", (char*) offsetof(STATUS_VAR, max_tmp_space_used), SHOW_LONGLONG_STATUS},
|
||||
{"Max_used_connections", (char*) &max_used_connections, SHOW_LONG},
|
||||
{"Max_used_connections_time",(char*) &show_max_used_connections_time, SHOW_SIMPLE_FUNC},
|
||||
{"Memory_used", (char*) &show_memory_used, SHOW_SIMPLE_FUNC},
|
||||
@@ -7625,6 +7697,7 @@ SHOW_VAR status_vars[]= {
|
||||
{"Tc_log_page_size", (char*) &tc_log_page_size, SHOW_LONG_NOFLUSH},
|
||||
{"Tc_log_page_waits", (char*) &tc_log_page_waits, SHOW_LONG},
|
||||
#endif
|
||||
{"Tmp_space_used", (char*) offsetof(STATUS_VAR, tmp_space_used), SHOW_LONGLONG_STATUS},
|
||||
#ifdef HAVE_POOL_OF_THREADS
|
||||
{"Threadpool_idle_threads", (char *) &show_threadpool_idle_threads, SHOW_SIMPLE_FUNC},
|
||||
{"Threadpool_threads", (char *) &show_threadpool_threads, SHOW_SIMPLE_FUNC},
|
||||
@@ -7846,9 +7919,7 @@ static int mysql_init_variables(void)
|
||||
prepared_stmt_count= 0;
|
||||
mysqld_unix_port= opt_mysql_tmpdir= my_bind_addr_str= NullS;
|
||||
bzero((uchar*) &mysql_tmpdir_list, sizeof(mysql_tmpdir_list));
|
||||
/* Clear all except global_memory_used */
|
||||
bzero((char*) &global_status_var, offsetof(STATUS_VAR,
|
||||
last_cleared_system_status_var));
|
||||
bzero((char*) &global_status_var, clear_for_server_start);
|
||||
opt_large_pages= 0;
|
||||
opt_super_large_pages= 0;
|
||||
#if defined(ENABLED_DEBUG_SYNC)
|
||||
@@ -9171,7 +9242,7 @@ void refresh_session_status(THD *thd)
|
||||
mysql_mutex_unlock(&LOCK_status);
|
||||
|
||||
/* Reset thread's status variables */
|
||||
thd->set_status_var_init();
|
||||
thd->set_status_var_init(clear_for_flush_status);
|
||||
thd->status_var.global_memory_used= 0;
|
||||
bzero((uchar*) &thd->org_status_var, sizeof(thd->org_status_var));
|
||||
thd->start_bytes_received= 0;
|
||||
@@ -9195,8 +9266,7 @@ void refresh_global_status()
|
||||
Reset accoumulated thread's status variables.
|
||||
These are the variables in 'status_vars[]' with the prefix _STATUS.
|
||||
*/
|
||||
bzero((char*) &global_status_var, offsetof(STATUS_VAR,
|
||||
last_cleared_system_status_var));
|
||||
bzero(&global_status_var, clear_for_flush_status);
|
||||
|
||||
#ifdef WITH_WSREP
|
||||
if (WSREP_ON)
|
||||
@@ -9245,13 +9315,12 @@ void refresh_status_legacy(THD *thd)
|
||||
add_to_status(&global_status_var, &thd->status_var);
|
||||
|
||||
/* Reset thread's status variables */
|
||||
thd->set_status_var_init();
|
||||
thd->set_status_var_init(clear_for_flush_status);
|
||||
thd->status_var.global_memory_used= 0;
|
||||
bzero((uchar*) &thd->org_status_var, sizeof(thd->org_status_var));
|
||||
thd->start_bytes_received= 0;
|
||||
|
||||
/* Reset some global variables */
|
||||
reset_status_vars();
|
||||
#ifdef WITH_WSREP
|
||||
if (WSREP_ON)
|
||||
{
|
||||
|
@@ -219,6 +219,8 @@ extern char log_error_file[FN_REFLEN], *opt_tc_log_file, *opt_ddl_recovery_file;
|
||||
extern const double log_10[309];
|
||||
extern ulonglong keybuff_size;
|
||||
extern ulonglong thd_startup_options;
|
||||
extern ulonglong global_max_tmp_space_usage;
|
||||
extern Atomic_counter<ulonglong> global_tmp_space_used;
|
||||
extern my_thread_id global_thread_id;
|
||||
extern ulong binlog_cache_use, binlog_cache_disk_use;
|
||||
extern ulong binlog_stmt_cache_use, binlog_stmt_cache_disk_use;
|
||||
|
@@ -2269,11 +2269,12 @@ void rpl_group_info::cleanup_context(THD *thd, bool error, bool keep_domain_owne
|
||||
|
||||
DBUG_ASSERT(this->thd == thd);
|
||||
/*
|
||||
1) Instances of Table_map_log_event, if ::do_apply_event() was called on them,
|
||||
may have opened tables, which we cannot be sure have been closed (because
|
||||
maybe the Rows_log_event have not been found or will not be, because slave
|
||||
SQL thread is stopping, or relay log has a missing tail etc). So we close
|
||||
all thread's tables. And so the table mappings have to be cancelled.
|
||||
1) Instances of Table_map_log_event, if ::do_apply_event() was
|
||||
called on them, may have opened tables, which we cannot be sure
|
||||
have been closed (because maybe the Rows_log_event have not been
|
||||
found or will not be, because slave SQL thread is stopping, or
|
||||
relay log has a missing tail etc). So we close all thread's
|
||||
tables. And so the table mappings have to be cancelled.
|
||||
2) Rows_log_event::do_apply_event() may even have started statements or
|
||||
transactions on them, which we need to rollback in case of error.
|
||||
3) If finding a Format_description_log_event after a BEGIN, we also need
|
||||
@@ -2282,6 +2283,11 @@ void rpl_group_info::cleanup_context(THD *thd, bool error, bool keep_domain_owne
|
||||
*/
|
||||
if (unlikely(error))
|
||||
{
|
||||
/*
|
||||
We have to reset the error as otherwise we get an assert in
|
||||
trans_rollback() when it checks if the rollback caused an error.
|
||||
*/
|
||||
thd->clear_error();
|
||||
trans_rollback_stmt(thd); // if a "statement transaction"
|
||||
/* trans_rollback() also resets OPTION_GTID_BEGIN */
|
||||
trans_rollback(thd); // if a "real transaction"
|
||||
|
@@ -1313,7 +1313,8 @@ void THD::init()
|
||||
update_charset(); // plugin_thd_var() changed character sets
|
||||
reset_current_stmt_binlog_format_row();
|
||||
reset_binlog_local_stmt_filter();
|
||||
set_status_var_init();
|
||||
/* local_memory_used was setup in THD::THD() */
|
||||
set_status_var_init(clear_for_new_connection);
|
||||
status_var.max_local_memory_used= status_var.local_memory_used;
|
||||
bzero((char *) &org_status_var, sizeof(org_status_var));
|
||||
status_in_global= 0;
|
||||
@@ -1696,6 +1697,12 @@ void THD::free_connection()
|
||||
|
||||
void THD::reset_for_reuse()
|
||||
{
|
||||
if (status_var.tmp_space_used)
|
||||
{
|
||||
DBUG_PRINT("error", ("tmp_space_usage: %lld", status_var.tmp_space_used));
|
||||
DBUG_ASSERT(status_var.tmp_space_used == 0 ||
|
||||
!debug_assert_on_not_freed_memory);
|
||||
}
|
||||
mysql_audit_init_thd(this);
|
||||
change_user(); // Calls cleanup() & init()
|
||||
get_stmt_da()->reset_diagnostics_area();
|
||||
@@ -1813,6 +1820,13 @@ THD::~THD()
|
||||
DBUG_ASSERT(status_var.local_memory_used == 0 ||
|
||||
!debug_assert_on_not_freed_memory);
|
||||
}
|
||||
if (status_var.tmp_space_used)
|
||||
{
|
||||
DBUG_PRINT("error", ("tmp_space_usage: %lld", status_var.tmp_space_used));
|
||||
DBUG_ASSERT(status_var.tmp_space_used == 0 ||
|
||||
!debug_assert_on_not_freed_memory);
|
||||
}
|
||||
|
||||
update_global_memory_status(status_var.global_memory_used);
|
||||
set_current_thd(orig_thd == this ? 0 : orig_thd);
|
||||
DBUG_VOID_RETURN;
|
||||
@@ -1842,7 +1856,9 @@ void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var)
|
||||
while (to != end)
|
||||
*(to++)+= *(from++);
|
||||
|
||||
/* Handle the not ulong variables. See end of system_status_var */
|
||||
/*
|
||||
Handle the not ulong variables. See end of system_status_var
|
||||
*/
|
||||
to_var->bytes_received+= from_var->bytes_received;
|
||||
to_var->bytes_sent+= from_var->bytes_sent;
|
||||
to_var->rows_read+= from_var->rows_read;
|
||||
@@ -1858,6 +1874,7 @@ void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var)
|
||||
/*
|
||||
Update global_memory_used. We have to do this with atomic_add as the
|
||||
global value can change outside of LOCK_status.
|
||||
Note that local_memory_used is handled in calc_sum_callback().
|
||||
*/
|
||||
if (to_var == &global_status_var)
|
||||
{
|
||||
@@ -1865,9 +1882,14 @@ void add_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var)
|
||||
(longlong) global_status_var.global_memory_used,
|
||||
(longlong) from_var->global_memory_used));
|
||||
update_global_memory_status(from_var->global_memory_used);
|
||||
/* global_tmp_space_used is always kept up to date */
|
||||
to_var->tmp_space_used= global_tmp_space_used;
|
||||
}
|
||||
else
|
||||
{
|
||||
to_var->global_memory_used+= from_var->global_memory_used;
|
||||
to_var->tmp_space_used+= from_var->tmp_space_used;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1915,6 +1937,7 @@ void add_diff_to_status(STATUS_VAR *to_var, STATUS_VAR *from_var,
|
||||
/*
|
||||
We don't need to accumulate memory_used as these are not reset or used by
|
||||
the calling functions. See execute_show_status().
|
||||
tmp_space_usage also does not need to be accumulated.
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -4550,11 +4573,15 @@ void thd_increment_bytes_received(void *thd, size_t length)
|
||||
((THD*) thd)->status_var.bytes_received+= length;
|
||||
}
|
||||
|
||||
/*
|
||||
Clear status variables
|
||||
|
||||
void THD::set_status_var_init()
|
||||
@param offset How much to clear. See clear_for_flush_status
|
||||
*/
|
||||
|
||||
void THD::set_status_var_init(ulong offset)
|
||||
{
|
||||
bzero((char*) &status_var, offsetof(STATUS_VAR,
|
||||
last_cleared_system_status_var));
|
||||
bzero((char*) &status_var, offset);
|
||||
/*
|
||||
Session status for Threads_running is always 1. It can only be queried
|
||||
by thread itself via INFORMATION_SCHEMA.SESSION_STATUS or SHOW [SESSION]
|
||||
@@ -6025,6 +6052,7 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup)
|
||||
void THD::store_slow_query_state(Sub_statement_state *backup)
|
||||
{
|
||||
backup->affected_rows= affected_rows;
|
||||
backup->max_tmp_space_used= max_tmp_space_used;
|
||||
backup->bytes_sent_old= bytes_sent_old;
|
||||
backup->examined_row_count= m_examined_row_count;
|
||||
backup->examined_row_count_for_statement= examined_row_count_for_statement;
|
||||
@@ -6043,6 +6071,7 @@ void THD::store_slow_query_state(Sub_statement_state *backup)
|
||||
void THD::reset_slow_query_state(Sub_statement_state *backup)
|
||||
{
|
||||
affected_rows= 0;
|
||||
max_tmp_space_used= 0;
|
||||
bytes_sent_old= status_var.bytes_sent;
|
||||
m_examined_row_count= 0;
|
||||
m_sent_row_count= 0;
|
||||
@@ -6082,6 +6111,7 @@ void THD::add_slow_query_state(Sub_statement_state *backup)
|
||||
tmp_tables_disk_used+= backup->tmp_tables_disk_used;
|
||||
tmp_tables_size+= backup->tmp_tables_size;
|
||||
tmp_tables_used+= backup->tmp_tables_used;
|
||||
max_tmp_space_used= MY_MAX(max_tmp_space_used, backup->max_tmp_space_used);
|
||||
if (backup->in_stored_procedure)
|
||||
{
|
||||
/*
|
||||
|
@@ -738,6 +738,7 @@ typedef struct system_variables
|
||||
*/
|
||||
ulonglong slave_skip_counter;
|
||||
ulonglong max_relay_log_size;
|
||||
ulonglong max_tmp_space_usage;
|
||||
|
||||
double optimizer_where_cost, optimizer_scan_setup_cost;
|
||||
double long_query_time_double, max_statement_time_double;
|
||||
@@ -1059,9 +1060,14 @@ typedef struct system_status_var
|
||||
double last_query_cost;
|
||||
double cpu_time, busy_time;
|
||||
uint32 threads_running;
|
||||
/* Don't initialize */
|
||||
|
||||
/* Following variables are not cleared by FLUSH STATUS */
|
||||
ulonglong max_tmp_space_used;
|
||||
/* Memory used for thread local storage */
|
||||
int64 max_local_memory_used;
|
||||
/* Don't copy variables back to THD after this in show status */
|
||||
ulonglong tmp_space_used;
|
||||
/* Don't reset variables after this */
|
||||
volatile int64 local_memory_used;
|
||||
/* Memory allocated for global usage */
|
||||
volatile int64 global_memory_used;
|
||||
@@ -1075,12 +1081,22 @@ typedef struct system_status_var
|
||||
*/
|
||||
|
||||
#define last_system_status_var questions
|
||||
#define last_cleared_system_status_var local_memory_used
|
||||
|
||||
/* Parameters to set_status_var_init() */
|
||||
|
||||
#define STATUS_OFFSET(A) offsetof(STATUS_VAR,A)
|
||||
/* Clear as part of flush */
|
||||
#define clear_for_flush_status STATUS_OFFSET(tmp_space_used)
|
||||
/* Clear as part of startup */
|
||||
#define clear_for_new_connection STATUS_OFFSET(local_memory_used)
|
||||
/* Full initialization. Note that global_memory_used is updated early! */
|
||||
#define clear_for_server_start STATUS_OFFSET(global_memory_used)
|
||||
#define last_restored_status_var clear_for_flush_status
|
||||
|
||||
|
||||
/** Number of contiguous global status variables */
|
||||
constexpr int COUNT_GLOBAL_STATUS_VARS= int(offsetof(STATUS_VAR,
|
||||
last_system_status_var) /
|
||||
sizeof(ulong)) + 1;
|
||||
constexpr int COUNT_GLOBAL_STATUS_VARS=
|
||||
int(STATUS_OFFSET(last_system_status_var) /sizeof(ulong)) + 1;
|
||||
|
||||
/*
|
||||
Global status variables
|
||||
@@ -2114,6 +2130,7 @@ public:
|
||||
ulonglong sent_row_count_for_statement, examined_row_count_for_statement;
|
||||
ulonglong affected_rows;
|
||||
ulonglong bytes_sent_old;
|
||||
ulonglong max_tmp_space_used;
|
||||
ha_handler_stats handler_stats;
|
||||
ulong tmp_tables_used;
|
||||
ulong tmp_tables_disk_used;
|
||||
@@ -3822,6 +3839,7 @@ public:
|
||||
ulonglong tmp_tables_size;
|
||||
ulonglong bytes_sent_old;
|
||||
ulonglong affected_rows; /* Number of changed rows */
|
||||
ulonglong max_tmp_space_used;
|
||||
|
||||
Opt_trace_context opt_trace;
|
||||
pthread_t real_id; /* For debugging */
|
||||
@@ -4854,7 +4872,7 @@ public:
|
||||
(!transaction->stmt.modified_non_trans_table ||
|
||||
(variables.sql_mode & MODE_STRICT_ALL_TABLES)));
|
||||
}
|
||||
void set_status_var_init();
|
||||
void set_status_var_init(ulong offset);
|
||||
void reset_n_backup_open_tables_state(Open_tables_backup *backup);
|
||||
void restore_backup_open_tables_state(Open_tables_backup *backup);
|
||||
void reset_sub_statement_state(Sub_statement_state *backup, uint new_state);
|
||||
|
@@ -275,13 +275,14 @@ my_bool Expression_cache_tmptable::put_value(Item *value)
|
||||
fill_record(table_thd, cache_table, cache_table->field, items, true, true,
|
||||
true);
|
||||
if (unlikely(table_thd->is_error()))
|
||||
goto err;;
|
||||
goto err2;
|
||||
|
||||
if (unlikely((error=
|
||||
cache_table->file->ha_write_tmp_row(cache_table->record[0]))))
|
||||
{
|
||||
/* create_myisam_from_heap will generate error if needed */
|
||||
if (cache_table->file->is_fatal_error(error, HA_CHECK_DUP))
|
||||
if (cache_table->file->is_fatal_error(error, HA_CHECK_DUP) &&
|
||||
error != HA_ERR_RECORD_FILE_FULL)
|
||||
goto err;
|
||||
else
|
||||
{
|
||||
|
@@ -6202,8 +6202,7 @@ execute_show_status(THD *thd, TABLE_LIST *all_tables)
|
||||
mysql_mutex_lock(&LOCK_status);
|
||||
add_diff_to_status(&global_status_var, &thd->status_var,
|
||||
&old_status_var);
|
||||
memcpy(&thd->status_var, &old_status_var,
|
||||
offsetof(STATUS_VAR, last_cleared_system_status_var));
|
||||
memcpy(&thd->status_var, &old_status_var, last_restored_status_var);
|
||||
mysql_mutex_unlock(&LOCK_status);
|
||||
thd->initial_status_var= NULL;
|
||||
return res;
|
||||
|
@@ -22305,7 +22305,8 @@ bool open_tmp_table(TABLE *table)
|
||||
int error;
|
||||
if (unlikely((error= table->file->ha_open(table, table->s->path.str, O_RDWR,
|
||||
HA_OPEN_TMP_TABLE |
|
||||
HA_OPEN_INTERNAL_TABLE))))
|
||||
HA_OPEN_INTERNAL_TABLE |
|
||||
HA_OPEN_SIZE_TRACKING))))
|
||||
{
|
||||
table->file->print_error(error, MYF(0)); /* purecov: inspected */
|
||||
table->db_stat= 0;
|
||||
@@ -22761,7 +22762,10 @@ create_internal_tmp_table_from_heap(THD *thd, TABLE *table,
|
||||
thd->variables.option_bits))
|
||||
goto err2;
|
||||
if (open_tmp_table(&new_table))
|
||||
goto err1;
|
||||
{
|
||||
TMP_ENGINE_HTON->drop_table(TMP_ENGINE_HTON, new_table.s->path.str);
|
||||
goto err2;
|
||||
}
|
||||
if (table->file->indexes_are_disabled())
|
||||
new_table.file->ha_disable_indexes(key_map(0), false);
|
||||
table->file->ha_index_or_rnd_end();
|
||||
@@ -22840,9 +22844,7 @@ create_internal_tmp_table_from_heap(THD *thd, TABLE *table,
|
||||
table->file->print_error(write_err, MYF(0));
|
||||
err_killed:
|
||||
(void) table->file->ha_rnd_end();
|
||||
(void) new_table.file->ha_close();
|
||||
err1:
|
||||
TMP_ENGINE_HTON->drop_table(TMP_ENGINE_HTON, new_table.s->path.str);
|
||||
(void) new_table.file->drop_table(new_table.s->path.str);
|
||||
err2:
|
||||
delete new_table.file;
|
||||
thd_proc_info(thd, save_proc_info);
|
||||
|
@@ -3460,6 +3460,8 @@ static my_bool processlist_callback(THD *tmp, processlist_callback_arg *arg)
|
||||
|
||||
arg->table->field[18]->store(tmp->os_thread_id);
|
||||
|
||||
arg->table->field[19]->store((longlong) tmp->status_var.tmp_space_used, TRUE);
|
||||
|
||||
if (schema_table_store_record(arg->thd, arg->table))
|
||||
return 1;
|
||||
return 0;
|
||||
@@ -10140,6 +10142,7 @@ ST_FIELD_INFO processlist_fields_info[]=
|
||||
Column("QUERY_ID", SLonglong(10), NOT_NULL),
|
||||
Column("INFO_BINARY",Blob(PROCESS_LIST_INFO_WIDTH),NULLABLE, "Info_binary"),
|
||||
Column("TID", SLonglong(10), NOT_NULL, "Tid"),
|
||||
Column("TMP_SPACE_USED", SLonglong(10), NOT_NULL, "Tmp_space_used"),
|
||||
CEnd()
|
||||
};
|
||||
|
||||
|
@@ -1580,7 +1580,8 @@ public:
|
||||
return true;
|
||||
|
||||
if (open_cached_file(&io_cache, mysql_tmpdir, TEMP_PREFIX,
|
||||
1024, MYF(MY_WME)))
|
||||
1024,
|
||||
MYF(MY_WME | MY_TRACK_WITH_LIMIT)))
|
||||
return true;
|
||||
|
||||
handler *h= owner->stat_file;
|
||||
@@ -1604,12 +1605,14 @@ public:
|
||||
|
||||
do {
|
||||
h->position(owner->record[0]);
|
||||
my_b_write(&io_cache, h->ref, rowid_size);
|
||||
if (my_b_write(&io_cache, h->ref, rowid_size))
|
||||
return true;
|
||||
|
||||
} while (!h->ha_index_next_same(owner->record[0], key, prefix_len));
|
||||
|
||||
/* Prepare for reading */
|
||||
reinit_io_cache(&io_cache, READ_CACHE, 0L, 0, 0);
|
||||
if (reinit_io_cache(&io_cache, READ_CACHE, 0L, 0, 0))
|
||||
return true;
|
||||
h->ha_index_or_rnd_end();
|
||||
if (h->ha_rnd_init(false))
|
||||
return true;
|
||||
|
@@ -737,7 +737,8 @@ bool Sql_cmd_update::update_single_table(THD *thd)
|
||||
explain->buf_tracker.on_scan_init();
|
||||
IO_CACHE tempfile;
|
||||
if (open_cached_file(&tempfile, mysql_tmpdir,TEMP_PREFIX,
|
||||
DISK_CHUNK_SIZE, MYF(MY_WME)))
|
||||
DISK_CHUNK_SIZE,
|
||||
MYF(MY_WME | MY_TRACK_WITH_LIMIT)))
|
||||
goto err;
|
||||
|
||||
/* If quick select is used, initialize it before retrieving rows. */
|
||||
|
@@ -2923,15 +2923,16 @@ bool compute_window_func(THD *thd,
|
||||
if (unlikely(thd->is_error() || thd->is_killed()))
|
||||
break;
|
||||
|
||||
|
||||
/* Return to current row after notifying cursors for each window
|
||||
function. */
|
||||
tbl->file->ha_rnd_pos(tbl->record[0], rowid_buf);
|
||||
if (tbl->file->ha_rnd_pos(tbl->record[0], rowid_buf))
|
||||
return true;
|
||||
}
|
||||
|
||||
/* We now have computed values for each window function. They can now
|
||||
be saved in the current row. */
|
||||
save_window_function_values(window_functions, tbl, rowid_buf);
|
||||
if (save_window_function_values(window_functions, tbl, rowid_buf))
|
||||
return true;
|
||||
|
||||
rownum++;
|
||||
}
|
||||
|
@@ -7209,6 +7209,24 @@ static Sys_var_bit Sys_system_versioning_insert_history(
|
||||
OPTION_INSERT_HISTORY, DEFAULT(FALSE),
|
||||
NO_MUTEX_GUARD, IN_BINLOG);
|
||||
|
||||
/* Default limit 1T */
|
||||
static Sys_var_ulonglong Sys_max_tmp_space_usage(
|
||||
"max_tmp_session_space_usage",
|
||||
"The maximum total size of temporary file and temporary table usage. "
|
||||
"A value of 0 disables this feature",
|
||||
SESSION_VAR(max_tmp_space_usage), CMD_LINE(REQUIRED_ARG),
|
||||
VALID_RANGE(0, ULONGLONG_MAX), DEFAULT(1ULL << 40),
|
||||
BLOCK_SIZE(65536));
|
||||
|
||||
static Sys_var_ulonglong Sys_max_total_tmp_space_usage(
|
||||
"max_tmp_total_space_usage",
|
||||
"The maximum total size of all temporary file and temporary table "
|
||||
"usage over all connections. "
|
||||
"A value of 0 disables this feature",
|
||||
GLOBAL_VAR(global_max_tmp_space_usage), CMD_LINE(REQUIRED_ARG),
|
||||
VALID_RANGE(0, ULONGLONG_MAX), DEFAULT(1ULL << 40),
|
||||
BLOCK_SIZE(65536));
|
||||
|
||||
/* Optimizer variables */
|
||||
|
||||
static Sys_var_uint Sys_in_subquery_conversion_threshold(
|
||||
|
@@ -104,7 +104,7 @@ Unique::Unique(qsort_cmp2 comp_func, void * comp_func_fixed_arg,
|
||||
max_elements= 1;
|
||||
|
||||
(void) open_cached_file(&file, mysql_tmpdir, TEMP_PREFIX, DISK_CHUNK_SIZE,
|
||||
MYF(MY_WME));
|
||||
MYF(MY_WME | MY_TRACK_WITH_LIMIT));
|
||||
}
|
||||
|
||||
|
||||
@@ -720,7 +720,7 @@ bool Unique::merge(TABLE *table, uchar *buff, size_t buff_size,
|
||||
/* Open cached file for table records if it isn't open */
|
||||
if (! my_b_inited(outfile) &&
|
||||
open_cached_file(outfile, mysql_tmpdir, TEMP_PREFIX, DISK_CHUNK_SIZE,
|
||||
MYF(MY_WME)))
|
||||
MYF(MY_WME | MY_TRACK_WITH_LIMIT)))
|
||||
return 1;
|
||||
|
||||
bzero((char*) &sort_param,sizeof(sort_param));
|
||||
|
@@ -1671,7 +1671,7 @@ int ha_tina::delete_all_rows()
|
||||
DBUG_RETURN(-1);
|
||||
|
||||
/* Truncate the file to zero size */
|
||||
rc= mysql_file_chsize(share->tina_write_filedes, 0, 0, MYF(MY_WME));
|
||||
rc= mysql_file_chsize(share->tina_write_filedes, 0, 0, MYF(MY_WME)) > 0;
|
||||
|
||||
stats.records=0;
|
||||
/* Update shared info */
|
||||
|
@@ -1266,6 +1266,7 @@ int ha_maria::close(void)
|
||||
MARIA_HA *tmp= file;
|
||||
if (!tmp)
|
||||
return 0;
|
||||
/* Ensure we have no open transactions */
|
||||
DBUG_ASSERT(file->trn == 0 || file->trn == &dummy_transaction_object);
|
||||
DBUG_ASSERT(file->trn_next == 0 && file->trn_prev == 0);
|
||||
file= 0;
|
||||
@@ -2884,9 +2885,32 @@ int ha_maria::delete_table(const char *name)
|
||||
|
||||
void ha_maria::drop_table(const char *name)
|
||||
{
|
||||
my_bool tracked= file && file->s->tracked;
|
||||
struct tmp_file_tracking track_data;
|
||||
struct tmp_file_tracking track_index;
|
||||
|
||||
DBUG_ASSERT(!file || file->s->temporary);
|
||||
|
||||
if (tracked)
|
||||
{
|
||||
/* Inform tracking after files are deleted */
|
||||
track_data= file->s->track_data;
|
||||
track_index= file->s->track_index;
|
||||
#ifndef DBUG_OFF
|
||||
/* Avoid DBUG_ASSERT in maria_close() */
|
||||
bzero(&file->s->track_data, sizeof(file->s->track_data));
|
||||
bzero(&file->s->track_index, sizeof(file->s->track_index));
|
||||
#endif
|
||||
}
|
||||
|
||||
(void) ha_close();
|
||||
(void) maria_delete_table_files(name, 1, MY_WME);
|
||||
|
||||
if (tracked)
|
||||
{
|
||||
_ma_update_tmp_file_size(&track_data, 0);
|
||||
_ma_update_tmp_file_size(&track_index, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -3087,7 +3087,7 @@ int _ma_bitmap_create_first(MARIA_SHARE *share)
|
||||
int4store(marker, MARIA_NO_CRC_BITMAP_PAGE);
|
||||
|
||||
if (mysql_file_chsize(file, block_size - sizeof(marker),
|
||||
0, MYF(MY_WME)) ||
|
||||
0, MYF(MY_WME)) > 0 ||
|
||||
my_pwrite(file, marker, sizeof(marker),
|
||||
block_size - sizeof(marker),
|
||||
MYF(MY_NABP | MY_WME)))
|
||||
@@ -3335,6 +3335,10 @@ static my_bool _ma_bitmap_create_missing(MARIA_HA *info,
|
||||
goto err;
|
||||
|
||||
share->state.state.data_file_length= (page + 1) * bitmap->block_size;
|
||||
if (info->s->tracked &&
|
||||
_ma_update_tmp_file_size(&share->track_data,
|
||||
share->state.state.data_file_length))
|
||||
goto err;
|
||||
|
||||
DBUG_RETURN(FALSE);
|
||||
err:
|
||||
|
@@ -2091,7 +2091,8 @@ static my_bool write_tail(MARIA_HA *info,
|
||||
data_file_length after writing any log record (FILE_ID/REDO/UNDO) (see
|
||||
collect_tables()).
|
||||
*/
|
||||
_ma_set_share_data_file_length(share, position + block_size);
|
||||
if (_ma_set_share_data_file_length(info, position + block_size))
|
||||
res= 1;
|
||||
}
|
||||
}
|
||||
DBUG_RETURN(res);
|
||||
@@ -2194,7 +2195,10 @@ static my_bool write_full_pages(MARIA_HA *info,
|
||||
DBUG_ASSERT(block->used & BLOCKUSED_USED);
|
||||
}
|
||||
if (share->state.state.data_file_length < max_position)
|
||||
_ma_set_share_data_file_length(share, max_position);
|
||||
{
|
||||
if (_ma_set_share_data_file_length(info, max_position))
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
@@ -3215,7 +3219,10 @@ static my_bool write_block_record(MARIA_HA *info,
|
||||
/* Increase data file size, if extended */
|
||||
position= (my_off_t) head_block->page * block_size;
|
||||
if (share->state.state.data_file_length <= position)
|
||||
_ma_set_share_data_file_length(share, position + block_size);
|
||||
{
|
||||
if (_ma_set_share_data_file_length(info, position + block_size))
|
||||
goto disk_err;
|
||||
}
|
||||
}
|
||||
|
||||
if (share->now_transactional && (tmp_data_used || blob_full_pages_exists))
|
||||
|
@@ -2866,7 +2866,7 @@ int maria_repair(HA_CHECK *param, register MARIA_HA *info,
|
||||
fputs(" \r",stdout); fflush(stdout);
|
||||
}
|
||||
if (mysql_file_chsize(share->kfile.file,
|
||||
share->state.state.key_file_length, 0, MYF(0)))
|
||||
share->state.state.key_file_length, 0, MYF(0)) > 0)
|
||||
{
|
||||
_ma_check_print_warning(param,
|
||||
"Can't change size of indexfile, error: %d",
|
||||
@@ -4174,7 +4174,7 @@ int maria_repair_by_sort(HA_CHECK *param, register MARIA_HA *info,
|
||||
skr=share->base.reloc*share->base.min_pack_length;
|
||||
#endif
|
||||
if (skr != sort_info.filelength)
|
||||
if (mysql_file_chsize(info->dfile.file, skr, 0, MYF(0)))
|
||||
if (mysql_file_chsize(info->dfile.file, skr, 0, MYF(0)) > 0)
|
||||
_ma_check_print_warning(param,
|
||||
"Can't change size of datafile, error: %d",
|
||||
my_errno);
|
||||
@@ -4184,7 +4184,7 @@ int maria_repair_by_sort(HA_CHECK *param, register MARIA_HA *info,
|
||||
share->state.state.checksum=param->glob_crc;
|
||||
|
||||
if (mysql_file_chsize(share->kfile.file,
|
||||
share->state.state.key_file_length, 0, MYF(0)))
|
||||
share->state.state.key_file_length, 0, MYF(0)) > 0)
|
||||
_ma_check_print_warning(param,
|
||||
"Can't change size of indexfile, error: %d",
|
||||
my_errno);
|
||||
@@ -4723,7 +4723,7 @@ int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info,
|
||||
skr=share->base.reloc*share->base.min_pack_length;
|
||||
#endif
|
||||
if (skr != sort_info.filelength)
|
||||
if (mysql_file_chsize(info->dfile.file, skr, 0, MYF(0)))
|
||||
if (mysql_file_chsize(info->dfile.file, skr, 0, MYF(0)) > 0)
|
||||
_ma_check_print_warning(param,
|
||||
"Can't change size of datafile, error: %d",
|
||||
my_errno);
|
||||
@@ -4732,7 +4732,7 @@ int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info,
|
||||
share->state.state.checksum=param->glob_crc;
|
||||
|
||||
if (mysql_file_chsize(share->kfile.file,
|
||||
share->state.state.key_file_length, 0, MYF(0)))
|
||||
share->state.state.key_file_length, 0, MYF(0)) > 0)
|
||||
_ma_check_print_warning(param,
|
||||
"Can't change size of indexfile, error: %d",
|
||||
my_errno);
|
||||
|
@@ -14,7 +14,7 @@
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
|
||||
|
||||
/* close a isam-database */
|
||||
/* close an Aria table */
|
||||
/*
|
||||
TODO:
|
||||
We need to have a separate mutex on the closed file to allow other threads
|
||||
@@ -104,6 +104,10 @@ int maria_close(register MARIA_HA *info)
|
||||
*/
|
||||
DBUG_ASSERT(share->open_list == 0);
|
||||
|
||||
/* Ensure that we have stopped tracking of temporary files */
|
||||
DBUG_ASSERT(share->track_data.file_size == 0);
|
||||
DBUG_ASSERT(share->track_index.file_size == 0);
|
||||
|
||||
/* Flush everything */
|
||||
if (share->kfile.file >= 0)
|
||||
{
|
||||
|
@@ -1227,7 +1227,7 @@ int maria_create(const char *name, enum data_file_type datafile_type,
|
||||
/* Enlarge files */
|
||||
DBUG_PRINT("info", ("enlarge to keystart: %lu",
|
||||
(ulong) share.base.keystart));
|
||||
if (mysql_file_chsize(file,(ulong) share.base.keystart,0,MYF(0)))
|
||||
if (mysql_file_chsize(file,(ulong) share.base.keystart,0,MYF(0)) > 0)
|
||||
goto err;
|
||||
|
||||
if (!internal_table && sync_dir && mysql_file_sync(file, MYF(0)))
|
||||
@@ -1237,7 +1237,8 @@ int maria_create(const char *name, enum data_file_type datafile_type,
|
||||
{
|
||||
#ifdef USE_RELOC
|
||||
if (mysql_file_chsize(key_file_dfile, dfile,
|
||||
share.base.min_pack_length*ci->reloc_rows,0,MYF(0)))
|
||||
share.base.min_pack_length*ci->reloc_rows,0,MYF(0))
|
||||
> 0)
|
||||
goto err;
|
||||
#endif
|
||||
if (!internal_table && sync_dir && mysql_file_sync(dfile, MYF(0)))
|
||||
|
@@ -131,10 +131,17 @@ int maria_delete_all_rows(MARIA_HA *info)
|
||||
|
||||
if (_ma_flush_table_files(info, MARIA_FLUSH_DATA|MARIA_FLUSH_INDEX,
|
||||
FLUSH_IGNORE_CHANGED, FLUSH_IGNORE_CHANGED) ||
|
||||
mysql_file_chsize(info->dfile.file, 0, 0, MYF(MY_WME)) ||
|
||||
mysql_file_chsize(share->kfile.file, share->base.keystart, 0, MYF(MY_WME)))
|
||||
mysql_file_chsize(info->dfile.file, 0, 0, MYF(MY_WME)) > 0 ||
|
||||
mysql_file_chsize(share->kfile.file, share->base.keystart, 0,
|
||||
MYF(MY_WME)) > 0)
|
||||
goto err;
|
||||
|
||||
if (info->s->tracked)
|
||||
{
|
||||
_ma_update_tmp_file_size(&info->s->track_data, 0);
|
||||
_ma_update_tmp_file_size(&info->s->track_index, share->base.keystart);
|
||||
}
|
||||
|
||||
if (_ma_initialize_data_file(share, info->dfile.file))
|
||||
goto err;
|
||||
|
||||
|
@@ -445,6 +445,11 @@ static int _ma_find_writepos(MARIA_HA *info,
|
||||
info->state->data_file_length+= tmp;
|
||||
info->s->state.split++;
|
||||
info->update|=HA_STATE_WRITE_AT_END;
|
||||
if (info->s->tracked &&
|
||||
_ma_update_tmp_file_size(&info->s->track_data,
|
||||
MY_ALIGN(info->state->data_file_length,
|
||||
MARIA_TRACK_INCREMENT_SIZE)))
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
} /* _ma_find_writepos */
|
||||
@@ -886,6 +891,11 @@ static my_bool update_dynamic_record(MARIA_HA *info, MARIA_RECORD_POS filepos,
|
||||
info->state->data_file_length+= tmp;
|
||||
info->update|= HA_STATE_WRITE_AT_END | HA_STATE_EXTEND_BLOCK;
|
||||
length+=tmp;
|
||||
if (info->s->tracked &&
|
||||
_ma_update_tmp_file_size(&info->s->track_data,
|
||||
MY_ALIGN(info->state->data_file_length,
|
||||
MARIA_TRACK_INCREMENT_SIZE)))
|
||||
goto err;
|
||||
}
|
||||
else if (length < MARIA_MAX_BLOCK_LENGTH - MARIA_MIN_BLOCK_LENGTH)
|
||||
{
|
||||
|
@@ -16,6 +16,7 @@
|
||||
/* Return useful base information for an open table */
|
||||
|
||||
#include "maria_def.h"
|
||||
#include <mysys_err.h>
|
||||
#ifdef _WIN32
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
@@ -218,3 +219,23 @@ void _ma_set_fatal_error_with_share(MARIA_SHARE *share, int error)
|
||||
share->state.changed|= STATE_CRASHED_PRINTED;
|
||||
DBUG_ASSERT(!maria_assert_if_crashed_table);
|
||||
}
|
||||
|
||||
/*
|
||||
Check quotas for internal temporary files
|
||||
*/
|
||||
|
||||
int _ma_update_tmp_file_size(struct tmp_file_tracking *track,
|
||||
ulonglong file_size)
|
||||
{
|
||||
if (track->file_size != file_size)
|
||||
{
|
||||
track->file_size= file_size;
|
||||
if (update_tmp_file_size(track, 0))
|
||||
{
|
||||
my_errno= (HA_ERR_LOCAL_TMP_SPACE_FULL +
|
||||
(my_errno - EE_LOCAL_TMP_SPACE_FULL));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@@ -3454,7 +3454,7 @@ static my_bool translog_truncate_log(TRANSLOG_ADDRESS addr)
|
||||
page_rest= next_page_offset - LSN_OFFSET(addr);
|
||||
memset(page_buff, TRANSLOG_FILLER, page_rest);
|
||||
rc= ((fd= open_logfile_by_number_no_cache(LSN_FILE_NO(addr))) < 0 ||
|
||||
((mysql_file_chsize(fd, next_page_offset, TRANSLOG_FILLER, MYF(MY_WME)) ||
|
||||
((mysql_file_chsize(fd, next_page_offset, TRANSLOG_FILLER, MYF(MY_WME)) > 0 ||
|
||||
(page_rest && my_pwrite(fd, page_buff, page_rest, LSN_OFFSET(addr),
|
||||
log_write_flags)) ||
|
||||
mysql_file_sync(fd, MYF(MY_WME)))));
|
||||
|
@@ -996,6 +996,7 @@ MARIA_HA *maria_open(const char *name, int mode, uint open_flags,
|
||||
share->w_locks++; /* We don't have to update status */
|
||||
share->tot_locks++;
|
||||
}
|
||||
share->tracked= MY_TEST(open_flags & HA_OPEN_SIZE_TRACKING);
|
||||
|
||||
_ma_set_index_pagecache_callbacks(&share->kfile, share);
|
||||
share->this_process=(ulong) getpid();
|
||||
|
@@ -417,6 +417,13 @@ my_off_t _ma_new(register MARIA_HA *info, int level,
|
||||
DBUG_RETURN(HA_OFFSET_ERROR);
|
||||
}
|
||||
share->state.state.key_file_length+= block_size;
|
||||
if (info->s->tracked &&
|
||||
_ma_update_tmp_file_size(&share->track_index,
|
||||
share->state.state.key_file_length))
|
||||
{
|
||||
mysql_mutex_unlock(&share->intern_lock);
|
||||
DBUG_RETURN(HA_OFFSET_ERROR);
|
||||
}
|
||||
/* Following is for not transactional tables */
|
||||
info->state->key_file_length= share->state.state.key_file_length;
|
||||
mysql_mutex_unlock(&share->intern_lock);
|
||||
|
@@ -921,7 +921,7 @@ prototype_redo_exec_hook(REDO_CREATE_TABLE)
|
||||
}
|
||||
if (my_pwrite(kfile, kfile_header,
|
||||
kfile_size_before_extension, 0, MYF(MY_NABP|MY_WME)) ||
|
||||
mysql_file_chsize(kfile, keystart, 0, MYF(MY_WME)))
|
||||
mysql_file_chsize(kfile, keystart, 0, MYF(MY_WME)) > 0)
|
||||
{
|
||||
eprint(tracef, "Failed to write to index file");
|
||||
goto end;
|
||||
|
@@ -781,12 +781,15 @@ void maria_versioning(MARIA_HA *info, my_bool versioning)
|
||||
Only used by block records
|
||||
*/
|
||||
|
||||
void _ma_set_share_data_file_length(MARIA_SHARE *share, ulonglong new_length)
|
||||
int _ma_set_share_data_file_length(MARIA_HA *info, ulonglong new_length)
|
||||
{
|
||||
MARIA_SHARE *share= info->s;
|
||||
my_bool updated= 0;
|
||||
if (!share->internal_table)
|
||||
mysql_mutex_lock(&share->intern_lock);
|
||||
if (share->state.state.data_file_length < new_length)
|
||||
{
|
||||
updated= share->tracked;
|
||||
share->state.state.data_file_length= new_length;
|
||||
if (new_length >= share->base.max_data_file_length)
|
||||
{
|
||||
@@ -796,6 +799,17 @@ void _ma_set_share_data_file_length(MARIA_SHARE *share, ulonglong new_length)
|
||||
}
|
||||
if (!share->internal_table)
|
||||
mysql_mutex_unlock(&share->intern_lock);
|
||||
else
|
||||
{
|
||||
if (updated &&
|
||||
_ma_update_tmp_file_size(&share->track_data,
|
||||
share->state.state.data_file_length))
|
||||
{
|
||||
share->state.changed|= STATE_DATA_FILE_FULL;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -74,7 +74,7 @@ my_bool _ma_reset_update_flag(void *param, my_bool concurrent_insert);
|
||||
my_bool _ma_start_trans(void* param);
|
||||
my_bool _ma_check_status(void *param);
|
||||
void maria_versioning(MARIA_HA *info, my_bool versioning);
|
||||
void _ma_set_share_data_file_length(struct st_maria_share *share,
|
||||
int _ma_set_share_data_file_length(MARIA_HA *info,
|
||||
ulonglong new_length);
|
||||
void _ma_copy_nontrans_state_information(MARIA_HA *info);
|
||||
my_bool _ma_trnman_end_trans_hook(TRN *trn, my_bool commit,
|
||||
|
@@ -45,6 +45,13 @@ my_bool _ma_write_static_record(MARIA_HA *info, const uchar *record)
|
||||
my_errno=HA_ERR_RECORD_FILE_FULL;
|
||||
return(2);
|
||||
}
|
||||
if (info->s->tracked &&
|
||||
_ma_update_tmp_file_size(&info->s->track_data,
|
||||
MY_ALIGN(info->s->state.state.data_file_length+
|
||||
info->s->base.pack_reclength,
|
||||
MARIA_TRACK_INCREMENT_SIZE)))
|
||||
return(2);
|
||||
|
||||
if (info->opt_flag & WRITE_CACHE_USED)
|
||||
{ /* Cash in use */
|
||||
if (my_b_write(&info->rec_cache, record,
|
||||
|
@@ -21,6 +21,7 @@
|
||||
#include "trnman.h"
|
||||
#include "ma_key_recover.h"
|
||||
#include "ma_blockrec.h"
|
||||
#include "mysys_err.h"
|
||||
|
||||
/* Functions declared in this file */
|
||||
|
||||
@@ -386,6 +387,11 @@ err:
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (my_errno == HA_ERR_LOCAL_TMP_SPACE_FULL ||
|
||||
my_errno == HA_ERR_GLOBAL_TMP_SPACE_FULL)
|
||||
{
|
||||
filepos= HA_OFFSET_ERROR; /* Avoid write_record_abort() */
|
||||
}
|
||||
else
|
||||
fatal_error= 1;
|
||||
|
||||
|
@@ -72,6 +72,13 @@ C_MODE_START
|
||||
/* Minimal page cache when we only want to be able to scan a table */
|
||||
#define MARIA_MIN_PAGE_CACHE_SIZE (8192L*16L)
|
||||
|
||||
/*
|
||||
File align size (must be power of 2) used for pre-allocation of
|
||||
temporary table space. It is used to reduce the number of calls to
|
||||
update_tmp_file_size for static and dynamic rows.
|
||||
*/
|
||||
#define MARIA_TRACK_INCREMENT_SIZE 8192
|
||||
|
||||
/*
|
||||
In the following macros '_keyno_' is 0 .. keys-1.
|
||||
If there can be more keys than bits in the key_map, the highest bit
|
||||
@@ -784,6 +791,14 @@ typedef struct st_maria_share
|
||||
myf write_flag;
|
||||
enum data_file_type data_file_type;
|
||||
enum pagecache_page_type page_type; /* value depending transactional */
|
||||
|
||||
/*
|
||||
tracked will cause lost bytes (not aligned) but this is ok as it is always
|
||||
used with tmp_file_tracking if set
|
||||
*/
|
||||
my_bool tracked; /* Tracked table (always internal) */
|
||||
struct tmp_file_tracking track_data,track_index;
|
||||
|
||||
/**
|
||||
if Checkpoint looking at table; protected by close_lock or THR_LOCK_maria
|
||||
*/
|
||||
@@ -1785,6 +1800,8 @@ extern my_bool ma_killed_standalone(MARIA_HA *);
|
||||
extern uint _ma_file_callback_to_id(void *callback_data);
|
||||
extern uint _ma_write_flags_callback(void *callback_data, myf flags);
|
||||
extern void free_maria_share(MARIA_SHARE *share);
|
||||
extern int _ma_update_tmp_file_size(struct tmp_file_tracking *track,
|
||||
ulonglong file_size);
|
||||
|
||||
static inline void unmap_file(MARIA_HA *info __attribute__((unused)))
|
||||
{
|
||||
@@ -1803,6 +1820,7 @@ static inline void decrement_share_in_trans(MARIA_SHARE *share)
|
||||
else
|
||||
mysql_mutex_unlock(&share->intern_lock);
|
||||
}
|
||||
|
||||
C_MODE_END
|
||||
#endif
|
||||
|
||||
|
@@ -1651,7 +1651,7 @@ int mi_repair(HA_CHECK *param, register MI_INFO *info,
|
||||
{
|
||||
(void) fputs(" \r",stdout); (void) fflush(stdout);
|
||||
}
|
||||
if (mysql_file_chsize(share->kfile, info->state->key_file_length, 0, MYF(0)))
|
||||
if (mysql_file_chsize(share->kfile, info->state->key_file_length, 0, MYF(0)) > 0)
|
||||
{
|
||||
mi_check_print_warning(param,
|
||||
"Can't change size of indexfile, error: %d",
|
||||
@@ -2495,7 +2495,7 @@ int mi_repair_by_sort(HA_CHECK *param, register MI_INFO *info,
|
||||
skr=share->base.reloc*share->base.min_pack_length;
|
||||
#endif
|
||||
if (skr != sort_info.filelength)
|
||||
if (mysql_file_chsize(info->dfile, skr, 0, MYF(0)))
|
||||
if (mysql_file_chsize(info->dfile, skr, 0, MYF(0)) > 0)
|
||||
mi_check_print_warning(param,
|
||||
"Can't change size of datafile, error: %d",
|
||||
my_errno);
|
||||
@@ -2503,7 +2503,7 @@ int mi_repair_by_sort(HA_CHECK *param, register MI_INFO *info,
|
||||
if (param->testflag & T_CALC_CHECKSUM)
|
||||
info->state->checksum=param->glob_crc;
|
||||
|
||||
if (mysql_file_chsize(share->kfile, info->state->key_file_length, 0, MYF(0)))
|
||||
if (mysql_file_chsize(share->kfile, info->state->key_file_length, 0, MYF(0)) > 0)
|
||||
mi_check_print_warning(param,
|
||||
"Can't change size of indexfile, error: %d",
|
||||
my_errno);
|
||||
@@ -3033,7 +3033,7 @@ int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info,
|
||||
skr=share->base.reloc*share->base.min_pack_length;
|
||||
#endif
|
||||
if (skr != sort_info.filelength)
|
||||
if (mysql_file_chsize(info->dfile, skr, 0, MYF(0)))
|
||||
if (mysql_file_chsize(info->dfile, skr, 0, MYF(0)) > 0)
|
||||
mi_check_print_warning(param,
|
||||
"Can't change size of datafile, error: %d",
|
||||
my_errno);
|
||||
@@ -3041,7 +3041,7 @@ int mi_repair_parallel(HA_CHECK *param, register MI_INFO *info,
|
||||
if (param->testflag & T_CALC_CHECKSUM)
|
||||
info->state->checksum=param->glob_crc;
|
||||
|
||||
if (mysql_file_chsize(share->kfile, info->state->key_file_length, 0, MYF(0)))
|
||||
if (mysql_file_chsize(share->kfile, info->state->key_file_length, 0, MYF(0)) > 0)
|
||||
mi_check_print_warning(param,
|
||||
"Can't change size of indexfile, error: %d", my_errno);
|
||||
|
||||
|
@@ -814,14 +814,14 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
|
||||
|
||||
/* Enlarge files */
|
||||
DBUG_PRINT("info", ("enlarge to keystart: %lu", (ulong) share.base.keystart));
|
||||
if (mysql_file_chsize(file, (ulong) share.base.keystart, 0, MYF(0)))
|
||||
if (mysql_file_chsize(file, (ulong) share.base.keystart, 0, MYF(0)) > 0)
|
||||
goto err;
|
||||
|
||||
if (! (flags & HA_DONT_TOUCH_DATA))
|
||||
{
|
||||
#ifdef USE_RELOC
|
||||
if (mysql_file_chsize(dfile, share.base.min_pack_length*ci->reloc_rows,
|
||||
0, MYF(0)))
|
||||
0, MYF(0)) > 0)
|
||||
goto err;
|
||||
#endif
|
||||
errpos=2;
|
||||
|
@@ -59,8 +59,8 @@ int mi_delete_all_rows(MI_INFO *info)
|
||||
if (share->file_map)
|
||||
mi_munmap_file(info);
|
||||
#endif
|
||||
if (mysql_file_chsize(info->dfile, 0, 0, MYF(MY_WME)) ||
|
||||
mysql_file_chsize(share->kfile, share->base.keystart, 0, MYF(MY_WME)))
|
||||
if (mysql_file_chsize(info->dfile, 0, 0, MYF(MY_WME)> 0) ||
|
||||
mysql_file_chsize(share->kfile, share->base.keystart, 0, MYF(MY_WME)) > 0)
|
||||
goto err;
|
||||
|
||||
if (info->opt_flag & WRITE_CACHE_USED)
|
||||
|
@@ -51,7 +51,7 @@ Rdb_index_merge::~Rdb_index_merge() {
|
||||
if (m_merge_tmp_file_removal_delay > 0) {
|
||||
uint64 curr_size = m_merge_buf_size * m_merge_file.m_num_sort_buffers;
|
||||
for (uint i = 0; i < m_merge_file.m_num_sort_buffers; i++) {
|
||||
if (my_chsize(m_merge_file.m_fd, curr_size, 0, MYF(MY_WME))) {
|
||||
if (my_chsize(m_merge_file.m_fd, curr_size, 0, MYF(MY_WME)) > 0) {
|
||||
// NO_LINT_DEBUG
|
||||
sql_print_error("Error truncating file during fast index creation.");
|
||||
}
|
||||
|
Reference in New Issue
Block a user