terrymanu commented on issue #32150:
URL: 
https://github.com/apache/shardingsphere/issues/32150#issuecomment-3638214178

   ##  Understanding:
   
    Using Proxy 5.5.0 (Standalone + JDBC/H2 repository). First start with 
default MySQL client on port 3307, register PostgreSQL storage units. After 
restart, MySQL client connection hangs; clearing the config repository restores 
connectivity. Setting proxy-
     frontend-database-protocol-type: MySQL makes it connect, but requires 
deleting existing repository. Forcing MySQL frontend then hits SHOW COLUMNS 
FROM syntax errors on PostgreSQL backend.
   
   ##  Root Cause: 
   
   Without an explicit frontend protocol, FrontDatabaseProtocolTypeFactory 
switches to the storage unit’s database type once metadata is loaded. After 
registering PostgreSQL storage, the frontend protocol becomes PostgreSQL on 
restart; a MySQL client handshake
     is incompatible and appears as a hang. Clearing the repository removes 
metadata, so it falls back to default MySQL. Forcing MySQL against a PostgreSQL 
backend triggers MySQL-style metadata queries (e.g., SHOW COLUMNS), which fail 
on PostgreSQL.
   
   ##  Analysis: 
   
   Current config lacks proxy-frontend-database-protocol-type, and after the 
repository is created, Proxy reads from the repository, not the local 
global.yaml, so changing the local file alone has no effect. Protocol mismatch 
between client/frontend/backend
     yields handshake hangs and SQL dialect errors—expected behavior, not a 
Proxy defect. Proper usage requires aligning frontend protocol with the client 
and backend dialect.
   
   ##  Conclusion / Guidance: 
   
   This is a configuration/usage issue, not a ShardingSphere bug.
   
     - If backend is PostgreSQL, use a PostgreSQL client and set 
proxy-frontend-database-protocol-type: PostgreSQL in the repository (e.g., via 
DistSQL ALTER PROXY 
PROPERTIES('proxy-frontend-database-protocol-type'='PostgreSQL'); then restart) 
or during initial setup.
     - If you need MySQL protocol, only use MySQL-dialect backends; 
cross-dialect (MySQL protocol to PostgreSQL backend) is unsupported and will 
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]

Reply via email to