schizophrenicmaniac commented on PR #40212:
URL: https://github.com/apache/shardingsphere/pull/40212#issuecomment-6234037023

   @terrymanu I pushed another commit for points 5 and 6.
   
   5. On the Bind path, INSERT parameters are no longer typed from columns 
whose JDBC type covers more than one PostgreSQL type: OTHER (uuid, jsonb, 
inet...), TIMESTAMP and TIME (with or without time zone), DOUBLE (float8 and 
money) and ARRAY. `ShardingSphereColumn` only keeps the JDBC type, so those 
parameters stay unspecified and their text goes to PostgreSQL as it did before. 
The same change covers the timestamptz INSERT case I asked about earlier, so I 
went with that option. The only cost is that an OID 0 sharding key on one of 
those column types still can't be routed, which was already the case before 
this PR. Describe still maps these types the way it did before, since it has to 
report a parameter type.
   
   6. Bind now loads the parameter metadata through a separate 
`PostgreSQLPreparedStatementMetadataFactory.loadForParameterMetadata`, which 
doesn't run `DialectJDBCResultMetadataChecker`. The route there is made without 
parameter values and can be wider than the real one, and only the parameter 
types are read from it, so the composite result restriction is still checked 
when the statement executes. Describe and the batch paths keep the check.
   
   I also added a test for a nested marker like `VALUES (length($1), $2)`. `$2` 
gets the column type and `$1` stays unspecified.


-- 
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]

Reply via email to