Bug #38053 "SET SESSION debug = DEFAULT" does nothing
Submitted: 11 Jul 2008 16:25 Modified: 11 Jul 2008 18:16
Reporter: Gleb Shchepa Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.1+ OS:Any
Assigned to: CPU Architecture:Any

[11 Jul 2008 16:25] Gleb Shchepa
Description:
The "SET SESSION debug = DEFAULT" silently fails to change @@debug
variable value:

5.* are not affected.

Server version: 6.0.6-alpha-debug Source distribution

mysql> SET SESSION debug = 'd,blablabla';
Query OK, 0 rows affected (0.02 sec)

mysql> SHOW VARIABLES LIKE "debug";
+---------------+-------------+
| Variable_name | Value       |
+---------------+-------------+
| debug         | d,blablabla | 
+---------------+-------------+
1 row in set (0.00 sec)

mysql> SET SESSION debug = DEFAULT;      
Query OK, 0 rows affected (0.00 sec)

mysql> SHOW VARIABLES LIKE "debug";
+---------------+-------------+
| Variable_name | Value       |
+---------------+-------------+
| debug         | d,blablabla | 
+---------------+-------------+
1 row in set (0.00 sec)

This bug produces unusual failures of test case sequences under
mysql-test-run.pl: one test case fails to restore @@debug value after
a change, and (probably after series of tests) some test sporadically
fails in a weird manner on unexpected DBUG_EXECUTE_IF execution.

How to repeat:
SET SESSION debug = 'd,blablabla';
SET SESSION debug = DEFAULT;
SHOW VARIABLES LIKE "debug";
[11 Jul 2008 16:47] Sveta Smirnova
Thank you for the report.

I have different results with mysql-6.0 tree. Which tree do you use?

Results from my environment:

Mac:

=====mysql-6.0=====
=====bug38053=====
SHOW VARIABLES LIKE 'debug';
Variable_name   Value
debug
SET SESSION debug = 'd,blablabla';
SHOW VARIABLES LIKE 'debug';
Variable_name   Value
debug   d,blablabla
SET SESSION debug = DEFAULT;
SHOW VARIABLES LIKE 'debug';
Variable_name   Value
debug

Linux:

SHOW VARIABLES LIKE 'debug';
Variable_name   Value
debug
SET SESSION debug = 'd,blablabla';
SHOW VARIABLES LIKE 'debug';
Variable_name   Value
debug
SET SESSION debug = DEFAULT;
SHOW VARIABLES LIKE 'debug';
Variable_name   Value
debug
[11 Jul 2008 16:52] Gleb Shchepa
[11 Jul 18:47] Sveta Smirnova

> I have different results with mysql-6.0 tree. Which tree do you use?

current main mysql-6.0,
current mysql-6.0-bugteam, 

Linux x86, debugging build (BUILD/compile-pentium-debug-max).
[11 Jul 2008 17:30] Sveta Smirnova
Thank you for the feedback.

Verified as described with mysql-6.0 tree:

$mysql60
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 6.0.6-alpha-debug Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SHOW VARIABLES LIKE 'debug';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| debug         |       | 
+---------------+-------+
1 row in set (0.03 sec)

mysql> SET SESSION debug = 'd,blablabla';
Query OK, 0 rows affected (0.01 sec)

mysql> SHOW VARIABLES LIKE 'debug';
+---------------+-------------+
| Variable_name | Value       |
+---------------+-------------+
| debug         | d,blablabla | 
+---------------+-------------+
1 row in set (0.00 sec)

mysql> SET SESSION debug = DEFAULT;
Query OK, 0 rows affected (0.00 sec)

mysql> SHOW VARIABLES LIKE 'debug';
+---------------+-------------+
| Variable_name | Value       |
+---------------+-------------+
| debug         | d,blablabla | 
+---------------+-------------+
1 row in set (0.00 sec)

mysql> \q
Bye
[11 Jul 2008 18:11] Gleb Shchepa
5.1 does SET @@debug = DEFAULT in incorrect way too.
[11 Jul 2008 18:16] Gleb Shchepa
Nevertheless it's a duplicate of bug #34243 (and no regression, just different
behavior).