terrymanu commented on issue #37515:
URL:
https://github.com/apache/shardingsphere/issues/37515#issuecomment-3691433918
Problem Understanding
I used ShardingSphere-Proxy with the front-end protocol set to MySQL to
register Oracle storage units and an encryption rule in the governance center.
When ShardingSphere-JDBC connects via that governance center, my logical SQL
uses Oracle-style double quotes, but the rewritten SQL turns the encrypted
column pwd into backticks, and Oracle returns ORA-00911.
Root Cause
Because the DistSQL was executed on a Proxy whose
proxy-frontend-database-protocol-type is MySQL, the governance metadata is
persisted with the protocol/database type as MySQL. ShardingSphere-JDBC then
loads that governance config and performs parsing/rewriting using the MySQL
dialect, so identifiers get backticks instead of Oracle double quotes. Proxy
currently supports only MySQL/PostgreSQL/openGauss front-end protocols
(official docs:
https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-proxy/yaml-config/props/#proxy-frontend-database-protocol-type),
so there is no Oracle front-end protocol to drive Oracle-style
parsing/rewriting when configuring via Proxy.
Analysis
- In governance mode, the dialect for parsing/rewriting comes from the
persisted “protocol type,” not from the datasource URL.
- Executing DistSQL on a MySQL-protocol Proxy fixes that protocol type as
MySQL in the registry.
- ShardingSphere-JDBC reads the governance config and selects the MySQL
parser/rewriter, which outputs backticks.
- Oracle cannot parse backticks, leading to ORA-00911; the encryption rule
itself isn’t at fault.
- This matches the supported front-end protocols: with no Oracle front-end
protocol in Proxy, using Proxy to maintain Oracle configs will naturally
produce MySQL-style metadata and SQL rewriting.
Conclusion
This is a usage/compatibility issue rather than a product defect. Oracle
should be configured so that governance metadata reflects the Oracle dialect
and is consumed directly by ShardingSphere-JDBC; using a MySQL-protocol Proxy
to create that metadata causes the MySQL dialect to be applied and leads to the
observed Oracle syntax error.
--
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]