Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary Protocol Error with TEXT Type When Using Rust sqlx and ShardingSphere-Proxy #34819

Open
echo-ethan opened this issue Feb 28, 2025 · 0 comments

Comments

@echo-ethan
Copy link

Bug Report

For English only, other languages will not accept.

Before report a bug, make sure you have:

Please pay attention on issues you submitted, because we maybe need more details.
If no response anymore and we cannot reproduce it on current information, we will close it.


Which version of ShardingSphere did you use?

(Please fill in, e.g. 5.5.2)

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

ShardingSphere-Proxy

Expected behavior

When inserting and reading rows via Rust sqlx with prepared (binary) statements, there should be no errors. Data should be successfully written and retrieved.

Actual behavior

When connecting via ShardingSphere-Proxy, the following errors occur during insert or query operations:

Database(PgDatabaseError {
severity: Error,
code: "58000",
message: "Unknown exception.\nMore details: java.lang.IllegalArgumentException: Cannot find PostgreSQL type 'TEXT' in column type when process binary protocol value",
detail: None, hint: None, position: None, where: None, schema: None, table: None, column: None, data_type: None, constraint: None, file: None, line: None, routine: None
})

Database(PgDatabaseError {
severity: Error,
code: "0A000",
message: "Unsupported SQL operation: binary mode.",
detail: None, hint: None, position: None, where: None, schema: None, table: None, column: None, data_type: None, constraint: None, file: None, line: None, routine: None
})

If I connect directly to PostgreSQL (bypassing ShardingSphere-Proxy), Rust sqlx works without error.

Reason analyze (If you can)

It seems ShardingSphere-Proxy lacks binary protocol support for PostgreSQL TEXT (OID=25) when the driver uses binary mode parameters. Possibly there is no dedicated TEXT binary protocol implementation in PostgreSQLBinaryProtocolValueFactory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant