mirror of
https://github.com/MariaDB/server.git
synced 2025-06-10 14:42:05 +03:00
The reason was that a couple of variables that hold number of rows that was used to calculate buffers was uint and caused an overflow. Fixed by changing variables that could hold number of rows from uint to ulong and also added a cast for this test. include/heap.h: Reorder to get better alignment. Changed variables that could hold number of rows from uint to ulong mysql-test/suite/heap/heap.result: Added test case mysql-test/suite/heap/heap.test: Added test case mysql-test/suite/plugins/t/server_audit.test: Added sleep as we want to have disconnect logged before we try a new connect storage/heap/ha_heap.cc: Changed variables that could hold number of rows from uint to ulong Limit number of rows to 4G (as most of the variables that holds rows are ulong anyway) reset records_changed when key_stat_version is changed to not cause increments for every row changed storage/heap/ha_heap.h: changed records_changed to ulong as this can get big storage/heap/hp_create.c: Changed variables that could hold number of rows from uint to ulong Added cast (fixed the original bug) storage/heap/hp_delete.c: Changed variables that could hold number of rows from uint to ulong storage/heap/hp_open.c: Removed not needed cast storage/heap/hp_write.c: Changed variables that could hold number of rows from uint to ulong support-files/compiler_warnings.supp: Removed extra : from supression
79 lines
2.4 KiB
Plaintext
79 lines
2.4 KiB
Plaintext
|
|
--source include/not_embedded.inc
|
|
|
|
if (!$SERVER_AUDIT_SO) {
|
|
skip No SERVER_AUDIT plugin;
|
|
}
|
|
|
|
install plugin server_audit soname 'server_audit';
|
|
|
|
show variables like 'server_audit%';
|
|
set global server_audit_file_path='server_audit.log';
|
|
set global server_audit_output_type=file;
|
|
set global server_audit_logging=on;
|
|
connect (con1,localhost,root,,mysql);
|
|
connection default;
|
|
disconnect con1;
|
|
--sleep 2
|
|
--replace_result $MASTER_MYSOCK MASTER_SOCKET $MASTER_MYPORT MASTER_PORT
|
|
--error ER_ACCESS_DENIED_ERROR
|
|
connect (con1,localhost,no_such_user,,mysql);
|
|
connection default;
|
|
--sleep 2
|
|
set global server_audit_incl_users='odin, dva, tri';
|
|
create table t1 (id int);
|
|
set global server_audit_incl_users='odin, root, dva, tri';
|
|
create table t2 (id int);
|
|
set global server_audit_excl_users='odin, dva, tri';
|
|
insert into t1 values (1), (2);
|
|
select * from t1;
|
|
set global server_audit_incl_users='odin, root, dva, tri';
|
|
insert into t2 values (1), (2);
|
|
select * from t2;
|
|
alter table t1 rename renamed_t1;
|
|
set global server_audit_events='connect,query';
|
|
insert into t2 values (1), (2);
|
|
select * from t2;
|
|
--error ER_NO_SUCH_TABLE
|
|
select * from t_doesnt_exist;
|
|
--error 1064
|
|
syntax_error_query;
|
|
drop table renamed_t1, t2;
|
|
show variables like 'server_audit%';
|
|
set global server_audit_mode=1;
|
|
set global server_audit_events='';
|
|
create database sa_db;
|
|
connect (con1,localhost,root,,test);
|
|
connection con1;
|
|
create table t1 (id2 int);
|
|
insert into t1 values (1), (2);
|
|
select * from t1;
|
|
drop table t1;
|
|
use sa_db;
|
|
create table sa_t1(id int);
|
|
insert into sa_t1 values (1), (2);
|
|
drop table sa_t1;
|
|
drop database sa_db;
|
|
connection default;
|
|
disconnect con1;
|
|
|
|
--sleep 2
|
|
set global server_audit_file_path='.';
|
|
--replace_regex /\.[\\\/]/HOME_DIR\//
|
|
show status like 'server_audit_current_log';
|
|
set global server_audit_file_path='';
|
|
show status like 'server_audit_current_log';
|
|
set global server_audit_file_path=' ';
|
|
show status like 'server_audit_current_log';
|
|
set global server_audit_file_path='nonexisting_dir/';
|
|
show status like 'server_audit_current_log';
|
|
show variables like 'server_audit%';
|
|
uninstall plugin server_audit;
|
|
|
|
let $MYSQLD_DATADIR= `SELECT @@datadir`;
|
|
# replace the timestamp and the hostname with constant values
|
|
--replace_regex /[0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\,[^,]*\,/TIME,HOSTNAME,/ /\,[1-9][0-9]*\,/,1,/ /\,[1-9][0-9]*/,ID/
|
|
cat_file $MYSQLD_DATADIR/server_audit.log;
|
|
remove_file $MYSQLD_DATADIR/server_audit.log;
|
|
|