mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 15:45:33 +02: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. mysql-test/r/ps.result: - test results fixed (Bug#9359). mysql-test/t/ps.test: - add a test case for Bug#9359 "Prepared statements take snapshot of system vars at PREPARE time" sql/item_func.cc: - implement Item_func_get_system_var: we should not evaluate system variables in the parser, but instead should create an item which is evaluated to a constant at execute. - remove an unused function sql/item_func.h: Add a new item, Item_func_get_system_var sql/mysql_priv.h: Move necessary declarations to make set_var.h objects visible in item_func.h sql/set_var.cc: - we should not print to network from get_system_var: if it's called from prepared statement prepare, we get packets out of order when using the binary protocol. Instead report the error to be sent to the user later. This is a backport from 5.0. sql/set_var.h: - declaration of enum_var_type moved to mysql_priv.h
This commit is contained in:
parent
0f41fb4234
commit
e83e105331
7 changed files with 112 additions and 51 deletions
|
|
@ -30,11 +30,6 @@ class set_var;
|
|||
typedef struct system_variables SV;
|
||||
extern TYPELIB bool_typelib, delay_key_write_typelib, sql_mode_typelib;
|
||||
|
||||
enum enum_var_type
|
||||
{
|
||||
OPT_DEFAULT, OPT_SESSION, OPT_GLOBAL
|
||||
};
|
||||
|
||||
typedef int (*sys_check_func)(THD *, set_var *);
|
||||
typedef bool (*sys_update_func)(THD *, set_var *);
|
||||
typedef void (*sys_after_update_func)(THD *,enum_var_type);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue