Bug #58114 NULL value in a system variable is not displayed as such in SHOW VARIABLES/I_S
Submitted: 10 Nov 2010 13:55 Modified: 15 Dec 2010 15:37
Reporter: Georgi Kodinov Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Options Severity:S3 (Non-critical)
Version:5.5 OS:Any
Assigned to: CPU Architecture:Any
Triage: Triaged: D4 (Minor)

[10 Nov 2010 13:55] Georgi Kodinov
Description:
The external_user and the proxy_user variables when not set to non-empty have different values depending on how you retrieve the values.

How to repeat:

mysql> show variables like '%user';
+---------------+-------+
| Variable_name          | Value      |
+---------------+-------+
| external_user            |                 |
| proxy_user                |                  |
| report_user               |                  |
+---------------+-------+
3 rows in set (0.01 sec)

mysql> select @@external_user, @@proxy_user;
+-----------------+--------------+
| @@external_user | @@proxy_user |
+-----------------+--------------+
| NULL            | NULL         |
+-----------------+--------------+
1 row in set (0.00 sec)

Suggested fix:
Make show variables and SELECT @@ return the same value (preferably NULL)
[10 Nov 2010 13:57] Georgi Kodinov
Verified on 5.5-bugteam : 
+select @@version;
+@@version
+5.5.8-rc-debug-log
+show variables like '%user';
+Variable_name  Value
+external_user
+proxy_user
+report_user
+select @@external_user, @@proxy_user;
+@@external_user        @@proxy_user
+NULL   NULL