mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug#40657: assertion with out of range variables and traditional sql_mode
In STRICT mode, out-of-bounds values caused an error message to be queued (rather than just a warning), without any further error-like processing happening. (The error is queued during update, at which time it's too late. For it to be processed properly, it would need to be queued during check-stage.) The assertion rightfully complains that we're trying to send an OK while having an error queued. Changeset breaks a lot of tests out into check-stage. This also allows us to send more correct warnings/error messages.
This commit is contained in:
@ -703,7 +703,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
|
||||
@ -1337,3 +1337,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
|
||||
|
Reference in New Issue
Block a user