Skip to content

fix(store): qualify metadata SQL with system_mcp - #46

Merged
maruyue merged 2 commits into
mainfrom
fix/no-insert-on-read
Oct 21, 2026
Merged

maruyue merged 2 commits into
mainfrom
fix/no-insert-on-read

Conversation

@maruyue

@maruyue maruyue commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Hotfix for an issue introduced by #45 (migration detection).

metadata_schema_status() runs on every models-page load and queried
workspace_metadata without a database qualifier — it issues no USE, so on a
real Doris connection the default database is empty:

ERROR 1046: No database selected

The Web UI models page therefore failed for every user (admin and non-admin)
once the metadata table existed. Mocked tests could not see it.

Every metadata statement is now qualified as system_mcp.workspace_metadata
(CREATE TABLE keeps the USE-scoped form). Tests assert the status probe and the
read path emit a qualified name.

metadata_schema_status() queried workspace_metadata without a database
qualifier (it issues no USE). On a real Doris connection the default database
is empty, so the Web UI models page failed with "No database selected" —
invisible to mocked tests.

Qualify every metadata statement with {database}.{table}; CREATE TABLE keeps
the USE-scoped form. Tests assert the status probe and the read path emit a
qualified name.
The models page runs the probe for every visitor. If it raised (e.g. no grant
on information_schema), the whole page returned 500. Log it and continue with
the normal store reads instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant