Fully handle type initialization#2778
Conversation
be5994a to
da77132
Compare
16b778d to
59b6c92
Compare
|
e699b6d to
176cc27
Compare
Ito Test Report ❌14 test cases ran. 3 failed, 2 additional findings, 9 passed. Overall, 14 test cases ran with 9 passing and 5 failing: recursive type-graph resolution, most explicit-cast behavior, custom type creation happy paths, array/ANY runtime checks, and cold-start initialization scenarios all behaved correctly in local verification (with SCRAM authentication disabled for deterministic access). The key confirmed defects are four High-severity issues and one Medium issue in production code paths: domain-default explicit casts can panic (unqualified table lookup and nil resolved-type dereference), type serialization and pg_type relationship projection can nil-dereference pointer fields, CREATE TYPE/DOMAIN companion-array creation is non-atomic and can leave orphaned/conflicting metadata on failure, and domain merge logic can drop check constraints by appending to the wrong object. ❌ Failed (3)
|
|
zachmu
left a comment
There was a problem hiding this comment.
Can't find too much to fault. The AI tester's comments seem relevant in light of the regressions.
88afb3d to
cd4e68e
Compare
Ito Test Report ❌
16 test cases ran. 3 failed, 13 passed. Across the unified verification, 16 test cases were exercised with 13 passing and 3 failing (plus one execution that yielded no verifiable functional outcome), indicating broad stability but not release readiness. Most cast/operator/metadata and deserialization-guard paths behaved correctly—including cyclic type-graph handling, trailing-byte rejection, composite attribute hydration after restart, explicit cast/domain resolution, assignment-cast and synthesized array-cast behavior, expected ANY/missing-type errors, and consistent pg_type/OID exposure—but three high-severity regressions introduced by this PR remain: restart-time crashes when persisted enum or migrated user-defined types are deserialized via recursive context-dependent type loading with nil SQL context, and a domain-backed composite literal path that succeeds at DDL creation but fails later with unresolved attribute-type deserialization. ❌ Failed (3)
|
|
Regressions are exposing missing logic that didn't cause errors before, and are causing errors now that we're effectively enforcing our created types to actually be correct. |
cd4e68e to
c08a1d7
Compare
Ito Test Report ❌
17 test cases ran. 2 failed, 2 additional findings, 13 passed. Overall, the unified run failed with 13 of 17 tests passing and 4 high-severity failures, despite broad stability in recursive unresolved-type handling, concurrent lookup determinism, array operator error safety, polymorphic anyarray behavior, and pg_type/pgwire metadata integrity across reconnects. The critical defects were reproducible panics in restart-time and post-restart domain/composite type paths (including a nil SQL-context deserialization crash and cast panic, both marked as introduced by this PR), a recovered insert-time domain-constraint analyzer panic (“table not found”), and non-atomic CREATE DOMAIN behavior that can leave orphaned type state after companion array creation failure. ❌ Failed (2)
|












































We deserialize types such that all related types (the array type, the base type, composite attributes, etc.) are IDs that are stored on the type, requiring a lookup when that related type is needed. This fails in cases where we either do not have a context available, or something in GMS causes incomplete type information to be created after the type resolution analyzer step.
To work around these limitations, we now pass a context to the deserialization step, and allow the collection to cache types that are currently being deserialized to allow for recursive type references (such as the base type and array type referring to one another). All other changes are related to this core idea, being either interface/field changes or bug fixes.