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

   @terrymanu Thanks, I pushed a commit for the domain case.
   
   Early decoding is now limited to sharding columns. I added a 
`ShardingColumnRuleAttribute` in infra, which the sharding rule implements, and 
the resolver only takes a column type from a column that it reports as a 
sharding column of the logic table. A parameter compared with or assigned to 
any other column, including an integer-domain column like the one in your 
example, now counts as an occurrence without a column type. So it stays OID 0 
text and PostgreSQL picks the operator from the unknown operand the same way it 
does on master. The same goes for a parameter used with both a sharding column 
and another column. If the database has no sharding rule, the resolver returns 
before looking at the statement.
   
   The only values still decoded early are OID 0 integer text compared with or 
assigned to an int4/int8 sharding column. On master those already fail on the 
first Bind with "Sharding value must implements Comparable", so no first-Bind 
statement that works today gets a different parameter type. I added tests for a 
non-sharding integer column, an integer-domain column, a parameter used with 
both kinds of column, and an UPDATE SET and an INSERT value of a non-sharding 
column.


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