mirror of
https://github.com/MariaDB/server.git
synced 2025-02-01 19:41:47 +01:00
3320c165cf
into pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-mtr BitKeeper/etc/ignore: auto-union BitKeeper/deleted/.del-rpl_row_charset.test: Auto merged BitKeeper/deleted/.del-rpl_row_charset_innodb.test: Auto merged CMakeLists.txt: Auto merged client/mysqltest.c: Auto merged configure.in: Auto merged mysql-test/extra/binlog_tests/blackhole.test: Auto merged mysql-test/extra/binlog_tests/mix_innodb_myisam_side_effects.test: Auto merged mysql-test/include/mix1.inc: Auto merged mysql-test/r/ctype_big5.result: Auto merged mysql-test/r/gis.result: Auto merged mysql-test/r/mysqlbinlog.result: Auto merged mysql-test/r/query_cache.result: Auto merged mysql-test/r/sp.result: Auto merged mysql-test/r/system_mysql_db.result: Auto merged mysql-test/r/trigger.result: Auto merged mysql-test/r/type_blob.result: Auto merged mysql-test/r/view.result: Auto merged mysql-test/r/warnings.result: Auto merged mysql-test/suite/federated/federated.result: Auto merged mysql-test/suite/federated/federated.test: Auto merged mysql-test/suite/ndb_team/r/ndb_dd_backuprestore.result: Auto merged mysql-test/suite/ndb_team/r/rpl_ndb_dd_advance.result: Auto merged mysql-test/suite/ndb_team/t/rpl_ndb_dd_advance.test: Auto merged mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result: Auto merged mysql-test/suite/rpl/r/rpl_row_log_innodb.result: Auto merged mysql-test/suite/rpl/r/rpl_timezone.result: Auto merged mysql-test/suite/rpl/t/rpl_load_from_master.test: Auto merged mysql-test/suite/rpl/t/rpl_rotate_logs.test: Auto merged mysql-test/suite/rpl/t/rpl_trigger.test: Auto merged mysql-test/t/csv.test: Auto merged mysql-test/t/ctype_big5.test: Auto merged mysql-test/t/gis.test: Auto merged mysql-test/t/innodb.test: Auto merged mysql-test/t/mysqldump.test: Auto merged mysql-test/t/partition.test: Auto merged mysql-test/t/query_cache.test: Auto merged mysql-test/t/show_check.test: Auto merged mysql-test/t/sp.test: Auto merged mysql-test/t/system_mysql_db_fix50117.test: Auto merged mysql-test/t/trigger.test: Auto merged mysql-test/t/trigger_notembedded.test: Auto merged mysql-test/t/type_blob.test: Auto merged mysql-test/t/view.test: Auto merged mysql-test/t/warnings.test: Auto merged sql/ha_ndbcluster.cc: Auto merged mysql-test/Makefile.am: SCCS merged mysql-test/mysql-test-run.pl: Use local version of mtr.pl mysql-test/lib/mtr_cases.pm: Use local mtr_cases.pm mysql-test/suite/rpl/t/disabled.def: Use remote disabled file mysql-test/t/disabled.def: Use remote disabled file sql/ha_ndbcluster_binlog.cc: Use remote mysql-test/extra/rpl_tests/rpl_charset.test: Manual merge mysql-test/lib/mtr_report.pm: Manual merge mysql-test/suite/binlog/r/binlog_killed_simulate.result: Manual merge mysql-test/suite/binlog/r/binlog_multi_engine.result: Manual merge mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result: Manual merge mysql-test/suite/binlog/r/binlog_stm_blackhole.result: Manual merge mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result: Manual merge mysql-test/suite/binlog/t/binlog_killed.test: Manual merge mysql-test/suite/binlog/t/binlog_killed_simulate.test: Manual merge mysql-test/suite/binlog/t/binlog_row_mix_innodb_myisam.test: Manual merge mysql-test/suite/binlog/t/binlog_stm_mix_innodb_myisam.test: Manual merge mysql-test/suite/ndb/r/ndb_binlog_format.result: Manual merge mysql-test/suite/ndb/r/ndb_restore.result: Manual merge mysql-test/suite/ndb/t/ndb_restore.test: Manual merge mysql-test/suite/rpl/include/rpl_mixed_dml.inc: Manual merge mysql-test/suite/rpl/r/rpl_stm_log.result: Manual merge mysql-test/suite/rpl/t/rpl_row_sp005.test: Manual merge mysql-test/t/log_state.test: Manual merge mysql-test/t/mysqlbinlog.test: Manual merge mysql-test/t/mysqlbinlog2.test: Manual merge mysql-test/t/upgrade.test: Manual merge
246 lines
6.8 KiB
Text
246 lines
6.8 KiB
Text
-- source include/not_embedded.inc
|
|
--source include/have_csv.inc
|
|
|
|
--disable_ps_protocol
|
|
set global general_log= OFF;
|
|
truncate table mysql.general_log;
|
|
truncate table mysql.slow_log;
|
|
show global variables
|
|
where Variable_name = 'log' or Variable_name = 'log_slow_queries' or
|
|
Variable_name = 'general_log' or Variable_name = 'slow_query_log';
|
|
flush logs;
|
|
set global general_log= ON;
|
|
create table t1(f1 int);
|
|
--replace_column 1 TIMESTAMP 2 USER_HOST 3 #
|
|
select * from mysql.general_log;
|
|
set global general_log= OFF;
|
|
drop table t1;
|
|
--replace_column 1 TIMESTAMP 2 USER_HOST 3 #
|
|
select * from mysql.general_log;
|
|
set global general_log= ON;
|
|
flush logs;
|
|
show global variables
|
|
where Variable_name = 'log' or Variable_name = 'log_slow_queries' or
|
|
Variable_name = 'general_log' or Variable_name = 'slow_query_log';
|
|
|
|
connect (con1,localhost,root,,);
|
|
connection con1;
|
|
set session long_query_time=1;
|
|
select sleep(2);
|
|
--replace_column 1 TIMESTAMP 2 USER_HOST 3 QUERY_TIME
|
|
select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
|
|
connection default;
|
|
|
|
set global slow_query_log= ON;
|
|
connection con1;
|
|
set session long_query_time=1;
|
|
select sleep(2);
|
|
--replace_column 1 TIMESTAMP 2 USER_HOST 3 QUERY_TIME
|
|
select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
|
|
connection default;
|
|
show global variables
|
|
where Variable_name = 'log' or Variable_name = 'log_slow_queries' or
|
|
Variable_name = 'general_log' or Variable_name = 'slow_query_log';
|
|
|
|
set global general_log= ON;
|
|
set global general_log= OFF;
|
|
set global general_log= OFF;
|
|
set global slow_query_log= ON;
|
|
set global slow_query_log= OFF;
|
|
set global slow_query_log= OFF;
|
|
|
|
set global general_log= ON;
|
|
truncate table mysql.general_log;
|
|
create table t1(f1 int);
|
|
drop table t1;
|
|
--replace_column 1 TIMESTAMP 2 USER_HOST 3 #
|
|
select * from mysql.general_log;
|
|
set global general_log= OFF;
|
|
truncate table mysql.general_log;
|
|
--replace_column 1 TIMESTAMP 2 USER_HOST 3 #
|
|
select * from mysql.general_log;
|
|
set global general_log= ON;
|
|
show global variables
|
|
where Variable_name = 'log' or Variable_name = 'log_slow_queries' or
|
|
Variable_name = 'general_log' or Variable_name = 'slow_query_log';
|
|
|
|
--replace_column 2 #
|
|
show variables like 'general_log_file';
|
|
--replace_column 2 #
|
|
show variables like 'slow_query_log_file';
|
|
show variables like 'log_output';
|
|
|
|
# Can't set general_log_file to a non existing file
|
|
--error 1231
|
|
set global general_log_file='/not exiting path/log.master';
|
|
|
|
# Can't set general_log_file to a directory
|
|
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
|
--error 1231
|
|
eval set global general_log_file='$MYSQLTEST_VARDIR';
|
|
|
|
# Can't set general_log_file to empty string
|
|
--error 1231
|
|
set global general_log_file='';
|
|
|
|
--replace_column 2 #
|
|
show variables like 'general_log_file';
|
|
set global general_log= OFF;
|
|
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
|
|
eval set global general_log_file='$MYSQLTEST_VARDIR/tmp/log.master';
|
|
set global general_log= ON;
|
|
create table t1(f1 int);
|
|
drop table t1;
|
|
set global general_log= OFF;
|
|
set global general_log_file=default;
|
|
set global general_log= ON;
|
|
create table t1(f1 int);
|
|
drop table t1;
|
|
--replace_column 2 #
|
|
show variables like 'general_log_file';
|
|
--replace_column 2 #
|
|
show variables like 'slow_query_log_file';
|
|
|
|
set global general_log= default;
|
|
set global slow_query_log= default;
|
|
set global general_log_file= default;
|
|
set global slow_query_log_file= default;
|
|
show variables like 'general_log';
|
|
show variables like 'slow_query_log';
|
|
set global general_log=ON;
|
|
set global log_output=default;
|
|
show variables like 'log_output';
|
|
set global general_log=OFF;
|
|
set global log_output=FILE;
|
|
truncate table mysql.general_log;
|
|
show variables like 'log_output';
|
|
set global general_log=ON;
|
|
create table t1(f1 int);
|
|
--replace_column 1 TIMESTAMP 2 USER_HOST 3 #
|
|
select * from mysql.general_log;
|
|
set global general_log=OFF;
|
|
set global log_output="FILE,TABLE";
|
|
show variables like 'log_output';
|
|
set global general_log=ON;
|
|
drop table t1;
|
|
--replace_column 1 TIMESTAMP 2 USER_HOST 3 #
|
|
select * from mysql.general_log;
|
|
|
|
#
|
|
# Bug#29129 (Resetting general_log while the GLOBAL READ LOCK is set causes
|
|
# a deadlock)
|
|
|
|
# save state
|
|
|
|
SET @old_general_log_state = @@global.general_log;
|
|
SET @old_slow_log_state = @@global.slow_query_log;
|
|
|
|
# Test ON->OFF transition under a GLOBAL READ LOCK
|
|
|
|
SET GLOBAL general_log = ON;
|
|
SET GLOBAL slow_query_log = ON;
|
|
|
|
FLUSH TABLES WITH READ LOCK;
|
|
|
|
SET GLOBAL general_log = OFF;
|
|
SET GLOBAL slow_query_log = OFF;
|
|
|
|
UNLOCK TABLES;
|
|
|
|
# Test OFF->ON transition under a GLOBAL READ LOCK
|
|
|
|
FLUSH TABLES WITH READ LOCK;
|
|
|
|
SET GLOBAL general_log = ON;
|
|
SET GLOBAL slow_query_log = ON;
|
|
|
|
UNLOCK TABLES;
|
|
|
|
# Test ON->OFF transition under a GLOBAL READ_ONLY
|
|
|
|
SET GLOBAL READ_ONLY = ON;
|
|
|
|
SET GLOBAL general_log = OFF;
|
|
SET GLOBAL slow_query_log = OFF;
|
|
|
|
SET GLOBAL READ_ONLY = OFF;
|
|
|
|
# Test OFF->ON transition under a GLOBAL READ_ONLY
|
|
|
|
SET GLOBAL READ_ONLY = ON;
|
|
|
|
SET GLOBAL general_log = ON;
|
|
SET GLOBAL slow_query_log = ON;
|
|
|
|
SET GLOBAL READ_ONLY = OFF;
|
|
|
|
# Restore state
|
|
|
|
SET GLOBAL general_log = @old_general_log_state;
|
|
SET GLOBAL slow_query_log = @old_slow_log_state;
|
|
|
|
#
|
|
# Bug #29131: SHOW VARIABLES reports variable 'log' but SET doesn't recognize it
|
|
#
|
|
|
|
SET @old_general_log_state = @@global.general_log;
|
|
SET @old_slow_log_state = @@global.slow_query_log;
|
|
|
|
SHOW VARIABLES LIKE 'general_log';
|
|
SHOW VARIABLES LIKE 'log';
|
|
SELECT @@general_log, @@log;
|
|
SET GLOBAL log = 0;
|
|
SHOW VARIABLES LIKE 'general_log';
|
|
SHOW VARIABLES LIKE 'log';
|
|
SELECT @@general_log, @@log;
|
|
SET GLOBAL general_log = 1;
|
|
SHOW VARIABLES LIKE 'general_log';
|
|
SHOW VARIABLES LIKE 'log';
|
|
SELECT @@general_log, @@log;
|
|
|
|
SHOW VARIABLES LIKE 'slow_query_log';
|
|
SHOW VARIABLES LIKE 'log_slow_queries';
|
|
SELECT @@slow_query_log, @@log_slow_queries;
|
|
SET GLOBAL log_slow_queries = 0;
|
|
SHOW VARIABLES LIKE 'slow_query_log';
|
|
SHOW VARIABLES LIKE 'log_slow_queries';
|
|
SELECT @@slow_query_log, @@log_slow_queries;
|
|
SET GLOBAL slow_query_log = 1;
|
|
SHOW VARIABLES LIKE 'slow_query_log';
|
|
SHOW VARIABLES LIKE 'log_slow_queries';
|
|
SELECT @@slow_query_log, @@log_slow_queries;
|
|
|
|
SET GLOBAL general_log = @old_general_log_state;
|
|
SET GLOBAL slow_query_log = @old_slow_log_state;
|
|
|
|
#
|
|
# Bug #31604: server crash when setting slow_query_log_file/general_log_file
|
|
#
|
|
set @old_general_log_file= @@global.general_log_file;
|
|
set @old_slow_query_log_file= @@global.slow_query_log_file;
|
|
|
|
--error 1231
|
|
set global general_log_file= concat('/not exiting path/log.maste', 'r');
|
|
--error 1231
|
|
set global general_log_file= NULL;
|
|
--error 1231
|
|
set global slow_query_log_file= concat('/not exiting path/log.maste', 'r');
|
|
--error 1231
|
|
set global slow_query_log_file= NULL;
|
|
|
|
set global general_log_file= @old_general_log_file;
|
|
set global slow_query_log_file= @old_slow_query_log_file;
|
|
|
|
--echo End of 5.1 tests
|
|
|
|
--enable_ps_protocol
|
|
|
|
#
|
|
# Cleanup (must be done last to avoid delayed 'Quit' message in general log)
|
|
#
|
|
disconnect con1;
|
|
|
|
# Remove the log files that was created in the "default location"
|
|
# i.e var/run
|
|
--remove_file $MYSQLTEST_VARDIR/run/mysqld.log
|
|
--remove_file $MYSQLTEST_VARDIR/run/mysqld-slow.log
|