Skip to content

[fix](fe) Accept BLOB prepared statement parameters - #67306

Open
1fanwang wants to merge 1 commit into
apache:masterfrom
1fanwang:fix/mysql-blob-parameter-decoding
Open

[fix](fe) Accept BLOB prepared statement parameters#67306
1fanwang wants to merge 1 commit into
apache:masterfrom
1fanwang:fix/mysql-blob-parameter-decoding

Conversation

@1fanwang

Copy link
Copy Markdown

What problem does this PR solve?

Issue Number: closes #67301

Related PR: N/A

Problem Summary:

MySQL Connector/ODBC sends wide-character prepared-statement values with MySQL's BLOB type code. Doris rejects the parameter before statement execution with AnalysisException: Unsupported MySQL type: BLOB.

All four protocol-equivalent BLOB types now use the existing length-encoded string decoder. The unit test covers Unicode text and verifies that decoding consumes only the parameter payload.

Release note

Prepared statements now accept string parameters sent with MySQL BLOB type codes.

Check List (For Author)

  • Test
    • Unit Test
Raw test output
$ git restore --source=2689e0d7fdb111bf822cebc26d7d5765a563e276 -- \
    fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/Literal.java
$ ./run-fe-ut.sh --run org.apache.doris.nereids.trees.expressions.LiteralTest#testMysqlBlobParameter
Unexpected exception thrown: org.apache.doris.nereids.exceptions.AnalysisException: Unsupported MySQL type: BLOB
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
BUILD FAILURE

$ git restore --source=HEAD -- \
    fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/Literal.java
$ ./run-fe-ut.sh --run org.apache.doris.nereids.trees.expressions.LiteralTest#testMysqlBlobParameter
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
BUILD SUCCESS
  • Behavior changed:

    • Yes. Prepared statements accept length-encoded BLOB parameters as string literals.
  • Does this need documentation?

    • No.

Check List (For Reviewer who merge this PR)

  • Confirm the release note.
  • Confirm the test case.
  • Confirm documentation impact.
  • Add a branch-pick label if needed.

### What problem does this PR solve?

Issue Number: close apache#67301

Problem Summary: Doris rejects wide ODBC strings because their prepared parameters use BLOB type codes.

### Release note

Prepared statements accept MySQL BLOB string parameters.

### Check List (For Author)

- Test: Unit Test
- Behavior changed: Yes
- Documentation: No

Signed-off-by: 1fanwang <1fannnw@gmail.com>
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants