Bug #77574 SHOW VARIABLES return warning about @@SESSION.GTID_EXECUTED being deprecated
Submitted: 1 Jul 2015 9:30 Modified: 11 Sep 2015 11:50
Reporter: Umesh Shastry Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Options Severity:S3 (Non-critical)
Version:5.7.7,5.7.8 OS:Any
Assigned to: CPU Architecture:Any

[1 Jul 2015 9:30] Umesh Shastry
Description:
Noticed that with latest 5.7.8 daily builds(exists in 5.7.7), a warning is returned stating that '@@SESSION.GTID_EXECUTED' is deprecated and will be removed in a future release when executing statement
SHOW VARIABLES.... Imho this is unwarranted and may be side affect of something?

How to repeat:
How to repeat:

// with 5.7.7 - in local context this is visible
// start with

bin/mysql_install_db --insecure --basedir=/export/umesh/server/binaries/mysql-5.7.7 --datadir=/export/umesh/server/binaries/mysql-5.7.7/bug -v
bin/mysqld --no-defaults --basedir=/export/umesh/server/binaries/mysql-5.7.7 --datadir=/export/umesh/server/binaries/mysql-5.7.7/bug --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/server/binaries/mysql-5.7.7/bug/log.err 2>&1 &

[umshastr@hod03]/export/umesh/server/binaries/mysql-5.7.7: bin/mysql -uroot  -S /tmp/mysql_ushastry.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.7-rc-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show variables;
.
.
494 rows in set, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+----------------------------------------------------------------------------------+
| Level   | Code | Message                                                                          |
+---------+------+----------------------------------------------------------------------------------+
| Warning | 1681 | '@@SESSION.GTID_EXECUTED' is deprecated and will be removed in a future release. |
+---------+------+----------------------------------------------------------------------------------+
1 row in set (0.00 sec)

// 5.7.8 
// Build used

commit: 39ba23aaabc003a65dd5cb533b27596980ee46ef
date: 2015-06-30 18:31:20 +0300
build-date: 2015-06-30 18:02:39 +0200
short: 39ba23a
branch: mysql-5.7

MySQL source 5.7.8

// Start with

bin/mysql_install_db --insecure --basedir=/export/umesh/server/binaries/mysql-5.7.8 --datadir=/export/umesh/server/binaries/mysql-5.7.8/bug -v
bin/mysqld --no-defaults --basedir=/export/umesh/server/binaries/mysql-5.7.8 --datadir=/export/umesh/server/binaries/mysql-5.7.8/bug --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/server/binaries/mysql-5.7.8/bug/log.err 2>&1 &

[umshastr@hod03]/export/umesh/server/binaries/mysql-5.7.8: bin/mysql -uroot  -S /tmp/mysql_ushastry.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.8-rc-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
mysql> show global variables;
.
--------------------------------------------------------------------------+
485 rows in set (0.01 sec)

^^ no warning at the global context

mysql> show variables;
.
500 rows in set, 1 warning (0.00 sec)
mysql> show warnings;
+---------+------+----------------------------------------------------------------------------------+
| Level   | Code | Message                                                                          |
+---------+------+----------------------------------------------------------------------------------+
| Warning | 1681 | '@@SESSION.GTID_EXECUTED' is deprecated and will be removed in a future release. |
+---------+------+----------------------------------------------------------------------------------+
1 row in set (0.00 sec)

// Warning is seen with any variables

mysql> show variables like 'anything';
Empty set, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+----------------------------------------------------------------------------------+
| Level   | Code | Message                                                                          |
+---------+------+----------------------------------------------------------------------------------+
| Warning | 1681 | '@@SESSION.GTID_EXECUTED' is deprecated and will be removed in a future release. |
+---------+------+----------------------------------------------------------------------------------+
1 row in set (0.00 sec)

Warning is only generated at the local context and not with global context.
[1 Jul 2015 9:33] MySQL Verification Team
Also, with performance_schema.session_variables

mysql> SELECT * FROM performance_schema.session_variables;
.
--------------------------------------------------------------------------+
500 rows in set, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+----------------------------------------------------------------------------------+
| Level   | Code | Message                                                                          |
+---------+------+----------------------------------------------------------------------------------+
| Warning | 1681 | '@@SESSION.GTID_EXECUTED' is deprecated and will be removed in a future release. |
+---------+------+----------------------------------------------------------------------------------+
1 row in set (0.00 sec)
[27 Jul 2015 12:38] MySQL Verification Team
// 5.7.9 builds - Re confirmed for Maria/João

// 5.7.9 - 24th build

