Skip to content

fix(plugins): list Oracle-maintained schemas as system and stop hiding Dameng SYSDBA - #2839

Merged
datlechin merged 2 commits into
mainfrom
fix/plugins-system-schema-lists
Sep 14, 2026
Merged

datlechin merged 2 commits into
mainfrom
fix/plugins-system-schema-lists

Conversation

@datlechin

Copy link
Copy Markdown
Member

Found while investigating #2832.

Problem

  • Oracle: SYS, SYSTEM, XDB and every other Oracle-maintained schema were listed with the user's own schemas in the schema switcher, the schema picker and the sidebar, and System Databases and Schemas had nothing to hide.
  • Dameng: SYSDBA was hidden from the sidebar and filed under System, although it is the administrator login's own default schema and where that login's tables land.

Root cause

  • Oracle's list of Oracle-maintained users was filed under systemDatabaseNames (7 names) while Oracle switches schemas and systemSchemaNames was empty. Every schema surface reads systemSchemaNames. The plugin's snapshot replaces the curated entry when it loads, and every published Oracle plugin, plugin-oracle-v1.2.28 included, reports no system schemas, so fixing the curated entry alone would change nothing for anyone with the plugin installed.
  • Dameng's list mixed two ideas: schemas that hold the engine's objects (SYS, CTISYS) and the schemas of preset accounts. DM8 gives every user a default schema named after it, so a SYSDBA login's unqualified CREATE TABLE lands in SYSDBA.

Measured on Oracle AI Database 26ai Free: SELECT USERNAME, ORACLE_MAINTAINED FROM ALL_USERS returns 28 schemas with Y in the PDB (plus GSMROOTUSER in the root) and PDBADMIN with N. An account granted only CREATE SESSION sees all of them. ORACLE_MAINTAINED does not exist before 12.1.0.2 (11.2.0.2: ORA-00904), so the list cannot come from a query on every supported server.

Fix

  • Registry: a system database or schema name counts when either the plugin or the app's curated entry lists it (adoptCuratedSystemNames, beside the existing adoptCuratedCaseSensitivity). An installed plugin that predates the app's list, or reports none, no longer takes names away.
  • Oracle: the curated entry lists 52 Oracle-maintained schemas for both databases and schemas: the measured 26ai set plus the predefined accounts the 19c and 11.2 Security Guides name for options the Free image leaves out. OraclePlugin's static is left alone on purpose: any kit-30 Oracle release reaches v0.74.0, which hides every system schema from the sidebar including the active one, so a login as SYSTEM would lose its own schema there.
  • Dameng: DamengSystemSchemas (new) separates the two questions. listed (SYS, SYSAUDITOR, SYSSSO, CTISYS, SYSJOB, SYSGEO2) is what the sidebar and pickers treat as system. The drop guard is wider and case-insensitive, so SYSDBA and SYSDBO, which hold DM-supplied procedures, are still refused a DROP SCHEMA ... CASCADE. SYSJOB holds the job system tables and SYSGEO2 the DMGEO2 package, per DM's documentation. The refusal now reads "Dameng's built-in schemas cannot be dropped.", since SYSDBA no longer lists as a system schema.

Not in this PR

On a rebuilt Dameng plugin, Drop is offered for SYSDBA, and the plugin refuses it after the confirmation, before any SQL runs. SYSDBO already worked this way on main. Hiding the command would need the app's drop check to know a per-engine list of schemas that can't be dropped, and nothing carries that list today. For two Dameng names, that change belongs in its own PR.

Tests

  • PluginMetadataRegistrySystemNameAdoptionTests (new): a published Oracle plugin with no system schemas keeps the curated ones; names from both sides are united in order without duplicates; a complete plugin list is left unchanged; Oracle's list holds the measured Oracle-maintained schemas and not PDBADMIN, OPS$ORACLE, HR or SCOTT.
  • DamengSystemSchemasTests (new): curated and plugin lists agree; SYSDBA is not listed; every listed schema plus SYSDBA and SYSDBO is refused a drop in any spelling.

76 cases across 9 suites passed, and the 5 affected suites (39 cases) passed again after the refusal was reworded. The DamengDriver scheme builds. SwiftLint: 0 violations. The live DM8 test that drops SYSDBA still expects the refusal and still gets it. No DM8 server was available to run it.

Release

  • Oracle: app-side only. It takes effect with the app release for every installed Oracle plugin version, with no plugin release.
  • Dameng: registry-only. The display list is app-side too, but the drop guard change needs a Dameng plugin release. Until then an installed v1.0.8 still reports SYSDBA as system, and the registry's union keeps it listed as system.
  • No PluginKit change.

https://claude.ai/code/session_018swsRkBkYjm7Y8WFfgRg7T

@mintlify

mintlify Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
TablePro 🟢 Ready View Preview Sep 14, 2026, 9:14 AM

💡 Tip: Enable Automations to automatically generate PRs for you.

Signed-off-by: Ngô Quốc Đạt <datlechin@gmail.com>
@datlechin
datlechin merged commit 95c61e7 into main Sep 14, 2026
3 checks passed
@datlechin
datlechin deleted the fix/plugins-system-schema-lists branch September 14, 2026 09:52
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