diff options
author | bell@sanja.is.com.ua <> | 2004-04-08 00:19:43 +0300 |
---|---|---|
committer | bell@sanja.is.com.ua <> | 2004-04-08 00:19:43 +0300 |
commit | 56be6f3f9325f056b5343fc9a4a122f30e280d12 (patch) | |
tree | 8623a46473c8c2cb769c792a41b7a28bae698da7 /sql/set_var.cc | |
parent | 3b6c3dd2f5b2416a02b0a878187e977d9bf1d044 (diff) | |
parent | 5e37c41faee13cdc977842d253e6da0266766baf (diff) | |
download | mariadb-git-56be6f3f9325f056b5343fc9a4a122f30e280d12.tar.gz |
merge
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r-- | sql/set_var.cc | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc index f47e013eb94..54f2d75d6a8 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -2529,6 +2529,24 @@ int set_var::check(THD *thd) } +int set_var::light_check(THD *thd) +{ + if (var->check_type(type)) + { + my_error(type == OPT_GLOBAL ? ER_LOCAL_VARIABLE : ER_GLOBAL_VARIABLE, + MYF(0), + var->name); + return -1; + } + if ((type == OPT_GLOBAL && check_global_access(thd, SUPER_ACL))) + return 1; + + if (value && (value->fix_fields(thd, 0, &value) || value->check_cols(1))) + return -1; + return 0; +} + + int set_var::update(THD *thd) { if (!value) @@ -2556,6 +2574,16 @@ int set_var_user::check(THD *thd) } +int set_var_user::light_check(THD *thd) +{ + /* + Item_func_set_user_var can't substitute something else on its place => + 0 can be passed as last argument (reference on item) + */ + return (user_var_item->fix_fields(thd, 0, (Item**) 0)); +} + + int set_var_user::update(THD *thd) { if (user_var_item->update()) |