mirror of
https://github.com/MariaDB/server.git
synced 2025-10-31 15:50:51 +03:00
A fix and a test case for Bug#9359 "Prepared statements take snapshot
of system vars at PREPARE time": implement a special Item to handle system variables. This item substitutes itself with a basic constant containing variable value at fix_fields.
This commit is contained in:
@@ -676,3 +676,28 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
|
||||
select ? from t1;
|
||||
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '? from t1' at line 1
|
||||
drop table t1;
|
||||
prepare stmt from "select @@time_zone";
|
||||
execute stmt;
|
||||
@@time_zone
|
||||
SYSTEM
|
||||
set @@time_zone:='Japan';
|
||||
execute stmt;
|
||||
@@time_zone
|
||||
Japan
|
||||
prepare stmt from "select @@tx_isolation";
|
||||
execute stmt;
|
||||
@@tx_isolation
|
||||
REPEATABLE-READ
|
||||
set transaction isolation level read committed;
|
||||
execute stmt;
|
||||
@@tx_isolation
|
||||
READ-COMMITTED
|
||||
set transaction isolation level serializable;
|
||||
execute stmt;
|
||||
@@tx_isolation
|
||||
SERIALIZABLE
|
||||
set @@tx_isolation=default;
|
||||
execute stmt;
|
||||
@@tx_isolation
|
||||
REPEATABLE-READ
|
||||
deallocate prepare stmt;
|
||||
|
||||
Reference in New Issue
Block a user