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

   @terrymanu Thanks, I pushed a commit for both.
   
   1. A WHERE condition is now only used when every OR branch of it has a 
sharding condition: a compare, IN or BETWEEN on a sharding column with non-null 
parameters or literals, not negated. It follows the same AND/OR combination as 
routing's DNF expansion, but checks it recursively without building the 
branches, so the cost stays linear. In `WHERE v=0 OR id=$1`, `$1` now stays OID 
0 text and PostgreSQL picks the operator the same way it does on master. A NULL 
parameter also makes routing broadcast, so a branch like `id>$1` with `$1` NULL 
counts as having no sharding condition too. The cost is that `id=$1 OR v=0`, 
which fails on master because routing reads `$1` before it reaches the second 
branch, still fails. There are first-Bind tests for `v=0 OR id=$1` and for 
`id>$1 OR k=$2` with a NULL `$1`.
   
   2. The `NOT IN` and `NOT BETWEEN` cases are now two separate `@Test` methods 
with the same assertions.
   
   I also updated the PR description, since it said every parameter resolved 
here already fails on master.


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