Bug #37187 `INFORMATION_SCHEMA`.`GLOBAL_VARIABLES`: inconsistent status
Submitted: 4 Jun 2008 10:16 Modified: 8 Mar 2010 0:52
Reporter: Santo Leto Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.1.24-rc, 6.0, 5.0 OS:Any (MS Windows XPSP2, Linux)
Assigned to: CPU Architecture:Any
Tags: information_schema.global_variables, sql_slave_skip_counter

[4 Jun 2008 10:16] Santo Leto
Description:
I am wondering which is the aim of the row 'SQL_SLAVE_SKIP_COUNTER' in `INFORMATION_SCHEMA`.`GLOBAL_VARIABLES`.
Variable's value is always empty.

http://bugs.mysql.com/bug.php?id=35994 should fix this.

How to repeat:
Test Script:

Connection 1

STOP SLAVE;
SET GLOBAL sql_slave_skip_counter = 3;
START SLAVE;
SHOW SLAVE STATUS\G

Connection 2:
SELECT `VARIABLE_VALUE` FROM `INFORMATION_SCHEMA`.`GLOBAL_VARIABLES` WHERE `VARIABLE_NAME`='SQL_SLAVE_SKIP_COUNTER';

SHOW SLAVE STATUS\G

Script Output:

Connection 1

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.1.24-rc-community-log MySQL Community Server (GPL)

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

mysql>
mysql> STOP SLAVE;
Query OK, 0 rows affected (0.00 sec)

mysql> SET GLOBAL sql_slave_skip_counter = 3;
Query OK, 0 rows affected (0.00 sec)

mysql> START SLAVE;
Query OK, 0 rows affected (0.00 sec)

mysql> SHOW SLAVE STATUS\G
*************************** 1. row ***************************
               Slave_IO_State: Connecting to master
                  Master_Host: localhost
                  Master_User: root
                  Master_Port: 51241
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000001
          Read_Master_Log_Pos: 300
               Relay_Log_File: CAMERON-NT-055-relay-bin.000002
                Relay_Log_Pos: 251
        Relay_Master_Log_File: mysql-bin.000001
             Slave_IO_Running: No
            Slave_SQL_Running: Yes
              Replicate_Do_DB:
          Replicate_Ignore_DB: hs_audit_schema
           Replicate_Do_Table:
       Replicate_Ignore_Table: hs_audit_schema.status_system_dpm_table
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 3
          Exec_Master_Log_Pos: 300
              Relay_Log_Space: 415
              Until_Condition: None
               Until_Log_File:
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File:
           Master_SSL_CA_Path:
              Master_SSL_Cert:
            Master_SSL_Cipher:
               Master_SSL_Key:
        Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:
               Last_SQL_Errno: 0
               Last_SQL_Error:
1 row in set (0.00 sec)

mysql>

Connection 2:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 12
Server version: 5.1.24-rc-community-log MySQL Community Server (GPL)

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

mysql> SELECT `VARIABLE_VALUE` FROM `INFORMATION_SCHEMA`.`GLOBAL_VARIABLES` WHERE `VARIABLE_NAME`='SQL_SLAVE_SKIP_COUNTER';
+----------------+
| VARIABLE_VALUE |
+----------------+
|                |
+----------------+
1 row in set (0.06 sec)

mysql>
mysql> SHOW SLAVE STATUS\G
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: localhost
                  Master_User: root
                  Master_Port: 51241
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000001
          Read_Master_Log_Pos: 300
               Relay_Log_File: CAMERON-NT-055-relay-bin.000003
                Relay_Log_Pos: 251
        Relay_Master_Log_File: mysql-bin.000001
             Slave_IO_Running: Yes
            Slave_SQL_Running: Yes
              Replicate_Do_DB:
          Replicate_Ignore_DB: hs_audit_schema
           Replicate_Do_Table:
       Replicate_Ignore_Table: hs_audit_schema.status_system_dpm_table
      Replicate_Wild_Do_Table:
  Replicate_Wild_Ignore_Table:
                   Last_Errno: 0
                   Last_Error:
                 Skip_Counter: 3
          Exec_Master_Log_Pos: 300
              Relay_Log_Space: 560
              Until_Condition: None
               Until_Log_File:
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File:
           Master_SSL_CA_Path:
              Master_SSL_Cert:
            Master_SSL_Cipher:
               Master_SSL_Key:
        Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error:
               Last_SQL_Errno: 0
               Last_SQL_Error:
1 row in set (0.00 sec)

mysql>
[4 Jun 2008 21:17] Sveta Smirnova
Thank you for the report.

Verified as described. This value is not indicated in SHOW GLOBAL VARIABLES output. See also bug #20413.

Workaround: use SHOW SLAVE STATUS to obtain this value.
[6 Mar 2010 10:53] Bugs System
Pushed into 5.5.3-m3 (revid:alik@sun.com-20100306103849-hha31z2enhh7jwt3) (version source revid:vvaintroub@fedora12-20091225154921-x25a5pyw1pxiwobv) (merge vers: 5.5.99) (pib:16)
[8 Mar 2010 0:52] Paul DuBois
Noted in 5.5.3 changelog.

The value of sql_slave_skip_counter was empty when displayed by SHOW
VARIABLES or INFORMATION_SCHEMA.GLOBAL_VARIABLES.