XiFYuW commented on issue #34052:
URL: 
https://github.com/apache/shardingsphere/issues/34052#issuecomment-2543497272

   > Can you find the difference between IDEA and SQL line in your environment?
   
   SQL statements printed at the IDEA runtime:
   
   ```
   SQL 1:
   2024-12-15 14:18:41 [virtual-309] INFO  ShardingSphere-SQL - Logic SQL: 
SELECT COUNT( * ) AS total FROM  lo_order_continue         WHERE  (sid = ? AND 
is_pay = ? AND month = ?) limit 1
   2024-12-15 14:18:41 [virtual-309] INFO  ShardingSphere-SQL - Actual SQL: 
ds_1 ::: SELECT COUNT( * ) AS total FROM  lo_order_continue_202411         
WHERE  (sid = ? AND is_pay = ? AND month = ?) limit 1 ::: [4, false, 202411]
   <==    Columns: total
   <==        Row: 0
   <==      Total: 1
   
   SQL 2:
   2024-12-15 14:18:41 [virtual-309] INFO  ShardingSphere-SQL - Logic SQL: 
SELECT COUNT( * ) AS total FROM  lo_order_continue         WHERE  (sid = ? AND 
is_pay = ? AND month IN (?,?))
   2024-12-15 14:18:41 [virtual-309] INFO  ShardingSphere-SQL - Actual SQL: 
ds_1 ::: SELECT COUNT( * ) AS total FROM  lo_order_continue_202411         
WHERE  (sid = ? AND is_pay = ? AND month IN (?,?)) UNION ALL SELECT COUNT( * ) 
AS total FROM  lo_order_continue_202412         WHERE  (sid = ? AND is_pay = ? 
AND month IN (?,?)) ::: [4, false, 202411, 202412, 4, false, 202411, 202412]
   <==    Columns: total
   <==        Row: 0
   <==      Total: 1
   ```
   
   SQL statements printed when run in "java -jar" mode:
   
   ```
   SQL 1:
   2024-12-15 14:35:37 [virtual-136] INFO  ShardingSphere-SQL - Logic SQL: 
SELECT COUNT( * ) AS total FROM  lo_order_continue         WHERE  (sid = ? AND 
is_pay = ? AND month = ?) limit 1
   2024-12-15 14:35:37 [virtual-136] INFO  ShardingSphere-SQL - Actual SQL: 
ds_1 ::: SELECT COUNT( * ) AS total FROM  lo_order_continue_202412         
WHERE  (sid = ? AND is_pay = ? AND month = ?) limit 1 ::: [4, false, 202412]
   <==    Columns: total
   <==        Row: 0
   <==      Total
   
   SQL 2:
   2024-12-15 14:35:37 [virtual-136] INFO  ShardingSphere-SQL - Logic SQL: 
SELECT COUNT( * ) AS total FROM  lo_order_continue         WHERE  (sid = ? AND 
is_pay = ? AND month IN (?,?))
   2024-12-15 14:35:37 [virtual-136] INFO  ShardingSphere-SQL - Actual SQL: 
ds_1 ::: SELECT COUNT( * ) AS total FROM  lo_order_continue_202411         
WHERE  (sid = ? AND is_pay = ? AND month IN (?,?)) UNION ALL SELECT COUNT( * ) 
AS total FROM  lo_order_continue_202412         WHERE  (sid = ? AND is_pay = ? 
AND month IN (?,?)) ::: [4, false, 202411, 202412, 4, false, 202411, 202412]
   <==    Columns: total
   <==        Row: 0
   <==        Row: 0
   <==      Total: 2
   ```
   
   The two methods print out the same SQL statement, and the result is 
different when executing "SQL 2". My environment is consistent.
   


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