terrymanu commented on issue #34336:
URL:
https://github.com/apache/shardingsphere/issues/34336#issuecomment-3536194283
📋 Root Cause
ShardingSphere explicitly does not support multiple SQL statements
separated by semicolons executed simultaneously. Related limitations are
documented in:
- Document location:
https://shardingsphere.apache.org/document/current/en/features/sharding/limitation/
- Limitation content: Does not support multiple SQL statements separated
by ; executed simultaneously
💡 Correct Usage
Please execute SQL statements individually:
// ❌ Incorrect approach: multiple statements executed together
String multiSQL = "SELECT * FROM table1; SELECT * FROM table2;";
// ✅ Correct approach: execute statements individually
String sql1 = "SELECT * FROM table1";
// Execute and fully process the result set before executing the next one
String sql2 = "SELECT * FROM table2";
📚 Technical Explanation
This limitation stems from the complexity of distributed architecture:
- Multi-statement execution brings transaction consistency issues
- Streaming result set mechanism requires sequential processing
- Complexity of connection management and route calculation
Conclusion: This is a design limitation of ShardingSphere, not a software
defect. Please follow the official recommended usage pattern and execute SQL
statements individually.
--
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]