Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
fe09326e
Commit
fe09326e
authored
Feb 27, 2009
by
Tatiana A. Nurnberg
Browse files
Options
Browse Files
Download
Plain Diff
automerge
parents
cd5744db
71913e35
Changes
41
Show whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
314 additions
and
115 deletions
+314
-115
mysql-test/r/ps.result
mysql-test/r/ps.result
+2
-0
mysql-test/r/variables.result
mysql-test/r/variables.result
+34
-1
mysql-test/suite/sys_vars/r/auto_increment_increment_basic.result
...st/suite/sys_vars/r/auto_increment_increment_basic.result
+2
-2
mysql-test/suite/sys_vars/r/auto_increment_increment_func.result
...est/suite/sys_vars/r/auto_increment_increment_func.result
+1
-1
mysql-test/suite/sys_vars/r/auto_increment_offset_basic.result
...-test/suite/sys_vars/r/auto_increment_offset_basic.result
+2
-2
mysql-test/suite/sys_vars/r/auto_increment_offset_func.result
...l-test/suite/sys_vars/r/auto_increment_offset_func.result
+1
-1
mysql-test/suite/sys_vars/r/concurrent_insert_basic.result
mysql-test/suite/sys_vars/r/concurrent_insert_basic.result
+2
-0
mysql-test/suite/sys_vars/r/connect_timeout_basic.result
mysql-test/suite/sys_vars/r/connect_timeout_basic.result
+1
-1
mysql-test/suite/sys_vars/r/default_week_format_basic.result
mysql-test/suite/sys_vars/r/default_week_format_basic.result
+4
-0
mysql-test/suite/sys_vars/r/delayed_insert_timeout_basic.result
...test/suite/sys_vars/r/delayed_insert_timeout_basic.result
+1
-1
mysql-test/suite/sys_vars/r/div_precision_increment_basic.result
...est/suite/sys_vars/r/div_precision_increment_basic.result
+4
-0
mysql-test/suite/sys_vars/r/expire_logs_days_basic.result
mysql-test/suite/sys_vars/r/expire_logs_days_basic.result
+4
-0
mysql-test/suite/sys_vars/r/group_concat_max_len_basic.result
...l-test/suite/sys_vars/r/group_concat_max_len_basic.result
+2
-2
mysql-test/suite/sys_vars/r/interactive_timeout_basic.result
mysql-test/suite/sys_vars/r/interactive_timeout_basic.result
+2
-2
mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
+1
-1
mysql-test/suite/sys_vars/r/max_binlog_size_basic.result
mysql-test/suite/sys_vars/r/max_binlog_size_basic.result
+2
-2
mysql-test/suite/sys_vars/r/max_connections_basic.result
mysql-test/suite/sys_vars/r/max_connections_basic.result
+2
-2
mysql-test/suite/sys_vars/r/max_delayed_threads_basic.result
mysql-test/suite/sys_vars/r/max_delayed_threads_basic.result
+4
-0
mysql-test/suite/sys_vars/r/max_error_count_basic.result
mysql-test/suite/sys_vars/r/max_error_count_basic.result
+8
-0
mysql-test/suite/sys_vars/r/max_insert_delayed_threads_basic.result
.../suite/sys_vars/r/max_insert_delayed_threads_basic.result
+4
-0
mysql-test/suite/sys_vars/r/max_length_for_sort_data_basic.result
...st/suite/sys_vars/r/max_length_for_sort_data_basic.result
+2
-2
mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result
...est/suite/sys_vars/r/max_prepared_stmt_count_basic.result
+4
-0
mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result
mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result
+4
-0
mysql-test/suite/sys_vars/r/max_sort_length_basic.result
mysql-test/suite/sys_vars/r/max_sort_length_basic.result
+2
-2
mysql-test/suite/sys_vars/r/max_sp_recursion_depth_basic.result
...test/suite/sys_vars/r/max_sp_recursion_depth_basic.result
+8
-0
mysql-test/suite/sys_vars/r/myisam_data_pointer_size_basic.result
...st/suite/sys_vars/r/myisam_data_pointer_size_basic.result
+1
-1
mysql-test/suite/sys_vars/r/net_buffer_length_basic.result
mysql-test/suite/sys_vars/r/net_buffer_length_basic.result
+1
-1
mysql-test/suite/sys_vars/r/net_read_timeout_basic.result
mysql-test/suite/sys_vars/r/net_read_timeout_basic.result
+2
-2
mysql-test/suite/sys_vars/r/net_write_timeout_basic.result
mysql-test/suite/sys_vars/r/net_write_timeout_basic.result
+2
-2
mysql-test/suite/sys_vars/r/optimizer_prune_level_basic.result
...-test/suite/sys_vars/r/optimizer_prune_level_basic.result
+4
-0
mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result
...test/suite/sys_vars/r/optimizer_search_depth_basic.result
+4
-0
mysql-test/suite/sys_vars/r/preload_buffer_size_basic.result
mysql-test/suite/sys_vars/r/preload_buffer_size_basic.result
+2
-2
mysql-test/suite/sys_vars/r/read_buffer_size_basic.result
mysql-test/suite/sys_vars/r/read_buffer_size_basic.result
+2
-2
mysql-test/suite/sys_vars/r/read_rnd_buffer_size_basic.result
...l-test/suite/sys_vars/r/read_rnd_buffer_size_basic.result
+2
-2
mysql-test/suite/sys_vars/r/slave_net_timeout_basic.result
mysql-test/suite/sys_vars/r/slave_net_timeout_basic.result
+2
-2
mysql-test/suite/sys_vars/r/slow_launch_time_basic.result
mysql-test/suite/sys_vars/r/slow_launch_time_basic.result
+4
-0
mysql-test/suite/sys_vars/r/table_definition_cache_basic.result
...test/suite/sys_vars/r/table_definition_cache_basic.result
+1
-1
mysql-test/suite/sys_vars/r/table_lock_wait_timeout_basic.result
...est/suite/sys_vars/r/table_lock_wait_timeout_basic.result
+2
-2
mysql-test/suite/sys_vars/r/table_open_cache_basic.result
mysql-test/suite/sys_vars/r/table_open_cache_basic.result
+2
-2
mysql-test/t/variables.test
mysql-test/t/variables.test
+35
-0
sql/set_var.cc
sql/set_var.cc
+145
-74
No files found.
mysql-test/r/ps.result
View file @
fe09326e
...
...
@@ -803,6 +803,8 @@ select @@max_prepared_stmt_count;
@@max_prepared_stmt_count
16382
set global max_prepared_stmt_count=-1;
Warnings:
Warning 1292 Truncated incorrect max_prepared_stmt_count value: '-1'
select @@max_prepared_stmt_count;
@@max_prepared_stmt_count
0
...
...
mysql-test/r/variables.result
View file @
fe09326e
...
...
@@ -705,7 +705,7 @@ VARIABLE_NAME VARIABLE_VALUE
MYISAM_DATA_POINTER_SIZE 7
SET GLOBAL table_open_cache=-1;
Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '
0
'
Warning 1292 Truncated incorrect table_open_cache value: '
-1
'
SHOW VARIABLES LIKE 'table_open_cache';
Variable_name Value
table_open_cache 1
...
...
@@ -1341,3 +1341,36 @@ SET @@session.thread_stack= 7;
ERROR HY000: Variable 'thread_stack' is a read only variable
SET @@global.thread_stack= 7;
ERROR HY000: Variable 'thread_stack' is a read only variable
SELECT @@global.expire_logs_days INTO @old_eld;
SET GLOBAL expire_logs_days = -1;
Warnings:
Warning 1292 Truncated incorrect expire_logs_days value: '-1'
needs to've been adjusted (0)
SELECT @@global.expire_logs_days;
@@global.expire_logs_days
0
SET GLOBAL expire_logs_days = 11;
SET @old_mode=@@sql_mode;
SET SESSION sql_mode = 'TRADITIONAL';
SET GLOBAL expire_logs_days = 100;
ERROR 42000: Variable 'expire_logs_days' can't be set to the value of '100'
needs to be unchanged (11)
SELECT @@global.expire_logs_days;
@@global.expire_logs_days
11
SET SESSION sql_mode = @old_mode;
SET GLOBAL expire_logs_days = 100;
Warnings:
Warning 1292 Truncated incorrect expire_logs_days value: '100'
needs to've been adjusted (99)
SELECT @@global.expire_logs_days;
@@global.expire_logs_days
99
SET GLOBAL expire_logs_days = 11;
SET GLOBAL expire_logs_days = 99;
needs to pass with no warnings (99)
SELECT @@global.expire_logs_days;
@@global.expire_logs_days
99
SET GLOBAL expire_logs_days = @old_eld;
End of 5.1 tests
mysql-test/suite/sys_vars/r/auto_increment_increment_basic.result
View file @
fe09326e
...
...
@@ -61,7 +61,7 @@ SELECT @@global.auto_increment_increment;
1
SET @@global.auto_increment_increment = -1024;
Warnings:
Warning 1292 Truncated incorrect auto
-increment-increment value: '0
'
Warning 1292 Truncated incorrect auto
_increment_increment value: '-1024
'
SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
1
...
...
@@ -89,7 +89,7 @@ SELECT @@session.auto_increment_increment;
1
SET @@session.auto_increment_increment = -2;
Warnings:
Warning 1292 Truncated incorrect auto
-increment-increment value: '0
'
Warning 1292 Truncated incorrect auto
_increment_increment value: '-2
'
SELECT @@session.auto_increment_increment;
@@session.auto_increment_increment
1
...
...
mysql-test/suite/sys_vars/r/auto_increment_increment_func.result
View file @
fe09326e
...
...
@@ -169,7 +169,7 @@ id name
## Verifying behavior of variable with negative value ##
SET @@auto_increment_increment = -10;
Warnings:
Warning 1292 Truncated incorrect auto
-increment-increment value: '
0'
Warning 1292 Truncated incorrect auto
_increment_increment value: '-1
0'
INSERT into t1(name) values('Record_17');
INSERT into t1(name) values('Record_18');
SELECT * from t1;
...
...
mysql-test/suite/sys_vars/r/auto_increment_offset_basic.result
View file @
fe09326e
...
...
@@ -61,7 +61,7 @@ SELECT @@global.auto_increment_offset;
1
SET @@global.auto_increment_offset = -1024;
Warnings:
Warning 1292 Truncated incorrect auto
-increment-offset value: '0
'
Warning 1292 Truncated incorrect auto
_increment_offset value: '-1024
'
SELECT @@global.auto_increment_offset;
@@global.auto_increment_offset
1
...
...
@@ -94,7 +94,7 @@ SELECT @@session.auto_increment_offset;
1
SET @@session.auto_increment_offset = -2;
Warnings:
Warning 1292 Truncated incorrect auto
-increment-offset value: '0
'
Warning 1292 Truncated incorrect auto
_increment_offset value: '-2
'
SELECT @@session.auto_increment_offset;
@@session.auto_increment_offset
1
...
...
mysql-test/suite/sys_vars/r/auto_increment_offset_func.result
View file @
fe09326e
...
...
@@ -178,7 +178,7 @@ id name
## Assigning -ve value to variable ##
SET @@auto_increment_offset = -10;
Warnings:
Warning 1292 Truncated incorrect auto
-increment-offset value: '
0'
Warning 1292 Truncated incorrect auto
_increment_offset value: '-1
0'
SELECT @@auto_increment_offset = -10;
@@auto_increment_offset = -10
0
...
...
mysql-test/suite/sys_vars/r/concurrent_insert_basic.result
View file @
fe09326e
...
...
@@ -28,6 +28,8 @@ SELECT @@global.concurrent_insert;
2
'#--------------------FN_DYNVARS_018_04-------------------------#'
SET @@global.concurrent_insert = -1;
Warnings:
Warning 1292 Truncated incorrect concurrent_insert value: '-1'
Select @@global.concurrent_insert;
@@global.concurrent_insert
0
...
...
mysql-test/suite/sys_vars/r/connect_timeout_basic.result
View file @
fe09326e
...
...
@@ -35,7 +35,7 @@ SELECT @@global.connect_timeout;
2
SET @@global.connect_timeout = -1024;
Warnings:
Warning 1292 Truncated incorrect connect_timeout value: '
0
'
Warning 1292 Truncated incorrect connect_timeout value: '
-1024
'
SELECT @@global.connect_timeout;
@@global.connect_timeout
2
...
...
mysql-test/suite/sys_vars/r/default_week_format_basic.result
View file @
fe09326e
...
...
@@ -64,6 +64,8 @@ SELECT @@global.default_week_format;
@@global.default_week_format
7
SET @@global.default_week_format = -1024;
Warnings:
Warning 1292 Truncated incorrect default_week_format value: '-1024'
SELECT @@global.default_week_format;
@@global.default_week_format
0
...
...
@@ -100,6 +102,8 @@ SELECT @@session.default_week_format;
@@session.default_week_format
7
SET @@session.default_week_format = -2;
Warnings:
Warning 1292 Truncated incorrect default_week_format value: '-2'
SELECT @@session.default_week_format;
@@session.default_week_format
0
...
...
mysql-test/suite/sys_vars/r/delayed_insert_timeout_basic.result
View file @
fe09326e
...
...
@@ -35,7 +35,7 @@ SELECT @@global.delayed_insert_timeout;
1
SET @@global.delayed_insert_timeout = -1024;
Warnings:
Warning 1292 Truncated incorrect delayed_insert_timeout value: '
0
'
Warning 1292 Truncated incorrect delayed_insert_timeout value: '
-1024
'
SELECT @@global.delayed_insert_timeout;
@@global.delayed_insert_timeout
1
...
...
mysql-test/suite/sys_vars/r/div_precision_increment_basic.result
View file @
fe09326e
...
...
@@ -78,6 +78,8 @@ SELECT @@global.div_precision_increment;
@@global.div_precision_increment
30
SET @@global.div_precision_increment = -1024;
Warnings:
Warning 1292 Truncated incorrect div_precision_increment value: '-1024'
SELECT @@global.div_precision_increment;
@@global.div_precision_increment
0
...
...
@@ -100,6 +102,8 @@ SELECT @@session.div_precision_increment;
@@session.div_precision_increment
30
SET @@session.div_precision_increment = -2;
Warnings:
Warning 1292 Truncated incorrect div_precision_increment value: '-2'
SELECT @@session.div_precision_increment;
@@session.div_precision_increment
0
...
...
mysql-test/suite/sys_vars/r/expire_logs_days_basic.result
View file @
fe09326e
...
...
@@ -32,6 +32,8 @@ SELECT @@global.expire_logs_days;
21
'#--------------------FN_DYNVARS_029_04-------------------------#'
SET @@global.expire_logs_days = -1;
Warnings:
Warning 1292 Truncated incorrect expire_logs_days value: '-1'
SELECT @@global.expire_logs_days;
@@global.expire_logs_days
0
...
...
@@ -53,6 +55,8 @@ SELECT @@global.expire_logs_days;
@@global.expire_logs_days
99
SET @@global.expire_logs_days = -1024;
Warnings:
Warning 1292 Truncated incorrect expire_logs_days value: '-1024'
SELECT @@global.expire_logs_days;
@@global.expire_logs_days
0
...
...
mysql-test/suite/sys_vars/r/group_concat_max_len_basic.result
View file @
fe09326e
...
...
@@ -65,7 +65,7 @@ SELECT @@global.group_concat_max_len;
4
SET @@global.group_concat_max_len = -1024;
Warnings:
Warning 1292 Truncated incorrect group_concat_max_len value: '
0
'
Warning 1292 Truncated incorrect group_concat_max_len value: '
-1024
'
SELECT @@global.group_concat_max_len;
@@global.group_concat_max_len
4
...
...
@@ -91,7 +91,7 @@ SELECT @@session.group_concat_max_len;
4
SET @@session.group_concat_max_len = -2;
Warnings:
Warning 1292 Truncated incorrect group_concat_max_len value: '
0
'
Warning 1292 Truncated incorrect group_concat_max_len value: '
-2
'
SELECT @@session.group_concat_max_len;
@@session.group_concat_max_len
4
...
...
mysql-test/suite/sys_vars/r/interactive_timeout_basic.result
View file @
fe09326e
...
...
@@ -61,7 +61,7 @@ SELECT @@global.interactive_timeout;
1
SET @@global.interactive_timeout = -1024;
Warnings:
Warning 1292 Truncated incorrect interactive_timeout value: '
0
'
Warning 1292 Truncated incorrect interactive_timeout value: '
-1024
'
SELECT @@global.interactive_timeout;
@@global.interactive_timeout
1
...
...
@@ -89,7 +89,7 @@ SELECT @@session.interactive_timeout;
1
SET @@session.interactive_timeout = -2;
Warnings:
Warning 1292 Truncated incorrect interactive_timeout value: '
0
'
Warning 1292 Truncated incorrect interactive_timeout value: '
-2
'
SELECT @@session.interactive_timeout;
@@session.interactive_timeout
1
...
...
mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
View file @
fe09326e
...
...
@@ -76,7 +76,7 @@ SELECT @@global.max_allowed_packet;
1024
SET @@global.max_allowed_packet = -1024;
Warnings:
Warning 1292 Truncated incorrect max_allowed_packet value: '
0
'
Warning 1292 Truncated incorrect max_allowed_packet value: '
-1024
'
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1024
...
...
mysql-test/suite/sys_vars/r/max_binlog_size_basic.result
View file @
fe09326e
...
...
@@ -39,7 +39,7 @@ SELECT @@global.max_binlog_size;
'#--------------------FN_DYNVARS_072_04-------------------------#'
SET @@global.max_binlog_size = -1;
Warnings:
Warning 1292 Truncated incorrect max_binlog_size value: '
0
'
Warning 1292 Truncated incorrect max_binlog_size value: '
-1
'
SELECT @@global.max_binlog_size;
@@global.max_binlog_size
4096
...
...
@@ -56,7 +56,7 @@ SELECT @@global.max_binlog_size;
1073741824
SET @@global.max_binlog_size = -1024;
Warnings:
Warning 1292 Truncated incorrect max_binlog_size value: '
0
'
Warning 1292 Truncated incorrect max_binlog_size value: '
-1024
'
SELECT @@global.max_binlog_size;
@@global.max_binlog_size
4096
...
...
mysql-test/suite/sys_vars/r/max_connections_basic.result
View file @
fe09326e
...
...
@@ -39,7 +39,7 @@ SELECT @@global.max_connections;
'#--------------------FN_DYNVARS_074_04-------------------------#'
SET @@global.max_connections = -1;
Warnings:
Warning 1292 Truncated incorrect max_connections value: '
0
'
Warning 1292 Truncated incorrect max_connections value: '
-1
'
SELECT @@global.max_connections;
@@global.max_connections
1
...
...
@@ -56,7 +56,7 @@ SELECT @@global.max_connections;
100000
SET @@global.max_connections = -1024;
Warnings:
Warning 1292 Truncated incorrect max_connections value: '
0
'
Warning 1292 Truncated incorrect max_connections value: '
-1024
'
SELECT @@global.max_connections;
@@global.max_connections
1
...
...
mysql-test/suite/sys_vars/r/max_delayed_threads_basic.result
View file @
fe09326e
...
...
@@ -76,10 +76,14 @@ SELECT @@session.max_delayed_threads;
16383
'#------------------FN_DYNVARS_075_05-----------------------#'
SET @@global.max_delayed_threads = -1024;
Warnings:
Warning 1292 Truncated incorrect max_delayed_threads value: '-1024'
SELECT @@global.max_delayed_threads;
@@global.max_delayed_threads
0
SET @@global.max_delayed_threads = -1;
Warnings:
Warning 1292 Truncated incorrect max_delayed_threads value: '-1'
SELECT @@global.max_delayed_threads;
@@global.max_delayed_threads
0
...
...
mysql-test/suite/sys_vars/r/max_error_count_basic.result
View file @
fe09326e
...
...
@@ -63,10 +63,14 @@ SELECT @@session.max_error_count;
65534
'#------------------FN_DYNVARS_076_05-----------------------#'
SET @@global.max_error_count = -1;
Warnings:
Warning 1292 Truncated incorrect max_error_count value: '-1'
SELECT @@global.max_error_count;
@@global.max_error_count
0
SET @@global.max_error_count = -1024;
Warnings:
Warning 1292 Truncated incorrect max_error_count value: '-1024'
SELECT @@global.max_error_count;
@@global.max_error_count
0
...
...
@@ -93,6 +97,8 @@ SELECT @@global.max_error_count;
@@global.max_error_count
65535
SET @@session.max_error_count = -1;
Warnings:
Warning 1292 Truncated incorrect max_error_count value: '-1'
SELECT @@session.max_error_count;
@@session.max_error_count
0
...
...
@@ -102,6 +108,8 @@ SELECT @@session.max_error_count;
@@session.max_error_count
65535
SET @@session.max_error_count = -2;
Warnings:
Warning 1292 Truncated incorrect max_error_count value: '-2'
SELECT @@session.max_error_count;
@@session.max_error_count
0
...
...
mysql-test/suite/sys_vars/r/max_insert_delayed_threads_basic.result
View file @
fe09326e
...
...
@@ -77,10 +77,14 @@ SELECT @@session.max_insert_delayed_threads;
16383
'#------------------FN_DYNVARS_078_05-----------------------#'
SET @@global.max_insert_delayed_threads = -1024;
Warnings:
Warning 1292 Truncated incorrect max_insert_delayed_threads value: '-1024'
SELECT @@global.max_insert_delayed_threads;
@@global.max_insert_delayed_threads
0
SET @@global.max_insert_delayed_threads = -1;
Warnings:
Warning 1292 Truncated incorrect max_insert_delayed_threads value: '-1'
SELECT @@global.max_insert_delayed_threads;
@@global.max_insert_delayed_threads
0
...
...
mysql-test/suite/sys_vars/r/max_length_for_sort_data_basic.result
View file @
fe09326e
...
...
@@ -71,7 +71,7 @@ SELECT @@session.max_length_for_sort_data;
'#------------------FN_DYNVARS_080_05-----------------------#'
SET @@global.max_length_for_sort_data = -1024;
Warnings:
Warning 1292 Truncated incorrect max_length_for_sort_data value: '
0
'
Warning 1292 Truncated incorrect max_length_for_sort_data value: '
-1024
'
SELECT @@global.max_length_for_sort_data;
@@global.max_length_for_sort_data
4
...
...
@@ -111,7 +111,7 @@ SELECT @@session.max_length_for_sort_data;
8388608
SET @@session.max_length_for_sort_data = -1;
Warnings:
Warning 1292 Truncated incorrect max_length_for_sort_data value: '
0
'
Warning 1292 Truncated incorrect max_length_for_sort_data value: '
-1
'
SELECT @@session.max_length_for_sort_data;
@@session.max_length_for_sort_data
4
...
...
mysql-test/suite/sys_vars/r/max_prepared_stmt_count_basic.result
View file @
fe09326e
...
...
@@ -36,6 +36,8 @@ SELECT @@global.max_prepared_stmt_count;
65535
'#--------------------FN_DYNVARS_081_04-------------------------#'
SET @@global.max_prepared_stmt_count = -1;
Warnings:
Warning 1292 Truncated incorrect max_prepared_stmt_count value: '-1'
SELECT @@global.max_prepared_stmt_count;
@@global.max_prepared_stmt_count
0
...
...
@@ -51,6 +53,8 @@ SELECT @@global.max_prepared_stmt_count;
@@global.max_prepared_stmt_count
1048576
SET @@global.max_prepared_stmt_count = -1024;
Warnings:
Warning 1292 Truncated incorrect max_prepared_stmt_count value: '-1024'
SELECT @@global.max_prepared_stmt_count;
@@global.max_prepared_stmt_count
0
...
...
mysql-test/suite/sys_vars/r/max_relay_log_size_basic.result
View file @
fe09326e
...
...
@@ -38,6 +38,8 @@ SELECT @@global.max_relay_log_size;
'Bug# 34877: Invalid Values are coming in variable on assigning valid values';
'#--------------------FN_DYNVARS_082_04-------------------------#'
SET @@global.max_relay_log_size = -1;
Warnings:
Warning 1292 Truncated incorrect max_relay_log_size value: '-1'
SELECT @@global.max_relay_log_size;
@@global.max_relay_log_size
0
...
...
@@ -53,6 +55,8 @@ SELECT @@global.max_relay_log_size;
@@global.max_relay_log_size
1073741824
SET @@global.max_relay_log_size = -1024;
Warnings:
Warning 1292 Truncated incorrect max_relay_log_size value: '-1024'
SELECT @@global.max_relay_log_size;
@@global.max_relay_log_size
0
...
...
mysql-test/suite/sys_vars/r/max_sort_length_basic.result
View file @
fe09326e
...
...
@@ -71,7 +71,7 @@ SELECT @@session.max_sort_length;
'#------------------FN_DYNVARS_084_05-----------------------#'
SET @@global.max_sort_length = -1024;
Warnings:
Warning 1292 Truncated incorrect max_sort_length value: '
0
'
Warning 1292 Truncated incorrect max_sort_length value: '
-1024
'
SELECT @@global.max_sort_length;
@@global.max_sort_length
4
...
...
@@ -111,7 +111,7 @@ SELECT @@session.max_sort_length;
8388608
SET @@session.max_sort_length = -1;
Warnings:
Warning 1292 Truncated incorrect max_sort_length value: '
0
'
Warning 1292 Truncated incorrect max_sort_length value: '
-1
'
SELECT @@session.max_sort_length;
@@session.max_sort_length
4
...
...
mysql-test/suite/sys_vars/r/max_sp_recursion_depth_basic.result
View file @
fe09326e
...
...
@@ -74,6 +74,8 @@ SELECT @@session.max_sp_recursion_depth;
150
'#------------------FN_DYNVARS_085_05-----------------------#'
SET @@global.max_sp_recursion_depth = -1024;
Warnings:
Warning 1292 Truncated incorrect max_sp_recursion_depth value: '-1024'
SELECT @@global.max_sp_recursion_depth;
@@global.max_sp_recursion_depth
0
...
...
@@ -84,6 +86,8 @@ SELECT @@global.max_sp_recursion_depth;
@@global.max_sp_recursion_depth
255
SET @@global.max_sp_recursion_depth = -1;
Warnings:
Warning 1292 Truncated incorrect max_sp_recursion_depth value: '-1'
SELECT @@global.max_sp_recursion_depth;
@@global.max_sp_recursion_depth
0
...
...
@@ -110,6 +114,8 @@ SELECT @@session.max_sp_recursion_depth;
@@session.max_sp_recursion_depth
255
SET @@session.max_sp_recursion_depth = -1;
Warnings:
Warning 1292 Truncated incorrect max_sp_recursion_depth value: '-1'
SELECT @@session.max_sp_recursion_depth;
@@session.max_sp_recursion_depth
0
...
...
@@ -120,6 +126,8 @@ SELECT @@session.max_sp_recursion_depth;
@@session.max_sp_recursion_depth
255
SET @@session.max_sp_recursion_depth = -001;
Warnings:
Warning 1292 Truncated incorrect max_sp_recursion_depth value: '-1'
SELECT @@session.max_sp_recursion_depth;
@@session.max_sp_recursion_depth
0
...
...
mysql-test/suite/sys_vars/r/myisam_data_pointer_size_basic.result
View file @
fe09326e
...
...
@@ -48,7 +48,7 @@ ERROR HY000: Variable 'myisam_data_pointer_size' is a GLOBAL variable and should
'#------------------FN_DYNVARS_093_05-----------------------#'
SET @@global.myisam_data_pointer_size = -1;
Warnings:
Warning 1292 Truncated incorrect myisam_data_pointer_size value: '
0
'
Warning 1292 Truncated incorrect myisam_data_pointer_size value: '
-1
'
SELECT @@global.myisam_data_pointer_size;
@@global.myisam_data_pointer_size
2
...
...
mysql-test/suite/sys_vars/r/net_buffer_length_basic.result
View file @
fe09326e
...
...
@@ -50,7 +50,7 @@ SELECT @@global.net_buffer_length;
1024
SET @@global.net_buffer_length = -1024;
Warnings:
Warning 1292 Truncated incorrect net_buffer_length value: '
0
'
Warning 1292 Truncated incorrect net_buffer_length value: '
-1024
'
SELECT @@global.net_buffer_length;
@@global.net_buffer_length
1024
...
...
mysql-test/suite/sys_vars/r/net_read_timeout_basic.result
View file @
fe09326e
...
...
@@ -61,7 +61,7 @@ SELECT @@global.net_read_timeout;
1
SET @@global.net_read_timeout = -1024;
Warnings:
Warning 1292 Truncated incorrect net_read_timeout value: '
0
'
Warning 1292 Truncated incorrect net_read_timeout value: '
-1024
'
SELECT @@global.net_read_timeout;
@@global.net_read_timeout
1
...
...
@@ -89,7 +89,7 @@ SELECT @@session.net_read_timeout;
1
SET @@session.net_read_timeout = -2;
Warnings:
Warning 1292 Truncated incorrect net_read_timeout value: '
0
'
Warning 1292 Truncated incorrect net_read_timeout value: '
-2
'
SELECT @@session.net_read_timeout;
@@session.net_read_timeout
1
...
...
mysql-test/suite/sys_vars/r/net_write_timeout_basic.result
View file @
fe09326e
...
...
@@ -61,7 +61,7 @@ SELECT @@global.net_write_timeout;
1
SET @@global.net_write_timeout = -1024;
Warnings:
Warning 1292 Truncated incorrect net_write_timeout value: '
0
'
Warning 1292 Truncated incorrect net_write_timeout value: '
-1024
'
SELECT @@global.net_write_timeout;
@@global.net_write_timeout
1
...
...
@@ -89,7 +89,7 @@ SELECT @@session.net_write_timeout;
1
SET @@session.net_write_timeout = -2;
Warnings:
Warning 1292 Truncated incorrect net_write_timeout value: '
0
'
Warning 1292 Truncated incorrect net_write_timeout value: '
-2
'
SELECT @@session.net_write_timeout;
@@session.net_write_timeout
1
...
...
mysql-test/suite/sys_vars/r/optimizer_prune_level_basic.result
View file @
fe09326e
...
...
@@ -81,6 +81,8 @@ ERROR 42000: Incorrect argument type to variable 'optimizer_prune_level'
SET @@global.optimizer_prune_level = FELSE;
ERROR 42000: Incorrect argument type to variable 'optimizer_prune_level'
SET @@global.optimizer_prune_level = -1024;
Warnings:
Warning 1292 Truncated incorrect optimizer_prune_level value: '-1024'
SELECT @@global.optimizer_prune_level;
@@global.optimizer_prune_level
0
...
...
@@ -107,6 +109,8 @@ ERROR 42000: Incorrect argument type to variable 'optimizer_prune_level'
SET @@session.optimizer_prune_level = 'OFN';
ERROR 42000: Incorrect argument type to variable 'optimizer_prune_level'
SET @@session.optimizer_prune_level = -2;
Warnings:
Warning 1292 Truncated incorrect optimizer_prune_level value: '-2'
SELECT @@session.optimizer_prune_level;
@@session.optimizer_prune_level
0
...
...
mysql-test/suite/sys_vars/r/optimizer_search_depth_basic.result
View file @
fe09326e
...
...
@@ -72,6 +72,8 @@ SELECT @@global.optimizer_search_depth;
@@global.optimizer_search_depth
63
SET @@global.optimizer_search_depth = -1;
Warnings:
Warning 1292 Truncated incorrect optimizer_search_depth value: '-1'
SELECT @@global.optimizer_search_depth;
@@global.optimizer_search_depth
0
...
...
@@ -98,6 +100,8 @@ SELECT @@session.optimizer_search_depth;
@@session.optimizer_search_depth
63
SET @@session.optimizer_search_depth = -2;
Warnings:
Warning 1292 Truncated incorrect optimizer_search_depth value: '-2'
SELECT @@session.optimizer_search_depth;
@@session.optimizer_search_depth
0
...
...
mysql-test/suite/sys_vars/r/preload_buffer_size_basic.result
View file @
fe09326e
...
...
@@ -77,7 +77,7 @@ SELECT @@global.preload_buffer_size;
1024
SET @@global.preload_buffer_size = -1;
Warnings:
Warning 1292 Truncated incorrect preload_buffer_size value: '
0
'
Warning 1292 Truncated incorrect preload_buffer_size value: '
-1
'
SELECT @@global.preload_buffer_size;
@@global.preload_buffer_size
1024
...
...
@@ -111,7 +111,7 @@ SELECT @@session.preload_buffer_size;
1024
SET @@session.preload_buffer_size = -2;
Warnings:
Warning 1292 Truncated incorrect preload_buffer_size value: '
0
'
Warning 1292 Truncated incorrect preload_buffer_size value: '
-2
'
SELECT @@session.preload_buffer_size;
@@session.preload_buffer_size
1024
...
...
mysql-test/suite/sys_vars/r/read_buffer_size_basic.result
View file @
fe09326e
...
...
@@ -81,7 +81,7 @@ SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ;
1
SET @@global.read_buffer_size = -1024;
Warnings:
Warning 1292 Truncated incorrect read_buffer_size value: '
0
'
Warning 1292 Truncated incorrect read_buffer_size value: '
-1024
'
SELECT @@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228 ;
@@global.read_buffer_size= 8200 OR @@global.read_buffer_size= 8228
1
...
...
@@ -109,7 +109,7 @@ SELECT @@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228 ;
1
SET @@session.read_buffer_size = -2;
Warnings:
Warning 1292 Truncated incorrect read_buffer_size value: '
0
'
Warning 1292 Truncated incorrect read_buffer_size value: '
-2
'
SELECT @@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228 ;
@@session.read_buffer_size= 8200 OR @@session.read_buffer_size= 8228
1
...
...
mysql-test/suite/sys_vars/r/read_rnd_buffer_size_basic.result
View file @
fe09326e
...
...
@@ -83,7 +83,7 @@ SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 822
1
SET @@global.read_rnd_buffer_size = -1024;
Warnings:
Warning 1292 Truncated incorrect read_rnd_buffer_size value: '
0
'
Warning 1292 Truncated incorrect read_rnd_buffer_size value: '
-1024
'
SELECT @@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228;
@@global.read_rnd_buffer_size= 8200 OR @@global.read_rnd_buffer_size= 8228
1
...
...
@@ -111,7 +111,7 @@ SELECT @@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8
1
SET @@session.read_rnd_buffer_size = -2;
Warnings:
Warning 1292 Truncated incorrect read_rnd_buffer_size value: '
0
'
Warning 1292 Truncated incorrect read_rnd_buffer_size value: '
-2
'
SELECT @@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228;
@@session.read_rnd_buffer_size= 8200 OR @@session.read_rnd_buffer_size= 8228
1
...
...
mysql-test/suite/sys_vars/r/slave_net_timeout_basic.result
View file @
fe09326e
...
...
@@ -58,13 +58,13 @@ ERROR HY000: Variable 'slave_net_timeout' is a GLOBAL variable and should be set
'#------------------FN_DYNVARS_146_05-----------------------#'
SET @@global.slave_net_timeout = -1;
Warnings:
Warning 1292 Truncated incorrect slave_net_timeout value: '
0
'
Warning 1292 Truncated incorrect slave_net_timeout value: '
-1
'
SELECT @@global.slave_net_timeout;
@@global.slave_net_timeout
1
SET @@global.slave_net_timeout = -2147483648;
Warnings:
Warning 1292 Truncated incorrect slave_net_timeout value: '
0
'
Warning 1292 Truncated incorrect slave_net_timeout value: '
-2147483648
'
SELECT @@global.slave_net_timeout;
@@global.slave_net_timeout
1
...
...
mysql-test/suite/sys_vars/r/slow_launch_time_basic.result
View file @
fe09326e
...
...
@@ -36,6 +36,8 @@ SELECT @@global.slow_launch_time;
65536
'#--------------------FN_DYNVARS_150_04-------------------------#'
SET @@global.slow_launch_time = -1;
Warnings:
Warning 1292 Truncated incorrect slow_launch_time value: '-1'
SELECT @@global.slow_launch_time;
@@global.slow_launch_time
0
...
...
@@ -57,6 +59,8 @@ SELECT @@global.slow_launch_time;
@@global.slow_launch_time
31536000
SET @@global.slow_launch_time = -1024;
Warnings:
Warning 1292 Truncated incorrect slow_launch_time value: '-1024'
SELECT @@global.slow_launch_time;
@@global.slow_launch_time
0
...
...
mysql-test/suite/sys_vars/r/table_definition_cache_basic.result
View file @
fe09326e
...
...
@@ -45,7 +45,7 @@ SELECT @@global.table_definition_cache;
256
SET @@global.table_definition_cache = -1024;
Warnings:
Warning 1292 Truncated incorrect table_definition_cache value: '
0
'
Warning 1292 Truncated incorrect table_definition_cache value: '
-1024
'
SELECT @@global.table_definition_cache;
@@global.table_definition_cache
256
...
...
mysql-test/suite/sys_vars/r/table_lock_wait_timeout_basic.result
View file @
fe09326e
...
...
@@ -37,13 +37,13 @@ SELECT @@global.table_lock_wait_timeout ;
'#--------------------FN_DYNVARS_001_04-------------------------#'
SET @@global.table_lock_wait_timeout = -1;
Warnings:
Warning 1292 Truncated incorrect table_lock_wait_timeout value: '
0
'
Warning 1292 Truncated incorrect table_lock_wait_timeout value: '
-1
'
SET @@global.table_lock_wait_timeout= 100000000000;
Warnings:
Warning 1292 Truncated incorrect table_lock_wait_timeout value: '100000000000'
SET @@global.table_lock_wait_timeout= -1024;
Warnings:
Warning 1292 Truncated incorrect table_lock_wait_timeout value: '
0
'
Warning 1292 Truncated incorrect table_lock_wait_timeout value: '
-1024
'
SET @@global.table_lock_wait_timeout= 0;
Warnings:
Warning 1292 Truncated incorrect table_lock_wait_timeout value: '0'
...
...
mysql-test/suite/sys_vars/r/table_open_cache_basic.result
View file @
fe09326e
...
...
@@ -39,7 +39,7 @@ SELECT @@global.table_open_cache ;
'#--------------------FN_DYNVARS_001_04-------------------------#'
SET @@global.table_open_cache = -1;
Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '
0
'
Warning 1292 Truncated incorrect table_open_cache value: '
-1
'
SELECT @@global.table_open_cache ;
@@global.table_open_cache
1
...
...
@@ -51,7 +51,7 @@ SELECT @@global.table_open_cache ;
524288
SET @@global.table_open_cache = -1024;
Warnings:
Warning 1292 Truncated incorrect table_open_cache value: '
0
'
Warning 1292 Truncated incorrect table_open_cache value: '
-1024
'
SELECT @@global.table_open_cache ;
@@global.table_open_cache
1
...
...
mysql-test/t/variables.test
View file @
fe09326e
...
...
@@ -1079,3 +1079,38 @@ SET @@session.thread_stack= 7;
--
error
ER_INCORRECT_GLOBAL_LOCAL_VAR
SET
@@
global
.
thread_stack
=
7
;
#
#
# Bug #40657 - assertion with out of range variables and traditional sql_mode
#
SELECT
@@
global
.
expire_logs_days
INTO
@
old_eld
;
SET
GLOBAL
expire_logs_days
=
-
1
;
--
echo
needs
to
've been adjusted (0)
SELECT @@global.expire_logs_days;
SET GLOBAL expire_logs_days = 11;
SET @old_mode=@@sql_mode;
SET SESSION sql_mode = '
TRADITIONAL
';
--error ER_WRONG_VALUE_FOR_VAR
SET GLOBAL expire_logs_days = 100;
--echo needs to be unchanged (11)
SELECT @@global.expire_logs_days;
SET SESSION sql_mode = @old_mode;
SET GLOBAL expire_logs_days = 100;
--echo needs to'
ve
been
adjusted
(
99
)
SELECT
@@
global
.
expire_logs_days
;
SET
GLOBAL
expire_logs_days
=
11
;
SET
GLOBAL
expire_logs_days
=
99
;
--
echo
needs
to
pass
with
no
warnings
(
99
)
SELECT
@@
global
.
expire_logs_days
;
# cleanup
SET
GLOBAL
expire_logs_days
=
@
old_eld
;
--
echo
End
of
5.1
tests
sql/set_var.cc
View file @
fe09326e
...
...
@@ -134,8 +134,6 @@ static int check_max_delayed_threads(THD *thd, set_var *var);
static
void
fix_thd_mem_root
(
THD
*
thd
,
enum_var_type
type
);
static
void
fix_trans_mem_root
(
THD
*
thd
,
enum_var_type
type
);
static
void
fix_server_id
(
THD
*
thd
,
enum_var_type
type
);
static
ulonglong
fix_unsigned
(
THD
*
,
ulonglong
,
const
struct
my_option
*
);
static
bool
get_unsigned
(
THD
*
thd
,
set_var
*
var
);
bool
throw_bounds_warning
(
THD
*
thd
,
bool
fixed
,
bool
unsignd
,
const
char
*
name
,
longlong
val
);
static
KEY_CACHE
*
create_key_cache
(
const
char
*
name
,
uint
length
);
...
...
@@ -1370,6 +1368,19 @@ static void fix_server_id(THD *thd, enum_var_type type)
}
/**
Throw warning (error in STRICT mode) if value for variable needed bounding.
Only call from check(), not update(), because an error in update() would be
bad mojo. Plug-in interface also uses this.
@param thd thread handle
@param fixed did we have to correct the value? (throw warn/err if so)
@param unsignd is value's type unsigned?
@param name variable's name
@param val variable's value
@retval TRUE on error, FALSE otherwise (warning or OK)
*/
bool
throw_bounds_warning
(
THD
*
thd
,
bool
fixed
,
bool
unsignd
,
const
char
*
name
,
longlong
val
)
{
...
...
@@ -1395,26 +1406,128 @@ bool throw_bounds_warning(THD *thd, bool fixed, bool unsignd,
return
FALSE
;
}
static
ulonglong
fix_unsigned
(
THD
*
thd
,
ulonglong
num
,
/**
check an unsigned user-supplied value for a systemvariable against bounds.
TODO: This is a wrapper function to call clipping from within an update()
function. Calling bounds from within update() is fair game in theory,
but we can only send warnings from in there, not errors, and besides,
it violates our model of separating check from update phase.
To avoid breaking out of the server with an ASSERT() in strict mode,
we pretend we're not in strict mode when we go through here. Bug#43233
was opened to remind us to replace this kludge with The Right Thing,
which of course is to do the check in the actual check phase, and then
throw an error or warning accordingly.
@param thd thread handle
@param num the value to limit
@param option_limits the bounds-record, or NULL if none
*/
static
void
bound_unsigned
(
THD
*
thd
,
ulonglong
*
num
,
const
struct
my_option
*
option_limits
)
{
my_bool
fixed
=
FALSE
;
ulonglong
out
=
getopt_ull_limit_value
(
num
,
option_limits
,
&
fixed
);
if
(
option_limits
)
{
my_bool
fixed
=
FALSE
;
ulonglong
unadjusted
=
*
num
;
*
num
=
getopt_ull_limit_value
(
unadjusted
,
option_limits
,
&
fixed
);
throw_bounds_warning
(
thd
,
fixed
,
TRUE
,
option_limits
->
name
,
(
longlong
)
num
);
return
out
;
if
(
fixed
)
{
ulong
ssm
=
thd
->
variables
.
sql_mode
;
thd
->
variables
.
sql_mode
&=
~
MODE_STRICT_ALL_TABLES
;
throw_bounds_warning
(
thd
,
fixed
,
TRUE
,
option_limits
->
name
,
unadjusted
);
thd
->
variables
.
sql_mode
=
ssm
;
}
}
}
static
bool
get_unsigned
(
THD
*
thd
,
set_var
*
var
)
/**
Get unsigned system-variable.
Negative value does not wrap around, but becomes zero.
Check user-supplied value for a systemvariable against bounds.
If we needed to adjust the value, throw a warning or error depending
on SQL-mode.
@param thd thread handle
@param var the system-variable to get
@param user_max a limit given with --maximum-variable-name=... or 0
@param bound2ulong pass TRUE if size is ulong, not ulonglong. function
will then bound on systems where it's necessary.
@retval TRUE on error, FALSE otherwise (warning or OK)
*/
static
bool
get_unsigned
(
THD
*
thd
,
set_var
*
var
,
ulonglong
user_max
,
my_bool
bound2ulong
)
{
int
warnings
=
0
;
ulonglong
unadjusted
;
const
struct
my_option
*
limits
=
var
->
var
->
option_limits
;
struct
my_option
fallback
;
/* get_unsigned() */
if
(
var
->
value
->
unsigned_flag
)
var
->
save_result
.
ulonglong_value
=
(
ulonglong
)
var
->
value
->
val_int
();
else
{
longlong
v
=
var
->
value
->
val_int
();
var
->
save_result
.
ulonglong_value
=
(
ulonglong
)
((
v
<
0
)
?
0
:
v
);
if
(
v
<
0
)
{
warnings
++
;
if
(
throw_bounds_warning
(
thd
,
TRUE
,
FALSE
,
var
->
var
->
name
,
v
))
return
TRUE
;
/* warning was promoted to error, give up */
}
return
0
;
}
unadjusted
=
var
->
save_result
.
ulonglong_value
;
/* max, if any */
if
((
user_max
>
0
)
&&
(
unadjusted
>
user_max
))
{
var
->
save_result
.
ulonglong_value
=
user_max
;
if
((
warnings
==
0
)
&&
throw_bounds_warning
(
thd
,
TRUE
,
TRUE
,
var
->
var
->
name
,
(
longlong
)
unadjusted
))
return
TRUE
;
warnings
++
;
}
/*
if the sysvar doesn't have a proper bounds record but the check
function would like bounding to ULONG where its size differs from
that of ULONGLONG, we make up a bogus limits record here and let
the usual suspects handle the actual limiting.
*/
if
(
!
limits
&&
bound2ulong
)
{
bzero
(
&
fallback
,
sizeof
(
fallback
));
fallback
.
var_type
=
GET_ULONG
;
limits
=
&
fallback
;
}
/* fix_unsigned() */
if
(
limits
)
{
my_bool
fixed
;
var
->
save_result
.
ulonglong_value
=
getopt_ull_limit_value
(
var
->
save_result
.
ulonglong_value
,
limits
,
&
fixed
);
if
((
warnings
==
0
)
&&
throw_bounds_warning
(
thd
,
fixed
,
TRUE
,
limits
->
name
,
(
longlong
)
unadjusted
))
return
TRUE
;
}
return
FALSE
;
}
...
...
@@ -1428,29 +1541,13 @@ sys_var_long_ptr(sys_var_chain *chain, const char *name_arg, ulong *value_ptr_ar
bool
sys_var_long_ptr_global
::
check
(
THD
*
thd
,
set_var
*
var
)
{
return
get_unsigned
(
thd
,
var
);
return
get_unsigned
(
thd
,
var
,
0
,
TRUE
);
}
bool
sys_var_long_ptr_global
::
update
(
THD
*
thd
,
set_var
*
var
)
{
ulonglong
tmp
=
var
->
save_result
.
ulonglong_value
;
pthread_mutex_lock
(
guard
);
if
(
option_limits
)
*
value
=
(
ulong
)
fix_unsigned
(
thd
,
tmp
,
option_limits
);
else
{
#if SIZEOF_LONG < SIZEOF_LONG_LONG
/* Avoid overflows on 32 bit systems */
if
(
tmp
>
ULONG_MAX
)
{
tmp
=
ULONG_MAX
;
throw_bounds_warning
(
thd
,
TRUE
,
TRUE
,
name
,
(
longlong
)
var
->
save_result
.
ulonglong_value
);
}
#endif
*
value
=
(
ulong
)
tmp
;
}
*
value
=
(
ulong
)
var
->
save_result
.
ulonglong_value
;
pthread_mutex_unlock
(
guard
);
return
0
;
}
...
...
@@ -1470,9 +1567,7 @@ bool sys_var_ulonglong_ptr::update(THD *thd, set_var *var)
{
ulonglong
tmp
=
var
->
save_result
.
ulonglong_value
;
pthread_mutex_lock
(
&
LOCK_global_system_variables
);
if
(
option_limits
)
*
value
=
(
ulonglong
)
fix_unsigned
(
thd
,
tmp
,
option_limits
);
else
bound_unsigned
(
thd
,
&
tmp
,
option_limits
);
*
value
=
(
ulonglong
)
tmp
;
pthread_mutex_unlock
(
&
LOCK_global_system_variables
);
return
0
;
...
...
@@ -1523,36 +1618,18 @@ uchar *sys_var_enum_const::value_ptr(THD *thd, enum_var_type type,
bool
sys_var_thd_ulong
::
check
(
THD
*
thd
,
set_var
*
var
)
{
return
(
get_unsigned
(
thd
,
var
)
||
(
check_func
&&
(
*
check_func
)(
thd
,
var
)));
if
(
get_unsigned
(
thd
,
var
,
max_system_variables
.
*
offset
,
TRUE
))
return
TRUE
;
DBUG_ASSERT
(
var
->
save_result
.
ulonglong_value
<=
ULONG_MAX
);
return
((
check_func
&&
(
*
check_func
)(
thd
,
var
)));
}
bool
sys_var_thd_ulong
::
update
(
THD
*
thd
,
set_var
*
var
)
{
ulonglong
tmp
=
var
->
save_result
.
ulonglong_value
;
/* Don't use bigger value than given with --maximum-variable-name=.. */
if
(
tmp
>
max_system_variables
.
*
offset
)
{
throw_bounds_warning
(
thd
,
TRUE
,
TRUE
,
name
,
(
longlong
)
tmp
);
tmp
=
max_system_variables
.
*
offset
;
}
if
(
option_limits
)
tmp
=
fix_unsigned
(
thd
,
tmp
,
option_limits
);
#if SIZEOF_LONG < SIZEOF_LONG_LONG
else
if
(
tmp
>
ULONG_MAX
)
{
tmp
=
ULONG_MAX
;
throw_bounds_warning
(
thd
,
TRUE
,
TRUE
,
name
,
(
longlong
)
var
->
save_result
.
ulonglong_value
);
}
#endif
DBUG_ASSERT
(
tmp
<=
ULONG_MAX
);
if
(
var
->
type
==
OPT_GLOBAL
)
global_system_variables
.
*
offset
=
(
ulong
)
tmp
;
global_system_variables
.
*
offset
=
(
ulong
)
var
->
save_result
.
ulonglong_value
;
else
thd
->
variables
.
*
offset
=
(
ulong
)
tmp
;
thd
->
variables
.
*
offset
=
(
ulong
)
var
->
save_result
.
ulonglong_value
;
return
0
;
}
...
...
@@ -1590,8 +1667,8 @@ bool sys_var_thd_ha_rows::update(THD *thd, set_var *var)
if
((
ha_rows
)
tmp
>
max_system_variables
.
*
offset
)
tmp
=
max_system_variables
.
*
offset
;
if
(
option_limits
)
tmp
=
(
ha_rows
)
fix_unsigned
(
thd
,
tmp
,
option_limits
);
bound_unsigned
(
thd
,
&
tmp
,
option_limits
);
if
(
var
->
type
==
OPT_GLOBAL
)
{
/* Lock is needed to make things safe on 32 bit systems */
...
...
@@ -1632,27 +1709,21 @@ uchar *sys_var_thd_ha_rows::value_ptr(THD *thd, enum_var_type type,
bool
sys_var_thd_ulonglong
::
check
(
THD
*
thd
,
set_var
*
var
)
{
return
get_unsigned
(
thd
,
var
);
return
get_unsigned
(
thd
,
var
,
max_system_variables
.
*
offset
,
FALSE
);
}
bool
sys_var_thd_ulonglong
::
update
(
THD
*
thd
,
set_var
*
var
)
{
ulonglong
tmp
=
var
->
save_result
.
ulonglong_value
;
if
(
tmp
>
max_system_variables
.
*
offset
)
tmp
=
max_system_variables
.
*
offset
;
if
(
option_limits
)
tmp
=
fix_unsigned
(
thd
,
tmp
,
option_limits
);
if
(
var
->
type
==
OPT_GLOBAL
)
{
/* Lock is needed to make things safe on 32 bit systems */
pthread_mutex_lock
(
&
LOCK_global_system_variables
);
global_system_variables
.
*
offset
=
(
ulonglong
)
tmp
;
global_system_variables
.
*
offset
=
(
ulonglong
)
var
->
save_result
.
ulonglong_value
;
pthread_mutex_unlock
(
&
LOCK_global_system_variables
);
}
else
thd
->
variables
.
*
offset
=
(
ulonglong
)
tmp
;
thd
->
variables
.
*
offset
=
(
ulonglong
)
var
->
save_result
.
ulonglong_value
;
return
0
;
}
...
...
@@ -2284,10 +2355,10 @@ bool sys_var_key_buffer_size::update(THD *thd, set_var *var)
goto
end
;
}
key_cache
->
param_buff_size
=
(
ulonglong
)
fix_unsigned
(
thd
,
tmp
,
option_limits
)
;
bound_unsigned
(
thd
,
&
tmp
,
option_limits
);
key_cache
->
param_buff_size
=
(
ulonglong
)
tmp
;
/* If key cache didn't exist
ed
initialize it, else resize it */
/* If key cache didn't exist initialize it, else resize it */
key_cache
->
in_init
=
1
;
pthread_mutex_unlock
(
&
LOCK_global_system_variables
);
...
...
@@ -2313,7 +2384,7 @@ bool sys_var_key_buffer_size::update(THD *thd, set_var *var)
*/
bool
sys_var_key_cache_long
::
update
(
THD
*
thd
,
set_var
*
var
)
{
ulong
tmp
=
(
ulong
)
var
->
value
->
val_int
();
ulong
long
tmp
=
(
ulonglong
)
(
ulong
)
var
->
value
->
val_int
();
LEX_STRING
*
base_name
=
&
var
->
base
;
bool
error
=
0
;
...
...
@@ -2338,8 +2409,8 @@ bool sys_var_key_cache_long::update(THD *thd, set_var *var)
if
(
key_cache
->
in_init
)
goto
end
;
*
((
ulong
*
)
(((
char
*
)
key_cache
)
+
offset
))
=
(
ulong
)
fix_unsigned
(
thd
,
tmp
,
option_limits
)
;
bound_unsigned
(
thd
,
&
tmp
,
option_limits
);
*
((
ulong
*
)
(((
char
*
)
key_cache
)
+
offset
))
=
(
ulong
)
tmp
;
/*
Don't create a new key cache if it didn't exist
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment