Problem
The system.tables table can only be queried on the _internal database, e.g.,
influxdb3 query --database _internal "select * from system.tables where database_name = '<db_name>'"
but not,
influxdb3 query --database <db_name> "select * from system.tables"
Proposed solution
- Allow
system.tables to be queried when scoped to a database, as in the above example.
- Only tables from within the scoped database should be returned in the query results.
Additional context
You can see where the tables system table is currently being added to the SystemTablesProvider here:
|
tables.insert( |
|
TABLES_TABLE_NAME, |
|
Arc::new(SystemTableProvider::new(Arc::new(TablesTable::new( |
|
Arc::clone(&catalog), |
|
)))), |
|
); |
But that is only when the query is against the
_internal database.
Problem
The
system.tablestable can only be queried on the_internaldatabase, e.g.,but not,
Proposed solution
system.tablesto be queried when scoped to a database, as in the above example.Additional context
You can see where the
tablessystem table is currently being added to theSystemTablesProviderhere:influxdb/influxdb3_system_tables/src/lib.rs
Lines 205 to 210 in 9fe5b77
But that is only when the query is against the
_internaldatabase.