[MXS-791] No database selected on login Created: 2016-07-06  Updated: 2016-09-06  Resolved: 2016-09-06

Status: Closed
Project: MariaDB MaxScale
Component/s: Core
Affects Version/s: 1.4.3
Fix Version/s: 2.0.0

Type: Bug Priority: Major
Reporter: Branden Timm Assignee: Timofey Turenko
Resolution: Cannot Reproduce Votes: 0
Labels: None
Environment:

CentOS 7.2.1511 amd64, MariaDB 10.1.14



 Description   

On login, the specified database appears to be selected, but any non-qualified statements fail. This setup is just two MariaDB 10.1.14 servers behind MaxScale in docker using the readwritesplit router:

~ mysql -h 172.17.0.4 test
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 14
Server version: 10.0.0 1.4.3-maxscale MariaDB Server

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MySQL [test]> create table foo(id int(11) auto_increment primary key);
ERROR 1046 (3D000): No database selected
MySQL [test]> use test;
Database changed
MySQL [test]> create table foo(id int(11) auto_increment primary key);
Query OK, 0 rows affected (0.01 sec)

MaxScale> list servers
Servers.
--------------------------------------------------------------------
Server | Address | Port | Connections | Status
--------------------------------------------------------------------
pxc-1 | 10.1.3.241 | 3306 | 1 | Slave, Synced, Running
pxc-2 | 10.1.3.242 | 3306 | 1 | Master, Synced, Running
--------------------------------------------------------------------
MaxScale> list services
Services.
---------------------------------------------------+--------------
Service Name | Router Module | #Users | Total Sessions
---------------------------------------------------+--------------
Splitter Service | readwritesplit | 2 | 26
CLI | cli | 2 | 4
---------------------------------------------------+--------------

MaxScale> show service "Splitter Service"
Service 0xbc8fd0
Service: Splitter Service
Router: readwritesplit (0x7f9a769862c0)
State: Started
Number of router sessions: 25
Current no. of router sessions: 1
Number of queries forwarded: 314455
Number of queries forwarded to master: 314430
Number of queries forwarded to slave: 25
Number of queries forwarded to all: 21
Master/Slave percentage: 99.99%
Started: Wed Jul 6 17:30:45 2016
Root user access: Disabled
Backend databases
10.1.3.242:3306 Protocol: MySQLBackend
10.1.3.241:3306 Protocol: MySQLBackend
Users data: 0xc9e910
Total connections: 26
Currently connected: 2



 Comments   
Comment by Timofey Turenko [ 2016-07-14 ]

I can't reproduce it.
Many our tests rely on it (but tests are mostly written in C).
To be sure I added simple bash script to our test set to check this issue.

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