Details
Description
Server stops logging slow queries when enabling --log-short-format , also server does not show log-short-format variable information in the global variable list. MySQL also exhibits similar behaviour.
As per documentation, enabling --log-short-format should only omit extra information from the logs. However, with the current behaviour, nothing is written to the slow query log.
Server process info
ramesh_+ 1620953 1 0 09:27 pts/0 00:00:00 /test/MD170426-mariadb-10.6.26-linux-x86_64-opt/bin/mariadbd --no-defaults --max_connections=10000 --core-file --basedir=/test/MD170426-mariadb-10.6.26-linux-x86_64-opt --tmpdir=/test/MD170426-mariadb-10.6.26-linux-x86_64-opt/tmp --datadir=/test/MD170426-mariadb-10.6.26-linux-x86_64-opt/data --socket=/test/MD170426-mariadb-10.6.26-linux-x86_64-opt/socket.sock --port=10803 --log-error=/test/MD170426-mariadb-10.6.26-linux-x86_64-opt/log/master.err --server-id=100 --slow_query_log=ON --long_query_time=1 --log-short-format
|
10.6.26-opt>show global variables like '%format%'; |
+----------------------------+-------------------+ |
| Variable_name | Value |
|
+----------------------------+-------------------+ |
| binlog_format | MIXED |
|
| date_format | %Y-%m-%d |
|
| datetime_format | %Y-%m-%d %H:%i:%s |
|
| default_week_format | 0 |
|
| innodb_default_row_format | dynamic | |
| mysql56_temporal_format | ON | |
| time_format | %H:%i:%s |
|
| wsrep_forced_binlog_format | NONE |
|
+----------------------------+-------------------+ |
8 rows in set (0.001 sec) |
|
|
10.6.26-opt>
|
|
|
10.6.26-opt>show variables like '%long%query%'; |
+-----------------+----------+ |
| Variable_name | Value |
|
+-----------------+----------+ |
| long_query_time | 1.000000 |
|
+-----------------+----------+ |
1 row in set (0.000 sec) |
|
|
10.6.26-opt>show variables like '%slow%query%'; |
+---------------------+--------------------+ |
| Variable_name | Value |
|
+---------------------+--------------------+ |
| slow_query_log | ON | |
| slow_query_log_file | ramesh-01-slow.log |
|
+---------------------+--------------------+ |
2 rows in set (0.001 sec) |
|
|
10.6.26-opt>
|
|
|
10.6.26-opt>create table t1(id int); |
Query OK, 0 rows affected (0.012 sec) |
|
|
10.6.26-opt>insert into t1 select seq from seq_1_to_1000000; |
Query OK, 1000000 rows affected (2.686 sec) |
Records: 1000000 Duplicates: 0 Warnings: 0
|
|
|
10.6.26-opt>
|
|
|
Insert statement is written in general log |
-------------------------------------------------
|
|
|
/test/MD170426-mariadb-10.6.26-linux-x86_64-opt/bin/mariadbd, Version: 10.6.26-MariaDB-log (MariaDB Server). started with: |
Tcp port: 10452 Unix socket: /test/MD170426-mariadb-10.6.26-linux-x86_64-opt/socket.sock
|
Time Id Command Argument |
260428 9:44:40 3 Connect root@localhost on using Socket |
3 Quit
|
4 Connect root@localhost on test using Socket |
4 Query select @@version_comment limit 1 |
260428 9:44:46 4 Query create table t1(id int) |
260428 9:44:53 4 Query insert into t1 select seq from seq_1_to_1000000 |
260428 9:45:13 4 Quit
|
|
|
Insert statement is not written in slow query log. |
-------------------------------------------------
|
ramesh_sivaraman@ramesh-01:/test/MD170426-mariadb-10.6.26-linux-x86_64-opt$ cat data/ramesh-01-slow.log
|
/test/MD170426-mariadb-10.6.26-linux-x86_64-opt/bin/mariadbd, Version: 10.6.26-MariaDB-log (MariaDB Server). started with: |
Tcp port: 11189 Unix socket: /test/MD170426-mariadb-10.6.26-linux-x86_64-opt/socket.sock
|
Time Id Command Argument |
/test/MD170426-mariadb-10.6.26-linux-x86_64-opt/bin/mariadbd, Version: 10.6.26-MariaDB-log (MariaDB Server). started with: |
Tcp port: 10452 Unix socket: /test/MD170426-mariadb-10.6.26-linux-x86_64-opt/socket.sock
|
Time Id Command Argument |
ramesh_sivaraman@ramesh-01:/test/MD170426-mariadb-10.6.26-linux-x86_64-opt$
|