From f214d365121f1d9b5835134f4bead929831971f5 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 17 Apr 2018 00:44:34 +0200 Subject: [PATCH] ASAN error in is_stat_table() don't memcmp beyond the first argument's end Also: use my_strcasecmp(table_alias_charset), like elsewhere, not memcmp --- sql/sql_statistics.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/sql_statistics.cc b/sql/sql_statistics.cc index 1b073be361e..2a97c37e477 100644 --- a/sql/sql_statistics.cc +++ b/sql/sql_statistics.cc @@ -3990,11 +3990,11 @@ bool is_stat_table(const char *db, const char *table) { DBUG_ASSERT(db && table); - if (!memcmp(db, stat_tables_db_name.str, stat_tables_db_name.length)) + if (!my_strcasecmp(table_alias_charset, db, stat_tables_db_name.str)) { for (uint i= 0; i < STATISTICS_TABLES; i ++) { - if (!memcmp(table, stat_table_name[i].str, stat_table_name[i].length)) + if (!my_strcasecmp(table_alias_charset, table, stat_table_name[i].str)) return true; } }