Bug #90578 rpl.rpl_column_stats_table test fails
Submitted: 23 Apr 2018 16:44 Modified: 24 Apr 2018 11:31
Reporter: Valeriy Kravchuk Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:8.0.11 OS:Any
Assigned to: CPU Architecture:Any
Tags: column_statistics, replication, rpl.rpl_column_stats_table, test

[23 Apr 2018 16:44] Valeriy Kravchuk
Description:
It seems rpl.rpl_column_stats_table test is based on outdated assumptions and thus it fails on MySQL 8.0.11:

[openxs@fc23 mysql-test]$ ./mtr rpl.rpl_column_stats_table
Logging: ./mtr  rpl.rpl_column_stats_table
2018-04-23T16:22:21.528640Z 0 [Warning] [MY-010139] [Server] Changed limits: max_open_files: 1024 (requested 8161)
2018-04-23T16:22:21.528748Z 0 [Warning] [MY-010142] [Server] Changed limits: table_open_cache: 431 (requested 4000)
2018-04-23T16:22:21.529075Z 0 [System] [MY-010116] [Server] /home/openxs/dbs/8.0/bin/mysqld (mysqld 8.0.11) starting as process 3009
MySQL Version 8.0.11
Checking supported features...
 - SSL connections supported
Collecting tests...
 - adding combinations for rpl
Checking leftover processes...
Removing old var directory...
Creating var directory '/home/openxs/dbs/8.0/mysql-test/var'...
Installing system database...
Using parallel: 1

==============================================================================

TEST                                      RESULT   TIME (ms) or COMMENT
--------------------------------------------------------------------------

worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009
rpl.rpl_column_stats_table 'mix'         [ fail ]
        Test ended at 2018-04-23 19:23:03

CURRENT_TEST: rpl.rpl_column_stats_table
mysqltest: At line 18: query 'INSERT INTO mysql.column_stats
(database_name,
table_name,
column_name,
histogram)
VALUES      ('replication-db-test',
'test-tbl-1',
'test-col-1',
'{"key": "value"}'),
('replication-db-test',
'test-tbl-1',
'test-col-2',
'{"key": "value"}')' failed: 1146: Table 'mysql.column_stats' doesn't exist

The result from queries just before the failure was:
include/master-slave.inc
Warnings:
Note    ####    Sending passwords in plain text without SSL/TLS is extremely insecure.
Note    ####    Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
[connection master]
#
# Verify that inserts are replicated.
#
# Connection master
safe_process[3136]: Child process: 3137, exit: 1

 - the logfile can be found in '/home/openxs/dbs/8.0/mysql-test/var/log/rpl.rpl_column_stats_table-mix/rpl_column_stats_table.log'

Only  1  of 3 completed.
mysql-test-run: *** ERROR: Not all tests completed

How to repeat:
Try to run the test on MySQL 8.0.11 (it is there, in GitHub sources at least):

./mtr rpl.rpl_column_stats_table

It is doomed to fail as the table with histograms for columns is now in the information_schema, named column_statistics and is NOT supposed to be replicated (or updated directly, as far as I can see). Check https://dev.mysql.com/doc/refman/8.0/en/optimizer-statistics.html for more details.

Suggested fix:
I think this test should be disabled or just dropped from the suite.
[24 Apr 2018 2:55] Erlend Dahl
rpl.rpl_column_stats_table is no longer present in 8.0.11, it was removed in 8.0.2. Please check your setup.
[24 Apr 2018 11:31] Valeriy Kravchuk
Indeed, test is not present in current sources and the one I have is a leftover of some older version:

openxs@ao756:~/git/mysql-server$ ls -l mysql-test/suite/rpl/t/rpl_column*
ls: cannot access mysql-test/suite/rpl/t/rpl_column*: No such file or directory
openxs@ao756:~/git/mysql-server$ ls -l ~/dbs/8.0/mysql-test/suite/rpl/t/rpl_column*
-rw-rw-r-- 1 openxs openxs 2154 вер 13  2016 /home/openxs/dbs/8.0/mysql-test/suite/rpl/t/rpl_column_stats_table.test
openxs@ao756:~/git/mysql-server$

Dropping tests before GA is probably OK, so this was my fault.