terrymanu commented on PR #39225: URL: https://github.com/apache/shardingsphere/pull/39225#issuecomment-5266125530
@somiljain2006 Thanks. The proposed direction is aligned with the requested boundaries. Please proceed with the implementation. Please keep the following contracts explicit: 1. `PostgreSQLServerPreparedStatement` should own the per-parameter state required across Describe, Bind, repeated Bind, and batch execution. A parameter should be considered resolved only when the state contains enough information to emit the correct `ParameterDescription` type OID and decode or bind its value correctly. A native type name is required where the type cannot be represented safely by the existing fixed protocol types. 2. Bind must resolve the parameter type before type-dependent decoding. JSON and JSONB must remain distinct, and an arbitrary `Types.OTHER` value must not be silently decoded as JSON or mapped to `VARCHAR`. 3. Semantic resolution must use each marker’s complete `ColumnSegmentBoundInfo`, including its database, schema, table, and column ownership. Missing or ambiguous ownership should remain unresolved rather than falling back to a statement-wide schema or a same-named object. 4. The metadata-only Describe path may be used only when all parameter and result types required by the response have been resolved unambiguously. Otherwise, use the existing JDBC metadata fallback. In particular, RETURNING projections must not be described from the statement’s first table when their actual ownership is different or unknown. 5. Preserve the existing PostgreSQL and openGauss composite-column OID behavior established by #39241 and #39253. This PR does not need a broader OID architecture change, but it must not replace actual composite result OIDs with the `VARCHAR` OID or remove the existing supported behavior. 6. Tests should exercise the real parser/Binder/Describe/Bind path and cover Describe-first, Bind-first, repeated Bind, batch execution, ordinary `VARCHAR`, JSON, JSONB, arbitrary custom types, schema-qualified and cross-schema statements, RETURNING expressions, composite result OIDs, and the already-resolved text fast path without additional connection or metadata access. The exact shape and name of the parameter-state class can remain an implementation detail as long as these behavioral contracts are satisfied. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
