Skip to content

fix(postgres): keep draining resolved type dependencies in fill_cache - #4498

Open
ducnhan123-co wants to merge 1 commit into
transact-rs:mainfrom
ducnhan123-co:fix/4497-fill-cache-dependencies
Open

ducnhan123-co wants to merge 1 commit into
transact-rs:mainfrom
ducnhan123-co:fix/4497-fill-cache-dependencies

Conversation

@ducnhan123-co

Copy link
Copy Markdown

Does your PR solve an issue?

fixes #4497

Is this a breaking change?

No.

Summary

TypeResolver::fill_cache stores rows removed from missing_dependencies in a local resolved_dependencies deque. If one of those rows still needed another uncached type, the continue 'outer path abandoned the rest of the deque. Rows waiting on them stayed in missing_dependencies, and fill_cache eventually returned unable to resolve type OIDs.

This keeps draining the deque after re-registering the blocked row, so every row taken out of missing_dependencies is either cached or registered again under its new missing OID.

Test

Added it_describes_nested_custom_types in tests/postgres/describe.rs using the nested composite/array schema from the issue and a fresh connection. It fails on main with Protocol("unable to resolve type OIDs: [Oid(17324)]") and passes with the fix. Full tests/postgres and tests/postgres-describe suites pass (62 passed / 2 ignored and 7 passed).

`resolved_dependencies` contains rows already removed from
`missing_dependencies`. When a dependent row still had an uncached
dependency, `continue 'outer` discarded the rest of the deque, leaving
their dependents unresolved.

Keep draining the deque after re-registering the blocked row.

Fixes transact-rs#4497.
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.

Postgres: "unable to resolve type OIDs" when resolving nested composite types — fill_cache drops pending rows on continue 'outer

1 participant