summaryrefslogtreecommitdiff
path: root/sql/set_var.cc
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@sun.com>2009-10-28 10:55:44 +0300
committerAlexander Nozdrin <alik@sun.com>2009-10-28 10:55:44 +0300
commitac7ba1bcaac891b046ad028e035487da44448eeb (patch)
tree76a0977cebe3775f61ae3281cc608601eb883243 /sql/set_var.cc
parentf89b2496ffdf96d1d4b32099d38ce0565ac1d93a (diff)
parent273a0a4f97ea07620675cba1f61e84dd83c21a2f (diff)
downloadmariadb-git-ac7ba1bcaac891b046ad028e035487da44448eeb.tar.gz
Merge from mysql-next-mr.
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r--sql/set_var.cc28
1 files changed, 26 insertions, 2 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc
index 63a73909392..32ac78f96ed 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -1546,6 +1546,23 @@ static bool get_unsigned(THD *thd, set_var *var, ulonglong user_max,
}
+bool sys_var_uint_ptr::check(THD *thd, set_var *var)
+{
+ var->save_result.ulong_value= (ulong) var->value->val_uint();
+ return 0;
+}
+
+bool sys_var_uint_ptr::update(THD *thd, set_var *var)
+{
+ *value= (uint) var->save_result.ulong_value;
+ return 0;
+}
+
+void sys_var_uint_ptr::set_default(THD *thd, enum_var_type type)
+{
+ *value= (uint) option_limits->def_value;
+}
+
sys_var_long_ptr::
sys_var_long_ptr(sys_var_chain *chain, const char *name_arg, ulong *value_ptr_arg,
sys_after_update_func after_update_arg)
@@ -3146,6 +3163,15 @@ static bool set_option_autocommit(THD *thd, set_var *var)
ulonglong org_options= thd->options;
+ /*
+ If we are setting AUTOCOMMIT=1 and it was not already 1, then we
+ need to commit any outstanding transactions.
+ */
+ if (var->save_result.ulong_value != 0 &&
+ (thd->options & OPTION_NOT_AUTOCOMMIT) &&
+ ha_commit(thd))
+ return 1;
+
if (var->save_result.ulong_value != 0)
thd->options&= ~((sys_var_thd_bit*) var->var)->bit_flag;
else
@@ -3159,8 +3185,6 @@ static bool set_option_autocommit(THD *thd, set_var *var)
thd->options&= ~(ulonglong) (OPTION_BEGIN | OPTION_KEEP_LOG);
thd->transaction.all.modified_non_trans_table= FALSE;
thd->server_status|= SERVER_STATUS_AUTOCOMMIT;
- if (ha_commit(thd))
- return 1;
}
else
{