[MDEV-32906] The SQL error plugin prints (null) as database if the mariadb client is not using any database to execute the SQL. Created: 2023-11-29  Updated: 2024-01-23  Resolved: 2024-01-23

Status: Closed
Project: MariaDB Server
Component/s: Plugin - SQL_ERROR_LOG
Affects Version/s: 10.6
Fix Version/s: 10.6.17, 10.11.7, 11.0.5, 11.1.4, 11.2.3

Type: Bug Priority: Major
Reporter: Ramesh Sivaraman Assignee: Rucha Deodhar
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-27087 Add thread ID and database / table, w... Closed

 Description   

The SQL error plugin prints (null) as database if the mariadb client is not using any database to execute the SQL. I think it should print an empty string if the client is not using any database

MariaDB [(none)]> drop database db;
ERROR 1008 (HY000): Can't drop database 'db'; database doesn't exist
MariaDB [(none)]> 
 
$ cat data/sql_errors.log 
5 (null) 2023-11-29  5:53:31 root[root] @ localhost [] ERROR 1008: Can't drop database 'db'; database doesn't exist : drop database db 
$



 Comments   
Comment by Rucha Deodhar [ 2024-01-09 ]

Patch: https://github.com/MariaDB/server/commit/8421cc2232d0316903f72b468cede688f26e66d8

Comment by Rucha Deodhar [ 2024-01-09 ]

We do want NULL ( NULL is better instead of (null) ) because when no database is selected, SELECT DATABASE prints NULL ). But we do need something. Because if user wants to parse the log then having something (more meaningful) there instead of nothing can help.

Comment by Oleksandr Byelkin [ 2024-01-22 ]

OK to push after increasing major version of the plugin

Comment by Rucha Deodhar [ 2024-01-23 ]

pushed to 10.6

Generated at Thu Feb 08 10:34:55 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.