[MXS-4704] SHOW TABLE STATUS FROM some_schema Fails with SchemaRouter Created: 2023-08-07  Updated: 2023-09-07  Resolved: 2023-08-08

Status: Closed
Project: MariaDB MaxScale
Component/s: qc_mysqlembedded, qc_sqlite
Affects Version/s: 6.4.7
Fix Version/s: 6.4.9, 22.08.8, 23.02.4

Type: Bug Priority: Major
Reporter: Claudio Nanni Assignee: Johan Wikman
Resolution: Fixed Votes: 0
Labels: None
Environment:

debian



 Description   

MySQL [(none)]> show table status from some_schema;
ERROR 1049 (42000): Unknown database 'some_schema';

This works:
USE some_schema;
SHOW TABLE STATUS\G

Relevant SchemaRouter config:

[MyShardingService]
type=service
router=schemarouter
auth_all_servers=true
targets=Shard01,Shard02
user=my_maxscale_user
password=my_secure_password
ignore_tables_regex=/^performance_schema/|/^information_schema/|/^mysql/|/^sys/
refresh_interval=24h



 Comments   
Comment by markus makela [ 2023-08-07 ]

Might potentially be fixed by this:

diff --git a/query_classifier/qc_sqlite/qc_sqlite.cc b/query_classifier/qc_sqlite/qc_sqlite.cc
index f4cdba4ca9..3ab4ec4a01 100644
--- a/query_classifier/qc_sqlite/qc_sqlite.cc
+++ b/query_classifier/qc_sqlite/qc_sqlite.cc
@@ -3279,10 +3279,6 @@ public:
             m_type_mask = QUERY_TYPE_WRITE;
             break;
 
-        case MXS_SHOW_TABLE_STATUS:
-            m_type_mask = QUERY_TYPE_WRITE;
-            break;
-
         case MXS_SHOW_STATUS:
             switch (pShow->data)
             {
@@ -3310,6 +3306,7 @@ public:
             }
             break;
 
+        case MXS_SHOW_TABLE_STATUS:
         case MXS_SHOW_TABLES:
             m_type_mask = QUERY_TYPE_SHOW_TABLES;
             if (pShow->pDatabase->z)

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