Fix binlogfilter matching

The matching always checked the default database when it should only check
it if there are no tables in the statement.
This commit is contained in:
Markus Mäkelä 2019-04-01 11:25:09 +03:00
parent 06c01439fb
commit 738ae9178b
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -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);