[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.7.9: cat docs/INFO_SRC
commit: a43c30d8a6bdbad63ec2d7cbc3af25034270f6c2
date: 2015-07-24 10:16:19 +0530
build-date: 2015-07-24 07:21:33 +0200
short: a43c30d
branch: mysql-5.7

MySQL source 5.7.9

bin/mysql_install_db --insecure --basedir=/export/umesh/server/binaries/mysql-advanced-5.7.9 --datadir=/export/umesh/server/binaries/mysql-advanced-5.7.9/77591 -v
bin/mysqld --no-defaults --basedir=/export/umesh/server/binaries/mysql-advanced-5.7.9 --datadir=/export/umesh/server/binaries/mysql-advanced-5.7.9/77591 --core-file --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/server/binaries/mysql-advanced-5.7.9/77591/log.err 2>&1 &

[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.7.9: bin/mysql -uroot -p -S /tmp/mysql_ushastry.sock
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 19
Server version: 5.7.9-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show variables like 'anything';
Empty set, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+----------------------------------------------------------------------------------+
| Level   | Code | Message                                                                          |
+---------+------+----------------------------------------------------------------------------------+
| Warning | 1681 | '@@SESSION.GTID_EXECUTED' is deprecated and will be removed in a future release. |
+---------+------+----------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> quit
Bye

// 5.7.9 - 27th build

[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.7.9-linux-x86_64: cat docs/INFO_SRC
commit: d2c49829a3e62ded9e01565c7754568b41f50c87
date: 2015-07-25 06:55:05 +0200
build-date: 2015-07-25 18:01:57 +0200
short: d2c4982
branch: mysql-5.7

MySQL source 5.7.9

bin/mysql_install_db --insecure --basedir=/export/umesh/server/binaries/mysql-advanced-5.7.9-linux-x86_64 --datadir=/export/umesh/server/binaries/mysql-advanced-5.7.9-linux-x86_64/77591 -v
bin/mysqld --no-defaults --basedir=/export/umesh/server/binaries/mysql-advanced-5.7.9-linux-x86_64 --datadir=/export/umesh/server/binaries/mysql-advanced-5.7.9-linux-x86_64/77591 --core-file --socket=/tmp/mysql_ushastry.sock  --port=15000 --log-error=/export/umesh/server/binaries/mysql-advanced-5.7.9-linux-x86_64/77591/log.err 2>&1 &

[umshastr@hod03]/export/umesh/server/binaries/mysql-advanced-5.7.9-linux-x86_64: bin/mysql -uroot -S /tmp/mysql_ushastry.sock
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.9-enterprise-commercial-advanced MySQL Enterprise Server - Advanced Edition (Commercial)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show variables like 'anything';
Empty set, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+----------------------------------------------------------------------------------+
| Level   | Code | Message                                                                          |
+---------+------+----------------------------------------------------------------------------------+
| Warning | 1681 | '@@SESSION.GTID_EXECUTED' is deprecated and will be removed in a future release. |
+---------+------+----------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql>
[27 Aug 2015 9:08] Sven Sandberg
Posted by developer:
 
Please make sure that all the following cases are handled correctly:

# warning should be displayed:
SHOW VARIABLES with show_compatibility_56=ON
SHOW VARIABLES with show_compatibility_56=OFF
SHOW SESSION VARIABLES with show_compatibility_56=ON
SHOW SESSION VARIABLES with show_compatibility_56=OFF
SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES with show_compatibility_56=ON
SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES with show_compatibility_56=OFF
SELECT * FROM PERFORMANCE_SCHEMA.session_variables

SHOW VARIABLES LIKE 'gtid_executed' with show_compatibility_56=ON
SHOW VARIABLES LIKE 'gtid_executed' with show_compatibility_56=OFF
SHOW SESSION VARIABLES LIKE 'gtid_executed' with show_compatibility_56=ON
SHOW SESSION VARIABLES LIKE 'gtid_executed' with show_compatibility_56=OFF
SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_executed' with show_compatibility_56=ON
SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'gtid_executed' with show_compatibility_56=OFF
SELECT * FROM PERFORMANCE_SCHEMA.session_variables WHERE VARIABLE_NAME LIKE 'gtid_executed'

# warning should not be displayed:
SHOW GLOBAL VARIABLES with show_compatibility_56=ON
SHOW GLOBAL VARIABLES with show_compatibility_56=OFF
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES with show_compatibility_56=ON
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES with show_compatibility_56=OFF
SELECT * FROM PERFORMANCE_SCHEMA.global_variables

SHOW VARIABLES LIKE 'xyz' with show_compatibility_56=ON
SHOW SESSION VARIABLES LIKE 'xyz' with show_compatibility_56=ON
SHOW GLOBAL VARIABLES LIKE 'xyz' with show_compatibility_56=ON
SHOW VARIABLES LIKE 'xyz' with show_compatibility_56=OFF
SHOW SESSION VARIABLES LIKE 'xyz' with show_compatibility_56=OFF
SHOW GLOBAL VARIABLES LIKE 'xyz' with show_compatibility_56=OFF
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'xyz' with show_compatibility_56=ON
SELECT * FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'xyz' with show_compatibility_56=OFF
SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'xyz' with show_compatibility_56=ON
SELECT * FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME LIKE 'xyz' with show_compatibility_56=OFF
SELECT * FROM PERFORMANCE_SCHEMA.global_variables WHERE VARIABLE_NAME LIKE 'xyz'
SELECT * FROM PERFORMANCE_SCHEMA.session_variables WHERE VARIABLE_NAME LIKE 'xyz'
[11 Sep 2015 11:50] Jon Stephens
Documented fix in the MySQL 5.7.9 changelog as follows:

    The warning -'@@session.gtid_executed' is deprecated and will be
    removed in a future release.- was printed even when the session
    variable gtid_executed was not included in the result of a
    query. In addition, the result of 'SELECT @@session.gtid_executed'
    included a duplicate warning. Both issues occurred because the
    warning was printed whenever the value of the variable was
    accessed by a statement, such access occurring as a matter of
    course, whether or not the variable is actually included in the
    result.

    To fix this issue, we make handling of @@session.gtid_executed
    consistent with how the also-deprecated variable
    @@global.sql_log_bin treated in such cases, by making the
    following changes:

      ·gtid_executed is no longer included in the
       performance_schema.session_variables table.

       ·gtid_executed is still included in the
       information_schema.session_variables table, but when
        show_compatibility_56 = ON, the warning is not issued when
        querying the session_variables table, or when issuing SHOW
        VARIABLES or SHOW SESSION VARIABLES, even when using a LIKE
        clause with either of the SHOW statements. 

    The warning is still issued by a statement such as 'SELECT 
    @@session.gtid_executed' which accesses the value of the 
    variable directly.

See also Bug #75980 and Bug#76626.

Closed.