Bug #37187 `INFORMATION_SCHEMA`.`GLOBAL_VARIABLES`: inconsistent status
Submitted: 4 Jun 2008 12:16 Modified: 13 Nov 10:42
Reporter: Santo Leto
Status: Patch pending
Category:Server: Replication Severity:S3 (Non-critical)
Version:5.1.24-rc, 6.0, 5.0 OS:Any (MS Windows XPSP2, Linux)
Assigned to: Sergei Golubchik Target Version:
Tags: information_schema.global_variables, sql_slave_skip_counter
Triage: Triaged: D3 (Medium)

[4 Jun 2008 12: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 23: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.