Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.6, 10.11, 11.4, 10.5(EOL), 11.8
-
None
Description
Normally SET works in two steps, first all variables validate the values, if that fails, SET is aborted. Then new values get assigned to variables, and this is expected always to succeed.
But the normal validation step isn't run when assigning a DEFAULT value to a variable. The validation is done during the second, update, step, unexpectedly aborting it in the middle.
For example:
start transaction; |
set @a='did not change'; |
select @a; |
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN
|
set @a='changed', sql_log_bin=1; select @a; |
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN
|
set @a='changed', sql_log_bin=0; select @a; |
--error ER_INSIDE_TRANSACTION_PREVENTS_SWITCH_SQL_LOG_BIN
|
set @a='changed', sql_log_bin=default; select @a; |
The output being
start transaction;
|
set @a='did not change';
|
select @a;
|
@a
|
did not change
|
set @a='changed', sql_log_bin=1;
|
ERROR HY000: Cannot modify @@session.sql_log_bin inside a transaction
|
select @a;
|
@a
|
did not change
|
set @a='changed', sql_log_bin=0;
|
ERROR HY000: Cannot modify @@session.sql_log_bin inside a transaction
|
select @a;
|
@a
|
did not change
|
set @a='changed', sql_log_bin=default;
|
ERROR HY000: Cannot modify @@session.sql_log_bin inside a transaction
|
select @a;
|
@a
|
changed
|
Attachments
Issue Links
- blocks
-
MDEV-36770 plugin variable's check callback isn't invoked for =DEFAULT
-
- Open
-