[MDEV-33304] SQL Error log plugin prints "(null)" in the Query part for an access denied error Created: 2024-01-24  Updated: 2024-01-25

Status: Open
Project: MariaDB Server
Component/s: Plugin - SQL_ERROR_LOG
Affects Version/s: 10.4, 10.5, 10.6, 10.11, 11.0, 11.1, 11.2, 11.3, 11.4
Fix Version/s: 10.4, 10.5, 10.6, 10.11, 11.0, 11.1, 11.2, 11.3, 11.4

Type: Bug Priority: Critical
Reporter: Ramesh Sivaraman Assignee: Rucha Deodhar
Resolution: Unresolved Votes: 0
Labels: None


 Description   

--source include/not_embedded.inc
 
if (!$SQL_ERRLOG_SO) {
  skip No SQL_ERROR_LOG plugin;
}
 
 
install plugin SQL_ERROR_LOG soname 'sql_errlog';
 
 
show variables like 'sql_error_log%';
set global sql_error_log_rate=1;
 
create user u identified by 'good_pass';
 
# Test the user is blocked after using bad password
error ER_ACCESS_DENIED_ERROR;
connect(con1, localhost, u, bas_pass);
 
 
let $MYSQLD_DATADIR= `SELECT @@datadir`;
# replace the timestamp and the hostname with constant values
--replace_regex /[1-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] [ 0-9][0-9]:[0-9][0-9]:[0-9][0-9] [^EW]*/TIME HOSTNAME /
cat_file $MYSQLD_DATADIR/sql_errors.log;
 
--------------------------------------------------------------------------------------------------------------------------------------------------
set global sql_error_log_rate=1;
create user u identified by 'good_pass';
connect(localhost,u,bas_pass,test,16000,/test/MD230124-mariadb-11.2.3-linux-x86_64-opt/mariadb-test/var/tmp/mysqld.1.sock);
connect con1, localhost, u, bas_pass;
ERROR 28000: Access denied for user 'u'@'localhost' (using password: YES)
TIME HOSTNAME ERROR 1045: Access denied for user 'u'@'localhost' (using password: YES) : (null)
plugins.MDEV-33304                       [ pass ]      3
--------------------------------------------------------------------------------------------------------------------------------------------------

SQL Error log plugin prints "(null)" in the Query part for an access denied error

10.6.17 011d666ada0514875717a15171b93b139a701219

$ /test/mtest/server/mariadb-10.6.17-linux-x86_64/bin/mariadb -urepl_user -S/test/mtest/server/mariadb-10.6.17-linux-x86_64/socket.sock
ERROR 1045 (28000): Access denied for user 'repl_user'@'localhost' (using password: NO)
 
$ cat data/sql_errors.log
2024-01-24 13:00:53 6 [repl_user] @ localhost [] NULL ERROR 1045: Access denied for user 'repl_user'@'localhost' (using password: NO) : (null) 
$ 


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