You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Across 8 test cases, 5 passed and 3 failed, showing that session/database resolution and provider lookup error propagation generally behaved correctly (including SHOW SCHEMAS fallback, OID helper short-circuiting, OID introspection consistency, and clean mixed-version startup abort diagnostics) but the run still identified significant product issues. The most important confirmed defects were a high-severity startup break from unresolved migrated doltcore/dsess imports against the pinned Dolt module version (introduced by this PR), a high-severity authorization leak where pg_catalog.pg_database exposes unauthorized database names, and a medium-severity regclass bug where search_path first-match precedence is reversed and can resolve to later-schema objects.
❌ Failed (1)
Category
Summary
Screenshot
Provider
⚠️ Server startup cannot succeed because migrated doltcore/dsess imports are unresolved by the pinned dependency version.
⚠️ Startup fails due to unresolved dsess import
What failed: The server fails before reaching ready state because imports were migrated to github.com/dolthub/dolt/go/libraries/doltcore/dsess while the pinned Dolt module version does not provide that package; expected behavior is successful startup and SQL connectivity.
Impact: Core startup is broken, so users cannot connect to the server or run primary SQL workflows. There is no practical workaround without changing dependency alignment or import paths.
Steps to reproduce:
Launch Doltgres with default startup configuration.
Connect on port 5432 as postgres/password.
Observe startup diagnostics indicating unresolved doltcore/dsess imports before SQL queries can execute.
Stub / mock context: SCRAM authentication was bypassed by setting EnableAuthentication to false in server/authentication_scram.go so startup behavior could be checked without auth gating; the observed failure still occurs at compile/bootstrap time due to dependency-import mismatch.
Code analysis: I checked the startup and session-related production code paths and found multiple imports now target doltcore/dsess, while dependency pinning still targets a Dolt revision that does not contain that package. This creates a compile-time incompatibility that blocks process startup rather than a test-only runtime artifact.
Why this is likely a bug: Production startup depends on these imports compiling, and the repository’s pinned dependency version does not provide the referenced package, so the failure is a direct code/dependency defect.
Provider lookup errors are surfaced correctly; prior failure came from querying a valid DB context instead of the missing DB target.
Database
OID-backed introspection stayed consistent with pg_database visibility after correct in-database setup.
Provider
Mixed-version startup failed with explicit compatibility diagnostics and no partial running process.
Session
SHOW SCHEMAS succeeded for the connected database and returned user and system schemas.
Session
Invalid DOLTGRES_DB startup still used stale_missing_db, so CREATE SEQUENCE success did not indicate a provider lookup bug.
ℹ️ Additional Findings (2)
These findings are unrelated to the current changes but were observed during testing.
Category
Summary
Screenshot
Catalog
🟠 regclass resolution can return a later-schema match instead of honoring first-match search_path precedence.
Database
⚠️ pg_database returned out-of-scope database names to a constrained session.
🟠 regclass search_path precedence is reversed
What failed: The resolved relation tracks a later scanned schema instead of the first schema in search_path; expected behavior is first-match precedence.
Impact: Metadata and object-resolution flows that rely on regclass can target the wrong object when names collide across schemas. Users can sometimes work around it by schema-qualifying names, but default introspection behavior is incorrect.
Steps to reproduce:
Create the same relation name in two schemas, for example s1.shared_rel and s2.shared_rel.
Set search_path to s1,s2 and run SELECT 'shared_rel'::regclass.
Reverse search_path to s2,s1 and run the same cast again to compare the resolved relation/OID.
Stub / mock context: Authentication checks were bypassed for this run by forcing EnableAuthentication = false in server/authentication_scram.go so local SQL sessions could execute without SCRAM validation.
Code analysis: regclassin stops its callback when it finds a match, but iteration helpers collapse that stop into nil and the outer schema loop continues scanning. Because later callbacks can overwrite resultOid, first-match semantics are lost.
Why this is likely a bug: The production iterator control flow makes a found-match stop signal non-terminal at schema scope, which directly explains the reversed precedence behavior.
What failed: The catalog query exposes database names that should be hidden by database-level authorization; expected behavior is that unauthorized databases are excluded.
Impact: Users with constrained access can enumerate database names outside their allowed scope, leaking metadata across tenants/projects. This weakens authorization boundaries for a core catalog endpoint and can aid further targeted probing.
Steps to reproduce:
Create one in-scope database and one out-of-scope database, then revoke CONNECT on the out-of-scope database for a limited role.
Connect as the limited role and run SELECT datname FROM pg_catalog.pg_database.
Observe that the out-of-scope database name is still returned in the result set.
Stub / mock context: SCRAM sign-in was bypassed to allow deterministic local role sessions, but the leakage check itself used real database role grants/revokes and a real pg_database query path with no mocked catalog output.
Code analysis: I inspected the pg_database table handler and authorization handler paths. The row iterator enumerates all catalog databases from the provider and only filters system DB names, with no per-user privilege check, and the database authorization hook is still a TODO returning nil.
Why this is likely a bug: Production code currently builds the pg_database result set without enforcing database authorization, so unauthorized names can be returned by design.
func (pPgDatabaseHandler) RowIter(ctx*sql.Context, partition sql.Partition) (sql.RowIter, error) {
// TODO: Should the catalog be passed to RowIter like it is for the information_schema tables RowIter?doltSession:=dsess.DSessFromSess(ctx.Session)
c:=sqle.NewDefault(doltSession.GenericProvider()).Analyzer.Catalogdatabases:=c.AllDatabases(ctx)
dbs:=make([]sql.Database, 0, len(databases))
for_, db:=rangedatabases {
name:=db.Name()
ifname=="information_schema"||name=="pg_catalog"||name=="performance_schema" {
continue
}
dbs=append(dbs, db)
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
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.
Depends on: dolthub/dolt#11162