ANALYZE TABLE is not replicated
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MySQL patches by Codership | Status tracked in 5.6 | |||||
5.6 |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
ANALYZE TABLE is not replicated, as it would be in MySQL replication. MySQL defines ANALYZE TABLE NO_WRITE_TO_BINLOG for situations where one would want to prevent replication.
The wsrep_last_
Test case:
--source include/
--source include/
--let $innodb_
SET GLOBAL innodb_
CREATE TABLE ten (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO ten VALUES (1),(2)
CREATE TABLE stat_t1 (f1 INTEGER AUTO_INCREMENT PRIMARY KEY, f2 INTEGER , KEY (f2)) ENGINE=InnoDB;
--connection node_2
# Access the table once so that the stat calculation on open is performed
SET GLOBAL innodb_
SELECT COUNT(*) = 0 FROM stat_t1;
--connection node_1
INSERT INTO stat_t1 (f2) SELECT a1.f1 FROM ten AS a1, ten AS a2, ten AS a3, ten AS a4;
--connection node_2
# Empty stats expected
SELECT stat_value FROM mysql.innodb_
SHOW STATUS LIKE 'wsrep_
--connection node_1
ANALYZE TABLE stat_t1;
SELECT stat_value FROM mysql.innodb_
--connection node_2
# Stats should now be populated
SHOW STATUS LIKE 'wsrep_
SELECT stat_value FROM mysql.innodb_
--connection node_2
--eval SET GLOBAL innodb_
--connection node_1
--eval SET GLOBAL innodb_
DROP TABLE stat_t2;
DROP TABLE stat_t1;
DROP TABLE ten;