Skip to content

[5.2] [MySQL] Encode JSON parameters in the connection charset - #1799

Merged
tsegismont merged 1 commit into
5.2from
backport/1774-to-5.2
Nov 13, 2026
Merged

tsegismont merged 1 commit into
5.2from
backport/1774-to-5.2

Conversation

@tsegismont

Copy link
Copy Markdown
Member

Backport of #1774 to 5.2
Cherry-picked commit: 85e2b1a

* Encode JSON parameters in the connection charset

Since #1685 JSON parameters were always written as UTF-8, so a
connection with a non-UTF-8 collation received garbled text.

Signed-off-by: Sharang Gupta <sharang@sharanggupta.dev>
Assisted-by: Anthropic Claude (claude-opus-5-5)

* Make the JSON collation test run on MariaDB

MariaDB has no CAST(... AS JSON), so the test failed there with a
syntax error. JSON_EXTRACT takes the parameter directly on both
servers.

Signed-off-by: Sharang Gupta <sharang@sharanggupta.dev>
Assisted-by: Anthropic Claude (claude-fable-5-2)

* Encode JSON parameters through a Writer

Write the JSON straight into the buffer in the connection charset,
so no intermediate String is created for non-UTF-8 collations.

Signed-off-by: Sharang Gupta <sharang@sharanggupta.dev>
Assisted-by: Anthropic Claude (claude-fable-5-2)

---------

Signed-off-by: Sharang Gupta <sharang@sharanggupta.dev>
(cherry picked from commit 85e2b1a)
Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
@tsegismont tsegismont added this to the 5.2.4 milestone Nov 13, 2026
@tsegismont
tsegismont merged commit 329eb66 into 5.2 Nov 13, 2026
18 checks passed
@tsegismont
tsegismont deleted the backport/1774-to-5.2 branch November 13, 2026 09:56
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

Successfully merging this pull request may close these issues.

2 participants