diff --git a/server/modules/filter/binlogfilter/binlogfiltersession.cc b/server/modules/filter/binlogfilter/binlogfiltersession.cc index 24c5faad8..e556a90c3 100644 --- a/server/modules/filter/binlogfilter/binlogfiltersession.cc +++ b/server/modules/filter/binlogfilter/binlogfiltersession.cc @@ -405,10 +405,11 @@ static bool should_skip_query(const BinlogConfig& config, const std::string& sql qc_free_table_names(names, n); } - // Also check for the default database in case the query has no tables in it - if (!rval && should_skip(config, db)) + // Also check for the default database in case the query has no tables in it. The dot at the end is + // required to distinct database names from table names. + if (n == 0) { - rval = true; + rval = should_skip(config, db + '.'); } gwbuf_free(buf);