Skip to content

[Bug]: prepared binary execute misses MYSQL_TYPE_JSON parameters #23981

@XuPeng-SH

Description

@XuPeng-SH

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

main

Commit ID

7b1a043

Other Environment Information

  • Hardware parameters:
  • OS type: Linux
  • Others:

Actual Behavior

Prepared-statement binary execute on main does not handle MYSQL_TYPE_JSON parameters. When a client sends a JSON-typed parameter in COM_STMT_EXECUTE, ParseExecuteData falls through to the default branch and returns unsupport parameter type.

Expected Behavior

MYSQL_TYPE_JSON parameters should be parsed like other length-encoded string payloads and reach statement execution successfully.

Steps to Reproduce

  1. Prepare a statement with a JSON placeholder, for example select ? or insert into t values (?) where the target parameter is JSON.
  2. Execute it through the MySQL binary prepared-statement protocol with the parameter type set to MYSQL_TYPE_JSON and a valid JSON payload.
  3. Observe that main returns unsupport parameter type from ParseExecuteData.

Additional information

Local focused regression coverage for the fix:

  • TestParseExecuteDataWithJSONParam

Metadata

Metadata

Assignees

Labels

kind/bugSomething isn't workingseverity/s0Extreme impact: Cause the application to break down and seriously affect the use

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions