summaryrefslogtreecommitdiff
path: root/sql/set_var.cc
diff options
context:
space:
mode:
authorSergey Glukhov <Sergey.Glukhov@sun.com>2010-05-20 10:31:03 +0400
committerSergey Glukhov <Sergey.Glukhov@sun.com>2010-05-20 10:31:03 +0400
commitb8af4ab216ea6efd433ebdd2da4911978bd22d88 (patch)
treece44a766fa95b6a55e2402bea5582f6a66e1f16a /sql/set_var.cc
parent7e889a8dc9599fad3987c145cc19ea7f5528f8a6 (diff)
downloadmariadb-git-b8af4ab216ea6efd433ebdd2da4911978bd22d88.tar.gz
Bug#52884 mysql-test-run does not work with --debug option
Server crashes on 64bit linux with 'double free or corruption' message, on 32bit mysql-test-run silently fails on bootstrap stage. The problem is that FreeState() is called twice for init_settings struct in _db_end_ function. The fix is to remove superfluous FreeState() call. Additional fix: fixed discrepancy of result file when debug & valgrind options are enabled for MTR. dbug/dbug.c: The problem is that FreeState() is called twice for init_settings struct in _db_end_ function. The fix is to remove superfluous FreeState() call. mysql-test/r/variables_debug.result: fixed discrepancy of result file when debug & valgrind options are enabled for MTR. mysql-test/t/variables_debug.test: fixed discrepancy of result file when debug & valgrind options are enabled for MTR. sql/set_var.cc: fixed discrepancy of result file when debug & valgrind options are enabled for MTR.
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r--sql/set_var.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc
index f7d9d9df42e..8f0ad93ba43 100644
--- a/sql/set_var.cc
+++ b/sql/set_var.cc
@@ -4239,10 +4239,15 @@ bool sys_var_thd_dbug::check(THD *thd, set_var *var)
bool sys_var_thd_dbug::update(THD *thd, set_var *var)
{
+ char buf[256];
+ String str(buf, sizeof(buf), system_charset_info), *res;
+
+ res= var->value->val_str(&str);
+
if (var->type == OPT_GLOBAL)
- DBUG_SET_INITIAL(var ? var->value->str_value.c_ptr() : "");
+ DBUG_SET_INITIAL(res ? res->c_ptr() : "");
else
- DBUG_SET(var ? var->value->str_value.c_ptr() : "");
+ DBUG_SET(res ? res->c_ptr() : "");
return 0;
}