fix(plugins): list Oracle-maintained schemas as system and stop hiding Dameng SYSDBA - #2839
Merged
Merged
Conversation
…g Dameng SYSDBA Claude-Session: https://claude.ai/code/session_018swsRkBkYjm7Y8WFfgRg7T
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
Signed-off-by: Ngô Quốc Đạt <datlechin@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found while investigating #2832.
Problem
SYS,SYSTEM,XDBand 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.SYSDBAwas 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
systemDatabaseNames(7 names) while Oracle switches schemas andsystemSchemaNameswas empty. Every schema surface readssystemSchemaNames. The plugin's snapshot replaces the curated entry when it loads, and every published Oracle plugin,plugin-oracle-v1.2.28included, reports no system schemas, so fixing the curated entry alone would change nothing for anyone with the plugin installed.SYS,CTISYS) and the schemas of preset accounts. DM8 gives every user a default schema named after it, so aSYSDBAlogin's unqualifiedCREATE TABLElands inSYSDBA.Measured on Oracle AI Database 26ai Free:
SELECT USERNAME, ORACLE_MAINTAINED FROM ALL_USERSreturns 28 schemas withYin the PDB (plusGSMROOTUSERin the root) andPDBADMINwithN. An account granted onlyCREATE SESSIONsees all of them.ORACLE_MAINTAINEDdoes 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
adoptCuratedSystemNames, beside the existingadoptCuratedCaseSensitivity). An installed plugin that predates the app's list, or reports none, no longer takes names away.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 asSYSTEMwould lose its own schema there.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, soSYSDBAandSYSDBO, which hold DM-supplied procedures, are still refused aDROP SCHEMA ... CASCADE.SYSJOBholds the job system tables andSYSGEO2the DMGEO2 package, per DM's documentation. The refusal now reads "Dameng's built-in schemas cannot be dropped.", sinceSYSDBAno 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.SYSDBOalready worked this way onmain. 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 notPDBADMIN,OPS$ORACLE,HRorSCOTT.DamengSystemSchemasTests(new): curated and plugin lists agree;SYSDBAis not listed; every listed schema plusSYSDBAandSYSDBOis 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
DamengDriverscheme builds. SwiftLint: 0 violations. The live DM8 test that dropsSYSDBAstill expects the refusal and still gets it. No DM8 server was available to run it.Release
SYSDBAas system, and the registry's union keeps it listed as system.https://claude.ai/code/session_018swsRkBkYjm7Y8WFfgRg7T