[MXS-942] describe table query not routed to shard that contains the schema Created: 2016-10-18  Updated: 2016-10-24  Resolved: 2016-10-24

Status: Closed
Project: MariaDB MaxScale
Component/s: schemarouter
Affects Version/s: None
Fix Version/s: 2.0.2

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

maxscale host: ubuntu 16
database shards: mysql 5.5 and mysql 5.6

mysql client: php 5.5 / Zend 1.18 default mysql connector



 Description   

The following message is shown

SELECT command denied to user 'user'@'host' for table 'mysql_table'

when running one of the following queries

SHOW COLUMNS IN database.tablename IN database;
EXPLAIN database.tablename;
DESCRIBE database.tablename;

This happens when no default database is set or when connected to a default database that is not on the same shard as the database that contains the table.



 Comments   
Comment by markus makela [ 2016-10-20 ]

This seems to happen due to the fact that for all of SHOW COLUMNS, EXPLAIN and DEESCRIBE the query classifier returns information_schema. This is most likely by design so that the actual table that is used is returned. Since MaxScale doesn't have access to the table in the database, the database name should be retrieved by parsing the query.

Comment by markus makela [ 2016-10-24 ]

The query classifiers now return the queried database and table instead of the real one.

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