Details
Description
Hi,
I reported MySQL [Bug#115203: Empty "use ;" on replica in slow query log file](https://bugs.mysql.com/bug.php?id=115203), and it also affects MariaDB. Copy of MySQL bug report below my signature, and how to repeat in 11.4.2 (11.3.2 also affected).
Thanks for looking into this,
Jean-François Gagné
> when a replica logs a slow query which was not run in a specific schema after a query run in a specific schema, the slow query log file contains a "use ;" which is not a valid command. I would expect the slow query log file on the replica to not contain a "use ;" line (like on the primary).
dbdeployer deploy replication mariadb_11.4.2 -c slow_query_log_file=slow.log -c slow_query_log=ON
|
|
./n2 <<< "stop slave; set global long_query_time = 0, log_slow_slave_statements = ON; start slave"
|
|
./n1 <<< "set session long_query_time = 0; create database test_jfg"
|
./n1 test_jfg <<< "set session long_query_time = 0; create table t1(id int)"
|
./n1 <<< "set session long_query_time = 0; create table test_jfg.t2(id int)"
|
sleep 1; \
|
echo; echo --Primary:; tail -n 5 master/data/slow.log; \
|
echo; echo --Replica:; tail -n 6 node1/data/slow.log
|
|
|
–Primary:
|
# Thread_id: 11 Schema: QC_hit: No
|
# Query_time: 0.041575 Lock_time: 0.000084 Rows_sent: 0 Rows_examined: 0
|
# Rows_affected: 0 Bytes_sent: 11
|
SET timestamp=1717436422;
|
create table test_jfg.t2(id int);
|
|
–Replica:
|
# Thread_id: 10 Schema: QC_hit: No
|
# Query_time: 0.042956 Lock_time: 0.000067 Rows_sent: 0 Rows_examined: 0
|
# Rows_affected: 0 Bytes_sent: 0
|
use ;
|
SET timestamp=1717436422;
|
create table test_jfg.t2(id int);
|