terrymanu commented on issue #10248:
URL:
https://github.com/apache/shardingsphere/issues/10248#issuecomment-3619425179
• Understanding
- PostgreSQL dialect: SQL-level PREPARE/EXECUTE in ShardingSphere-Proxy
returns “You have an error in your SQL syntax”, while the same SQL works when
connecting to native PostgreSQL. You’re asking whether master has fixed it.
Root Cause
- The error came from that historical version lacking SQL-level
PREPARE/EXECUTE/DEALLOCATE parsing/handling in PostgreSQL text protocol, so
parsing failed and Proxy emitted the generic syntax error (MySQL-style
message). It was missing
functionality, not a misuse.
Analysis
- Current master includes full PostgreSQL PREPARE/EXECUTE/DEALLOCATE
grammar and binding/route checking: see
parser/sql/engine/dialect/postgresql/src/main/antlr4/imports/postgresql/DDLStatement.g4
and features/sharding/core/.../
ShardingPrepareRouteContextChecker.java.
- Release notes (5.0.0-beta) list “Support PostgreSQL PREPARE, EXECUTE,
DEALLOCATE statement”; later releases and master retain this.
- Recommended ShardingSphere usage: prefer driver-level Parse/Bind/Execute
(protocol prepared statements). If you use SQL-level PREPARE/EXECUTE, ensure it
routes to a single datasource and stays on the same logical connection;
otherwise
routing checks may reject it or execution may fail.
Conclusion
- Master already supports PostgreSQL PREPARE/EXECUTE/DEALLOCATE. Upgrade
to ≥5.0.0-beta or the latest release/master and verify.
- If it still reproduces on the latest, please provide:
ShardingSphere-Proxy version, backend PostgreSQL version, full SQL,
sharding/RW-splitting/encrypt config, and Proxy logs or error codes (with
stack) for further diagnosis.
--
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]