mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
merge some docs changes and a test case; null merge the code.
(we don't need to port the actual code from 5.1; 5.5+ do the relevant things differently, but correctly. the test obviously is so it stays that way.)
This commit is contained in:
@ -1511,6 +1511,39 @@ SELECT @@skip_name_resolve;
|
||||
SHOW VARIABLES LIKE 'skip_name_resolve';
|
||||
Variable_name Value
|
||||
skip_name_resolve OFF
|
||||
#
|
||||
# Bug #43233 : Some server variables are clipped during "update,"
|
||||
# not "check" stage
|
||||
#
|
||||
SET @kbs=@@global.key_buffer_size;
|
||||
SET @kcbs=@@global.key_cache_block_size;
|
||||
throw errors in STRICT mode
|
||||
SET SQL_MODE=STRICT_ALL_TABLES;
|
||||
SET @@global.max_binlog_cache_size=-1;
|
||||
ERROR 42000: Variable 'max_binlog_cache_size' can't be set to the value of '-1'
|
||||
SET @@global.max_join_size=0;
|
||||
ERROR 42000: Variable 'max_join_size' can't be set to the value of '0'
|
||||
SET @@global.key_buffer_size=0;
|
||||
ERROR HY000: Cannot drop default keycache
|
||||
SET @@global.key_cache_block_size=0;
|
||||
ERROR 42000: Variable 'key_cache_block_size' can't be set to the value of '0'
|
||||
throw warnings in default mode
|
||||
SET SQL_MODE=DEFAULT;
|
||||
SET @@global.max_binlog_cache_size=-1;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_binlog_cache_size value: '-1'
|
||||
SET @@global.max_join_size=0;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect max_join_size value: '0'
|
||||
SET @@global.key_buffer_size=0;
|
||||
ERROR HY000: Cannot drop default keycache
|
||||
SET @@global.key_cache_block_size=0;
|
||||
Warnings:
|
||||
Warning 1292 Truncated incorrect key_cache_block_size value: '0'
|
||||
SET @@global.max_binlog_cache_size=DEFAULT;
|
||||
SET @@global.max_join_size=DEFAULT;
|
||||
SET @@global.key_buffer_size=@kbs;
|
||||
SET @@global.key_cache_block_size=@kcbs;
|
||||
End of 5.1 tests
|
||||
|
||||
#
|
||||
|
@ -1243,6 +1243,50 @@ SET GLOBAL max_binlog_cache_size = @old_max_binlog_cache_size;
|
||||
SELECT @@skip_name_resolve;
|
||||
SHOW VARIABLES LIKE 'skip_name_resolve';
|
||||
|
||||
--echo #
|
||||
--echo # Bug #43233 : Some server variables are clipped during "update,"
|
||||
--echo # not "check" stage
|
||||
--echo #
|
||||
|
||||
SET @kbs=@@global.key_buffer_size;
|
||||
SET @kcbs=@@global.key_cache_block_size;
|
||||
|
||||
--echo throw errors in STRICT mode
|
||||
SET SQL_MODE=STRICT_ALL_TABLES;
|
||||
|
||||
# sys_var_ulonglong_ptr: sys_max_binlog_cache_size
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
SET @@global.max_binlog_cache_size=-1;
|
||||
|
||||
# sys_var_thd_ha_rows: "max_join_size" et al.
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
SET @@global.max_join_size=0;
|
||||
|
||||
# sys_var_key_buffer_size: "key_buffer_size"
|
||||
--error ER_WARN_CANT_DROP_DEFAULT_KEYCACHE
|
||||
SET @@global.key_buffer_size=0;
|
||||
|
||||
# sys_var_key_cache_long: "key_cache_block_size" et al.
|
||||
--error ER_WRONG_VALUE_FOR_VAR
|
||||
SET @@global.key_cache_block_size=0;
|
||||
|
||||
--echo throw warnings in default mode
|
||||
SET SQL_MODE=DEFAULT;
|
||||
|
||||
SET @@global.max_binlog_cache_size=-1;
|
||||
SET @@global.max_join_size=0;
|
||||
# this is an exception. since this is a new error/warning, let's stay
|
||||
# compatible with the upcoming 5.6.
|
||||
--error ER_WARN_CANT_DROP_DEFAULT_KEYCACHE
|
||||
SET @@global.key_buffer_size=0;
|
||||
SET @@global.key_cache_block_size=0;
|
||||
|
||||
# cleanup
|
||||
SET @@global.max_binlog_cache_size=DEFAULT;
|
||||
SET @@global.max_join_size=DEFAULT;
|
||||
SET @@global.key_buffer_size=@kbs;
|
||||
SET @@global.key_cache_block_size=@kcbs;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
###########################################################################
|
||||
|
@ -208,14 +208,11 @@ charpos() - calculates the offset of the given position in the string.
|
||||
Used in SQL functions LEFT(), RIGHT(), SUBSTRING(),
|
||||
INSERT()
|
||||
|
||||
well_formed_length()
|
||||
- finds the length of correctly formed multi-byte beginning.
|
||||
Used in INSERTs to cut a beginning of the given string
|
||||
which is
|
||||
a) "well formed" according to the given character set.
|
||||
well_formed_len()
|
||||
- returns length of a given multi-byte string in bytes
|
||||
Used in INSERTs to shorten the given string so it
|
||||
a) is "well formed" according to the given character set
|
||||
b) can fit into the given data type
|
||||
Terminates the string in the good position, taking in account
|
||||
multi-byte character boundaries.
|
||||
|
||||
lengthsp() - returns the length of the given string without trailing spaces.
|
||||
|
||||
|
Reference in New Issue
Block a user