Commit e3efc3d8 authored by Sergei Golubchik's avatar Sergei Golubchik

fixes for sys_vars and pbxt suites

parent 29d01b0a
...@@ -31,6 +31,7 @@ MYSQL_ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc sql_string.cc ...@@ -31,6 +31,7 @@ MYSQL_ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc sql_string.cc
TARGET_LINK_LIBRARIES(mysql mysqlclient) TARGET_LINK_LIBRARIES(mysql mysqlclient)
IF(UNIX) IF(UNIX)
TARGET_LINK_LIBRARIES(mysql ${READLINE_LIBRARY}) TARGET_LINK_LIBRARIES(mysql ${READLINE_LIBRARY})
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -rdynamic")
ENDIF(UNIX) ENDIF(UNIX)
MYSQL_ADD_EXECUTABLE(mysqltest mysqltest.cc COMPONENT Test) MYSQL_ADD_EXECUTABLE(mysqltest mysqltest.cc COMPONENT Test)
......
...@@ -266,13 +266,10 @@ The following options may be given as the first argument: ...@@ -266,13 +266,10 @@ The following options may be given as the first argument:
use --general-log/--general-log-file instead). use --general-log/--general-log-file instead).
--log-basename=name Basename for all log files and the .pid file. This sets --log-basename=name Basename for all log files and the .pid file. This sets
all log file names at once (in 'datadir') and is normally all log file names at once (in 'datadir') and is normally
the only option you need for specifying log files. This the only option you need for specifying log files. Sets
is especially recommend to be set if you are using names for --log-bin, --log-bin-index, --relay-log,
replication as it ensures that your log file names are
not depending on your host name. Sets names for
--log-bin, --log-bin-index, --relay-log,
--relay-log-index, --general-log-file, --relay-log-index, --general-log-file,
--log-slow-query-log-file, --log-error-file and --log-slow-query-log-file, --log-error-file, and
--pid-file --pid-file
--log-bin[=name] Log update queries in binary format. Optional argument --log-bin[=name] Log update queries in binary format. Optional argument
should be name for binary log. If not given should be name for binary log. If not given
......
...@@ -138,17 +138,6 @@ unlock tables; ...@@ -138,17 +138,6 @@ unlock tables;
unlock tables; unlock tables;
drop table t1,t2; drop table t1,t2;
End of 5.0 tests End of 5.0 tests
create table t1 (i int);
lock table t1 read;
update t1 set i= 10;
select * from t1;
Timeout in wait_condition.inc for select count(*) = 1 from information_schema.processlist
where state = "Table Lock" and info = "select * from t1"
kill query ID;
i
ERROR 70100: Query execution was interrupted
unlock tables;
drop table t1;
drop table if exists t1; drop table if exists t1;
create table t1 (i int); create table t1 (i int);
connection: default connection: default
......
...@@ -416,41 +416,6 @@ drop table t1,t2; ...@@ -416,41 +416,6 @@ drop table t1,t2;
--echo End of 5.0 tests --echo End of 5.0 tests
#
# Bug#21281 Pending write lock is incorrectly removed when its
# statement being KILLed
#
create table t1 (i int);
connection locker;
lock table t1 read;
connection writer;
send
update t1 set i= 10;
connection reader;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = "Table Lock" and info = "update t1 set i= 10";
--source include/wait_condition.inc
send
select * from t1;
connection default;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = "Table Lock" and info = "select * from t1";
--source include/wait_condition.inc
let $ID= `select id from information_schema.processlist where state = "Table Lock" and info = "update t1 set i= 10"`;
--replace_result $ID ID
eval kill query $ID;
connection reader;
--reap
connection writer;
--error ER_QUERY_INTERRUPTED
--reap
connection locker;
unlock tables;
connection default;
drop table t1;
# Disconnect sessions used in many subtests above # Disconnect sessions used in many subtests above
disconnect locker; disconnect locker;
disconnect reader; disconnect reader;
......
...@@ -5,22 +5,11 @@ insert into t2 select variable_name from information_schema.global_variables; ...@@ -5,22 +5,11 @@ insert into t2 select variable_name from information_schema.global_variables;
insert into t2 select variable_name from information_schema.session_variables; insert into t2 select variable_name from information_schema.session_variables;
delete from t2 where variable_name='innodb_change_buffering_debug'; delete from t2 where variable_name='innodb_change_buffering_debug';
update t2 set variable_name= replace(variable_name, "PERFORMANCE_SCHEMA_", "PFS_"); update t2 set variable_name= replace(variable_name, "PERFORMANCE_SCHEMA_", "PFS_");
select distinct variable_name as `There should be *no* long test name listed below:` from t2 select distinct variable_name as `there should be *no* long test name listed below:` from t2
where length(variable_name) > 50; where length(variable_name) > 50;
There should be *no* long test name listed below: there should be *no* long test name listed below:
select distinct variable_name as `There should be *no* variables listed below:` from t2 select distinct variable_name as `there should be *no* variables listed below:` from t2
left join t1 on variable_name=test_name where test_name is null; left join t1 on variable_name=test_name where test_name is null;
There should be *no* variables listed below: there should be *no* variables listed below:
BINLOG_ANNOTATE_ROWS_EVENTS
BINLOG_DBUG_FSYNC_SLEEP
BINLOG_OPTIMIZE_THREAD_SCHEDULING
IN_TRANSACTION
JOIN_BUFFER_SPACE_LIMIT
LOG_BASENAME
MYISAM_BLOCK_SIZE
PROGRESS_REPORT_TIME
QUERY_CACHE_STRIP_COMMENTS
REPLICATE_ANNOTATE_ROWS_EVENTS
THREAD_ALARM
drop table t1; drop table t1;
drop table t2; drop table t2;
SET @start_global_value = @@global.binlog_annotate_rows_events;
select @@global.binlog_annotate_rows_events;
@@global.binlog_annotate_rows_events
0
select @@session.binlog_annotate_rows_events;
@@session.binlog_annotate_rows_events
0
show global variables like 'binlog_annotate_rows_events';
Variable_name Value
binlog_annotate_rows_events OFF
show session variables like 'binlog_annotate_rows_events';
Variable_name Value
binlog_annotate_rows_events OFF
select * from information_schema.global_variables where variable_name='binlog_annotate_rows_events';
VARIABLE_NAME VARIABLE_VALUE
BINLOG_ANNOTATE_ROWS_EVENTS OFF
select * from information_schema.session_variables where variable_name='binlog_annotate_rows_events';
VARIABLE_NAME VARIABLE_VALUE
BINLOG_ANNOTATE_ROWS_EVENTS OFF
set global binlog_annotate_rows_events=ON;
select @@global.binlog_annotate_rows_events;
@@global.binlog_annotate_rows_events
1
set global binlog_annotate_rows_events=OFF;
select @@global.binlog_annotate_rows_events;
@@global.binlog_annotate_rows_events
0
set global binlog_annotate_rows_events=1;
select @@global.binlog_annotate_rows_events;
@@global.binlog_annotate_rows_events
1
set session binlog_annotate_rows_events=ON;
select @@session.binlog_annotate_rows_events;
@@session.binlog_annotate_rows_events
1
set session binlog_annotate_rows_events=OFF;
select @@session.binlog_annotate_rows_events;
@@session.binlog_annotate_rows_events
0
set session binlog_annotate_rows_events=1;
select @@session.binlog_annotate_rows_events;
@@session.binlog_annotate_rows_events
1
set global binlog_annotate_rows_events=1.1;
ERROR 42000: Incorrect argument type to variable 'binlog_annotate_rows_events'
set session binlog_annotate_rows_events=1e1;
ERROR 42000: Incorrect argument type to variable 'binlog_annotate_rows_events'
set session binlog_annotate_rows_events="foo";
ERROR 42000: Variable 'binlog_annotate_rows_events' can't be set to the value of 'foo'
SET @@global.binlog_annotate_rows_events = @start_global_value;
select @@global.binlog_optimize_thread_scheduling;
@@global.binlog_optimize_thread_scheduling
1
select @@session.binlog_optimize_thread_scheduling;
ERROR HY000: Variable 'binlog_optimize_thread_scheduling' is a GLOBAL variable
show global variables like 'binlog_optimize_thread_scheduling';
Variable_name Value
binlog_optimize_thread_scheduling ON
show session variables like 'binlog_optimize_thread_scheduling';
Variable_name Value
binlog_optimize_thread_scheduling ON
select * from information_schema.global_variables where variable_name='binlog_optimize_thread_scheduling';
VARIABLE_NAME VARIABLE_VALUE
BINLOG_OPTIMIZE_THREAD_SCHEDULING ON
select * from information_schema.session_variables where variable_name='binlog_optimize_thread_scheduling';
VARIABLE_NAME VARIABLE_VALUE
BINLOG_OPTIMIZE_THREAD_SCHEDULING ON
set global binlog_optimize_thread_scheduling=1;
ERROR HY000: Variable 'binlog_optimize_thread_scheduling' is a read only variable
set session binlog_optimize_thread_scheduling=1;
ERROR HY000: Variable 'binlog_optimize_thread_scheduling' is a read only variable
select @@global.in_transaction;
ERROR HY000: Variable 'in_transaction' is a SESSION variable
select @@session.in_transaction;
@@session.in_transaction
0
show global variables like 'in_transaction';
Variable_name Value
show session variables like 'in_transaction';
Variable_name Value
in_transaction 0
select * from information_schema.global_variables where variable_name='in_transaction';
VARIABLE_NAME VARIABLE_VALUE
select * from information_schema.session_variables where variable_name='in_transaction';
VARIABLE_NAME VARIABLE_VALUE
IN_TRANSACTION 0
set global in_transaction=1;
ERROR HY000: Variable 'in_transaction' is a read only variable
set session in_transaction=1;
ERROR HY000: Variable 'in_transaction' is a read only variable
SET @start_global_value = @@global.join_buffer_space_limit;
select @@global.join_buffer_space_limit;
@@global.join_buffer_space_limit
2097152
select @@session.join_buffer_space_limit;
@@session.join_buffer_space_limit
2097152
show global variables like 'join_buffer_space_limit';
Variable_name Value
join_buffer_space_limit 2097152
show session variables like 'join_buffer_space_limit';
Variable_name Value
join_buffer_space_limit 2097152
select * from information_schema.global_variables where variable_name='join_buffer_space_limit';
VARIABLE_NAME VARIABLE_VALUE
JOIN_BUFFER_SPACE_LIMIT 2097152
select * from information_schema.session_variables where variable_name='join_buffer_space_limit';
VARIABLE_NAME VARIABLE_VALUE
JOIN_BUFFER_SPACE_LIMIT 2097152
set global join_buffer_space_limit=10;
Warnings:
Warning 1292 Truncated incorrect join_buffer_space_limit value: '10'
select @@global.join_buffer_space_limit;
@@global.join_buffer_space_limit
2048
set session join_buffer_space_limit=10;
Warnings:
Warning 1292 Truncated incorrect join_buffer_space_limit value: '10'
select @@session.join_buffer_space_limit;
@@session.join_buffer_space_limit
2048
set global join_buffer_space_limit=1.1;
ERROR 42000: Incorrect argument type to variable 'join_buffer_space_limit'
set session join_buffer_space_limit=1e1;
ERROR 42000: Incorrect argument type to variable 'join_buffer_space_limit'
set global join_buffer_space_limit="foo";
ERROR 42000: Incorrect argument type to variable 'join_buffer_space_limit'
set global join_buffer_space_limit=0;
Warnings:
Warning 1292 Truncated incorrect join_buffer_space_limit value: '0'
select @@global.join_buffer_space_limit;
@@global.join_buffer_space_limit
2048
set global join_buffer_space_limit=4095;
Warnings:
Warning 1292 Truncated incorrect join_buffer_space_limit value: '4095'
select @@global.join_buffer_space_limit;
@@global.join_buffer_space_limit
2048
set session join_buffer_space_limit=cast(-1 as unsigned int);
Warnings:
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
Warning 1292 Truncated incorrect join_buffer_space_limit value: '18446744073709551615'
select @@session.join_buffer_space_limit;
@@session.join_buffer_space_limit
18446744073709549568
SET @@global.join_buffer_space_limit = @start_global_value;
select @@global.myisam_block_size;
@@global.myisam_block_size
1024
select @@session.myisam_block_size;
ERROR HY000: Variable 'myisam_block_size' is a GLOBAL variable
show global variables like 'myisam_block_size';
Variable_name Value
myisam_block_size 1024
show session variables like 'myisam_block_size';
Variable_name Value
myisam_block_size 1024
select * from information_schema.global_variables where variable_name='myisam_block_size';
VARIABLE_NAME VARIABLE_VALUE
MYISAM_BLOCK_SIZE 1024
select * from information_schema.session_variables where variable_name='myisam_block_size';
VARIABLE_NAME VARIABLE_VALUE
MYISAM_BLOCK_SIZE 1024
set global myisam_block_size=1;
ERROR HY000: Variable 'myisam_block_size' is a read only variable
set session myisam_block_size=1;
ERROR HY000: Variable 'myisam_block_size' is a read only variable
SET @start_global_value = @@global.progress_report_time;
select @@global.progress_report_time;
@@global.progress_report_time
56
select @@session.progress_report_time;
@@session.progress_report_time
56
show global variables like 'progress_report_time';
Variable_name Value
progress_report_time 56
show session variables like 'progress_report_time';
Variable_name Value
progress_report_time 56
select * from information_schema.global_variables where variable_name='progress_report_time';
VARIABLE_NAME VARIABLE_VALUE
PROGRESS_REPORT_TIME 56
select * from information_schema.session_variables where variable_name='progress_report_time';
VARIABLE_NAME VARIABLE_VALUE
PROGRESS_REPORT_TIME 56
set global progress_report_time=10;
select @@global.progress_report_time;
@@global.progress_report_time
10
set session progress_report_time=10;
select @@session.progress_report_time;
@@session.progress_report_time
10
set global progress_report_time=1.1;
ERROR 42000: Incorrect argument type to variable 'progress_report_time'
set session progress_report_time=1e1;
ERROR 42000: Incorrect argument type to variable 'progress_report_time'
set global progress_report_time="foo";
ERROR 42000: Incorrect argument type to variable 'progress_report_time'
set global progress_report_time=0;
select @@global.progress_report_time;
@@global.progress_report_time
0
set session progress_report_time=cast(-1 as unsigned int);
Warnings:
Warning 1105 Cast to unsigned converted negative integer to it's positive complement
select @@session.progress_report_time;
@@session.progress_report_time
18446744073709551615
SET @@global.progress_report_time = @start_global_value;
SET @start_global_value = @@global.query_cache_strip_comments;
select @@global.query_cache_strip_comments;
@@global.query_cache_strip_comments
0
select @@session.query_cache_strip_comments;
ERROR HY000: Variable 'query_cache_strip_comments' is a GLOBAL variable
show global variables like 'query_cache_strip_comments';
Variable_name Value
query_cache_strip_comments OFF
show session variables like 'query_cache_strip_comments';
Variable_name Value
query_cache_strip_comments OFF
select * from information_schema.global_variables where variable_name='query_cache_strip_comments';
VARIABLE_NAME VARIABLE_VALUE
QUERY_CACHE_STRIP_COMMENTS OFF
select * from information_schema.session_variables where variable_name='query_cache_strip_comments';
VARIABLE_NAME VARIABLE_VALUE
QUERY_CACHE_STRIP_COMMENTS OFF
set global query_cache_strip_comments=ON;
select @@global.query_cache_strip_comments;
@@global.query_cache_strip_comments
1
set global query_cache_strip_comments=OFF;
select @@global.query_cache_strip_comments;
@@global.query_cache_strip_comments
0
set global query_cache_strip_comments=1;
select @@global.query_cache_strip_comments;
@@global.query_cache_strip_comments
1
set session query_cache_strip_comments=1;
ERROR HY000: Variable 'query_cache_strip_comments' is a GLOBAL variable and should be set with SET GLOBAL
set global query_cache_strip_comments=1.1;
ERROR 42000: Incorrect argument type to variable 'query_cache_strip_comments'
set global query_cache_strip_comments=1e1;
ERROR 42000: Incorrect argument type to variable 'query_cache_strip_comments'
set global query_cache_strip_comments="foo";
ERROR 42000: Variable 'query_cache_strip_comments' can't be set to the value of 'foo'
SET @@global.query_cache_strip_comments = @start_global_value;
select @@global.replicate_annotate_rows_events;
@@global.replicate_annotate_rows_events
0
select @@session.replicate_annotate_rows_events;
ERROR HY000: Variable 'replicate_annotate_rows_events' is a GLOBAL variable
show global variables like 'replicate_annotate_rows_events';
Variable_name Value
replicate_annotate_rows_events OFF
show session variables like 'replicate_annotate_rows_events';
Variable_name Value
replicate_annotate_rows_events OFF
select * from information_schema.global_variables where variable_name='replicate_annotate_rows_events';
VARIABLE_NAME VARIABLE_VALUE
REPLICATE_ANNOTATE_ROWS_EVENTS OFF
select * from information_schema.session_variables where variable_name='replicate_annotate_rows_events';
VARIABLE_NAME VARIABLE_VALUE
REPLICATE_ANNOTATE_ROWS_EVENTS OFF
set global replicate_annotate_rows_events=1;
ERROR HY000: Variable 'replicate_annotate_rows_events' is a read only variable
set session replicate_annotate_rows_events=1;
ERROR HY000: Variable 'replicate_annotate_rows_events' is a read only variable
select @@global.thread_alarm;
@@global.thread_alarm
1
select @@session.thread_alarm;
ERROR HY000: Variable 'thread_alarm' is a GLOBAL variable
show global variables like 'thread_alarm';
Variable_name Value
thread_alarm ON
show session variables like 'thread_alarm';
Variable_name Value
thread_alarm ON
select * from information_schema.global_variables where variable_name='thread_alarm';
VARIABLE_NAME VARIABLE_VALUE
THREAD_ALARM ON
select * from information_schema.session_variables where variable_name='thread_alarm';
VARIABLE_NAME VARIABLE_VALUE
THREAD_ALARM ON
set global thread_alarm=1;
ERROR HY000: Variable 'thread_alarm' is a read only variable
set session thread_alarm=1;
ERROR HY000: Variable 'thread_alarm' is a read only variable
...@@ -74,10 +74,12 @@ delete from t2 where variable_name='innodb_change_buffering_debug'; ...@@ -74,10 +74,12 @@ delete from t2 where variable_name='innodb_change_buffering_debug';
update t2 set variable_name= replace(variable_name, "PERFORMANCE_SCHEMA_", "PFS_"); update t2 set variable_name= replace(variable_name, "PERFORMANCE_SCHEMA_", "PFS_");
--sorted_result --sorted_result
--lowercase_result
select distinct variable_name as `There should be *no* long test name listed below:` from t2 select distinct variable_name as `There should be *no* long test name listed below:` from t2
where length(variable_name) > 50; where length(variable_name) > 50;
--sorted_result --sorted_result
--lowercase_result
select distinct variable_name as `There should be *no* variables listed below:` from t2 select distinct variable_name as `There should be *no* variables listed below:` from t2
left join t1 on variable_name=test_name where test_name is null; left join t1 on variable_name=test_name where test_name is null;
......
# bool session
SET @start_global_value = @@global.binlog_annotate_rows_events;
select @@global.binlog_annotate_rows_events;
select @@session.binlog_annotate_rows_events;
show global variables like 'binlog_annotate_rows_events';
show session variables like 'binlog_annotate_rows_events';
select * from information_schema.global_variables where variable_name='binlog_annotate_rows_events';
select * from information_schema.session_variables where variable_name='binlog_annotate_rows_events';
#
# show that it's writable
#
set global binlog_annotate_rows_events=ON;
select @@global.binlog_annotate_rows_events;
set global binlog_annotate_rows_events=OFF;
select @@global.binlog_annotate_rows_events;
set global binlog_annotate_rows_events=1;
select @@global.binlog_annotate_rows_events;
set session binlog_annotate_rows_events=ON;
select @@session.binlog_annotate_rows_events;
set session binlog_annotate_rows_events=OFF;
select @@session.binlog_annotate_rows_events;
set session binlog_annotate_rows_events=1;
select @@session.binlog_annotate_rows_events;
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global binlog_annotate_rows_events=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set session binlog_annotate_rows_events=1e1;
--error ER_WRONG_VALUE_FOR_VAR
set session binlog_annotate_rows_events="foo";
SET @@global.binlog_annotate_rows_events = @start_global_value;
# ulong global
SET @start_global_value = @@global.binlog_dbug_fsync_sleep;
#
# exists as global only
#
select @@global.binlog_dbug_fsync_sleep;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.binlog_dbug_fsync_sleep;
show global variables like 'binlog_dbug_fsync_sleep';
show session variables like 'binlog_dbug_fsync_sleep';
select * from information_schema.global_variables where variable_name='binlog_dbug_fsync_sleep';
select * from information_schema.session_variables where variable_name='binlog_dbug_fsync_sleep';
#
# show that it's writable
#
set global binlog_dbug_fsync_sleep=200;
select @@global.binlog_dbug_fsync_sleep;
--error ER_GLOBAL_VARIABLE
set session binlog_dbug_fsync_sleep=1;
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global binlog_dbug_fsync_sleep=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global binlog_dbug_fsync_sleep=1e1;
--error ER_WRONG_TYPE_FOR_VAR
set global binlog_dbug_fsync_sleep="foo";
#
# min/max values, block size
#
set global binlog_dbug_fsync_sleep=1;
select @@global.binlog_dbug_fsync_sleep;
set global binlog_dbug_fsync_sleep=@@global.binlog_dbug_fsync_sleep + 100 - 1;
select @@global.binlog_dbug_fsync_sleep;
set global binlog_dbug_fsync_sleep=@@global.binlog_dbug_fsync_sleep + 100;
select @@global.binlog_dbug_fsync_sleep;
set global binlog_dbug_fsync_sleep=cast(-1 as unsigned int);
select @@global.binlog_dbug_fsync_sleep;
SET @@global.binlog_dbug_fsync_sleep = @start_global_value;
# bool readonly
#
# show values;
#
select @@global.binlog_optimize_thread_scheduling;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.binlog_optimize_thread_scheduling;
show global variables like 'binlog_optimize_thread_scheduling';
show session variables like 'binlog_optimize_thread_scheduling';
select * from information_schema.global_variables where variable_name='binlog_optimize_thread_scheduling';
select * from information_schema.session_variables where variable_name='binlog_optimize_thread_scheduling';
#
# show that it's read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global binlog_optimize_thread_scheduling=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session binlog_optimize_thread_scheduling=1;
# bool readonly
#
# show values;
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@global.in_transaction;
select @@session.in_transaction;
show global variables like 'in_transaction';
show session variables like 'in_transaction';
select * from information_schema.global_variables where variable_name='in_transaction';
select * from information_schema.session_variables where variable_name='in_transaction';
#
# show that it's read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global in_transaction=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session in_transaction=1;
# ulonglong session
SET @start_global_value = @@global.join_buffer_space_limit;
#
# exists as global and session
#
select @@global.join_buffer_space_limit;
select @@session.join_buffer_space_limit;
show global variables like 'join_buffer_space_limit';
show session variables like 'join_buffer_space_limit';
select * from information_schema.global_variables where variable_name='join_buffer_space_limit';
select * from information_schema.session_variables where variable_name='join_buffer_space_limit';
#
# show that it's writable
#
set global join_buffer_space_limit=10;
select @@global.join_buffer_space_limit;
set session join_buffer_space_limit=10;
select @@session.join_buffer_space_limit;
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global join_buffer_space_limit=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set session join_buffer_space_limit=1e1;
--error ER_WRONG_TYPE_FOR_VAR
set global join_buffer_space_limit="foo";
#
# min/max values, block size
#
set global join_buffer_space_limit=0;
select @@global.join_buffer_space_limit;
set global join_buffer_space_limit=4095;
select @@global.join_buffer_space_limit;
set session join_buffer_space_limit=cast(-1 as unsigned int);
select @@session.join_buffer_space_limit;
SET @@global.join_buffer_space_limit = @start_global_value;
# ulong readonly
#
# show the global and session values;
#
select @@global.myisam_block_size;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.myisam_block_size;
show global variables like 'myisam_block_size';
show session variables like 'myisam_block_size';
select * from information_schema.global_variables where variable_name='myisam_block_size';
select * from information_schema.session_variables where variable_name='myisam_block_size';
#
# show that it's read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global myisam_block_size=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session myisam_block_size=1;
# ulong session
SET @start_global_value = @@global.progress_report_time;
#
# exists as global only
#
select @@global.progress_report_time;
select @@session.progress_report_time;
show global variables like 'progress_report_time';
show session variables like 'progress_report_time';
select * from information_schema.global_variables where variable_name='progress_report_time';
select * from information_schema.session_variables where variable_name='progress_report_time';
#
# show that it's writable
#
set global progress_report_time=10;
select @@global.progress_report_time;
set session progress_report_time=10;
select @@session.progress_report_time;
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global progress_report_time=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set session progress_report_time=1e1;
--error ER_WRONG_TYPE_FOR_VAR
set global progress_report_time="foo";
#
# min/max values, block size
#
set global progress_report_time=0;
select @@global.progress_report_time;
set session progress_report_time=cast(-1 as unsigned int);
select @@session.progress_report_time;
SET @@global.progress_report_time = @start_global_value;
# bool global
SET @start_global_value = @@global.query_cache_strip_comments;
#
# exists as global only
#
select @@global.query_cache_strip_comments;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.query_cache_strip_comments;
show global variables like 'query_cache_strip_comments';
show session variables like 'query_cache_strip_comments';
select * from information_schema.global_variables where variable_name='query_cache_strip_comments';
select * from information_schema.session_variables where variable_name='query_cache_strip_comments';
#
# show that it's writable
#
set global query_cache_strip_comments=ON;
select @@global.query_cache_strip_comments;
set global query_cache_strip_comments=OFF;
select @@global.query_cache_strip_comments;
set global query_cache_strip_comments=1;
select @@global.query_cache_strip_comments;
--error ER_GLOBAL_VARIABLE
set session query_cache_strip_comments=1;
#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global query_cache_strip_comments=1.1;
--error ER_WRONG_TYPE_FOR_VAR
set global query_cache_strip_comments=1e1;
--error ER_WRONG_VALUE_FOR_VAR
set global query_cache_strip_comments="foo";
SET @@global.query_cache_strip_comments = @start_global_value;
# bool readonly
#
# show values;
#
select @@global.replicate_annotate_rows_events;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.replicate_annotate_rows_events;
show global variables like 'replicate_annotate_rows_events';
show session variables like 'replicate_annotate_rows_events';
select * from information_schema.global_variables where variable_name='replicate_annotate_rows_events';
select * from information_schema.session_variables where variable_name='replicate_annotate_rows_events';
#
# show that it's read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global replicate_annotate_rows_events=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session replicate_annotate_rows_events=1;
# bool readonly
#
# show values;
#
select @@global.thread_alarm;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.thread_alarm;
show global variables like 'thread_alarm';
show session variables like 'thread_alarm';
select * from information_schema.global_variables where variable_name='thread_alarm';
select * from information_schema.session_variables where variable_name='thread_alarm';
#
# show that it's read-only
#
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set global thread_alarm=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
set session thread_alarm=1;
...@@ -6287,7 +6287,6 @@ struct my_option my_long_options[]= ...@@ -6287,7 +6287,6 @@ struct my_option my_long_options[]=
{"log", 'l', "Log connections and queries to file (deprecated option, use " {"log", 'l', "Log connections and queries to file (deprecated option, use "
"--general-log/--general-log-file instead).", &opt_logname, &opt_logname, "--general-log/--general-log-file instead).", &opt_logname, &opt_logname,
0, GET_STR_ALLOC, OPT_ARG, 0, 0, 0, 0, 0, 0}, 0, GET_STR_ALLOC, OPT_ARG, 0, 0, 0, 0, 0, 0},
#if 0
{"log-basename", OPT_LOG_BASENAME, {"log-basename", OPT_LOG_BASENAME,
"Basename for all log files and the .pid file. This sets all log file " "Basename for all log files and the .pid file. This sets all log file "
"names at once (in 'datadir') and is normally the only option you need " "names at once (in 'datadir') and is normally the only option you need "
...@@ -6296,7 +6295,6 @@ struct my_option my_long_options[]= ...@@ -6296,7 +6295,6 @@ struct my_option my_long_options[]=
"--log-slow-query-log-file, --log-error-file, and --pid-file", "--log-slow-query-log-file, --log-error-file, and --pid-file",
&opt_log_basename, &opt_log_basename, 0, GET_STR, REQUIRED_ARG, &opt_log_basename, &opt_log_basename, 0, GET_STR, REQUIRED_ARG,
0, 0, 0, 0, 0, 0}, 0, 0, 0, 0, 0, 0},
#endif
{"log-bin", OPT_BIN_LOG, {"log-bin", OPT_BIN_LOG,
"Log update queries in binary format. Optional argument should be name for " "Log update queries in binary format. Optional argument should be name for "
"binary log. If not given " "binary log. If not given "
......
...@@ -3385,6 +3385,7 @@ static Sys_var_mybool Sys_thread_alarm( ...@@ -3385,6 +3385,7 @@ static Sys_var_mybool Sys_thread_alarm(
READ_ONLY GLOBAL_VAR(opt_thread_alarm), CMD_LINE(OPT_ARG), READ_ONLY GLOBAL_VAR(opt_thread_alarm), CMD_LINE(OPT_ARG),
DEFAULT(TRUE)); DEFAULT(TRUE));
#if 0
static Sys_var_charptr Sys_log_basename( static Sys_var_charptr Sys_log_basename(
"log_basename", "log_basename",
"Basename for all log files and the .pid file. This sets all log file " "Basename for all log files and the .pid file. This sets all log file "
...@@ -3397,6 +3398,7 @@ static Sys_var_charptr Sys_log_basename( ...@@ -3397,6 +3398,7 @@ static Sys_var_charptr Sys_log_basename(
READ_ONLY GLOBAL_VAR(opt_log_basename), READ_ONLY GLOBAL_VAR(opt_log_basename),
CMD_LINE(REQUIRED_ARG, OPT_LOG_BASENAME), CMD_LINE(REQUIRED_ARG, OPT_LOG_BASENAME),
IN_FS_CHARSET, DEFAULT(0)); IN_FS_CHARSET, DEFAULT(0));
#endif
static Sys_var_mybool Sys_query_cache_strip_comments( static Sys_var_mybool Sys_query_cache_strip_comments(
"query_cache_strip_comments", "query_cache_strip_comments",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment