From 3189c38185c05a6f0e6dbad7e9ae2d96f5f8f547 Mon Sep 17 00:00:00 2001 From: Mateusz Gajewski Date: Wed, 23 Mar 2022 15:14:24 +0100 Subject: [PATCH] Improve testing MySQL's stats quality --- .../test/java/io/trino/plugin/mysql/TestingMySqlServer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugin/trino-mysql/src/test/java/io/trino/plugin/mysql/TestingMySqlServer.java b/plugin/trino-mysql/src/test/java/io/trino/plugin/mysql/TestingMySqlServer.java index d8b788174e74..99346482dade 100644 --- a/plugin/trino-mysql/src/test/java/io/trino/plugin/mysql/TestingMySqlServer.java +++ b/plugin/trino-mysql/src/test/java/io/trino/plugin/mysql/TestingMySqlServer.java @@ -59,7 +59,11 @@ public TestingMySqlServer(String dockerImageName, boolean globalTransactionEnabl execute(format("GRANT ALL PRIVILEGES ON *.* TO '%s'", container.getUsername()), "root", container.getPassword()); } - protected void configureContainer(MySQLContainer container) {} + private void configureContainer(MySQLContainer container) + { + // MySQL configuration provided by default by testcontainers causes MySQL to produce poor estimates in CARDINALITY column of INFORMATION_SCHEMA.STATISTICS table. + container.addParameter("TC_MY_CNF", null); + } public Connection createConnection() throws SQLException