← Back to team overview

maria-developers team mailing list archive

[Branch ~maria-captains/maria/5.1] Rev 2712: Fix of BUG#45632 (http://bugs.mysql.com/bug.php?id=45632) - sharing non default debug settings be...

 

------------------------------------------------------------
revno: 2712
committer: sanja@xxxxxxxxxxxx
branch nick: work-maria-5.1
timestamp: Thu 2009-06-25 01:22:20 +0300
message:
  Fix of BUG#45632 (http://bugs.mysql.com/bug.php?id=45632) - sharing non default debug settings between sessions. This bugfix proposed by Monty.
modified:
  mysql-test/r/variables_debug.result
  mysql-test/t/variables_debug.test
  sql/set_var.cc

=== modified file 'mysql-test/r/variables_debug.result'
--- mysql-test/r/variables_debug.result	2008-02-26 15:03:59 +0000
+++ mysql-test/r/variables_debug.result	2009-06-24 22:22:20 +0000
@@ -10,3 +10,18 @@
 select @@debug;
 @@debug
 T
+set session debug="t";
+show session variables like 'debug';
+Variable_name	Value
+debug	t
+set session debug="t";
+show session variables like 'debug';
+Variable_name	Value
+debug	t
+set session debug="d:t";
+show session variables like 'debug';
+Variable_name	Value
+debug	d:t
+show session variables like 'debug';
+Variable_name	Value
+debug	t

=== modified file 'mysql-test/t/variables_debug.test'
--- mysql-test/t/variables_debug.test	2008-02-26 15:03:59 +0000
+++ mysql-test/t/variables_debug.test	2009-06-24 22:22:20 +0000
@@ -10,3 +10,31 @@
 select @@debug;
 set debug= '-P';
 select @@debug;
+
+#
+# Checks that assigning variable 'debug' in one session has no influence on
+# other session. (BUG#45632 of bugs.mysql.com)
+#
+connect(con1,localhost,root,,test,,);
+connect(con2,localhost,root,,test,,);
+
+# makes output independant of current debug status
+connection con1;
+set session debug="t";
+show session variables like 'debug';
+connection con2;
+set session debug="t";
+show session variables like 'debug';
+
+# checks influence one session debug variable on another
+connection con1;
+set session debug="d:t";
+show session variables like 'debug';
+connection con2;
+show session variables like 'debug';
+
+disconnect con1;
+disconnect con2;
+
+connection default;
+

=== modified file 'sql/set_var.cc'
--- sql/set_var.cc	2009-05-19 09:28:05 +0000
+++ sql/set_var.cc	2009-06-24 22:22:20 +0000
@@ -4231,11 +4231,28 @@
 
 bool sys_var_thd_dbug::update(THD *thd, set_var *var)
 {
+#ifndef DBUG_OFF
+  const char *command= var ? var->value->str_value.c_ptr() : "";
+
   if (var->type == OPT_GLOBAL)
-    DBUG_SET_INITIAL(var ? var->value->str_value.c_ptr() : "");
+    DBUG_SET_INITIAL(command);
   else
-    DBUG_SET(var ? var->value->str_value.c_ptr() : "");
-
+  {
+    if (_db_is_pushed_())
+    {
+      /* We have already a local state done with DBUG_PUSH; Modify the state */
+      DBUG_SET(command);
+    }
+    else
+    {
+      /*
+        We are sharing the state with the global state;
+        Create a local state for this thread.
+      */
+      DBUG_PUSH(command);
+    }
+  }
+#endif
   return 0;
 }
 



--
lp:maria
https://code.launchpad.net/~maria-captains/maria/5.1

Your team Maria developers is subscribed to branch lp:maria.
To unsubscribe from this branch go to https://code.launchpad.net/~maria-captains/maria/5.1/+edit-subscription.