[MXS-3292] Unable to execute use `database` Created: 2020-11-10  Updated: 2021-05-25  Resolved: 2020-11-24

Status: Closed
Project: MariaDB MaxScale
Component/s: mariadbbackend, mariadbclient
Affects Version/s: 2.5.5
Fix Version/s: 2.5.6

Type: Bug Priority: Major
Reporter: Mikael Nilsson Assignee: markus makela
Resolution: Fixed Votes: 0
Labels: None
Environment:

MariaDB 10.4.13
PHP 7.4.7


Issue Links:
Relates
relates to MXS-3293 Backticks not stripped in USE stateme... Closed
relates to MXS-3572 Maxscale 2.5 not handle single quotes... Closed

 Description   

$dsn = "mysql:host=10.152.183.98;port=3306;dbname=test";
$pdo = new PDO($dsn, $config['username'], $config['password']);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
try {
    $res = $pdo->exec('use `test`');
} catch (PDOException $e) {
    var_dump($e->getMessage());
}

When i execute "use `test`" with backtick i get following error
SQLSTATE[HY000]: General error: 2003 Lost connection to backend server: connection closed by peer

and in the MaxScale log receive this error

 error  : (30) [readwritesplit] (Splitter-Service) Lost connection to the master server, closing session. Lost connection to master server while connection was idle. Connection has been idle for 0 seconds. Error caused by: #HY000: Lost connection to backend server: connection closed by peer. Last close reason: <none>. Last error: 
error  : (30) Invalid authentication message from backend 'dbsrv1'. Error code: 1049, Msg : #42000: Unknown database '`test`'

It works If i connect directly to the MariaDB instance
and it works without backticks regardless if I connect to through MaxScale or MariaDB



 Comments   
Comment by markus makela [ 2020-11-11 ]

Can you attach your configuration to the issue? No need for config anymore.

Comment by markus makela [ 2020-11-11 ]

I managed to reproduce the error message about unknown database. However, I don't see any errors in my setup. This could be explained by the fact that I'm running everything on the same machine.

Comment by markus makela [ 2020-11-11 ]

I believe I have managed to find the bug and fix it. This should be fixed in the next 2.5 release.

Comment by Mikael Nilsson [ 2020-11-11 ]

Thanks!

Generated at Thu Feb 08 04:20:21 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.