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

MDEV-35614 json unquote utf8mb4 #3694

Draft
wants to merge 6 commits into
base: 10.5
Choose a base branch
from

Conversation

grooverdan
Copy link
Member

  • The Jira issue number for this PR is: MDEV-35614

Description

No smiley emojis in JSON_UNQUOTE.

Release Notes

Smilieys are back.

How can this PR be tested?

basic test case there. Need to do more (and probably split out non-json commits)

Basing the PR against the correct MariaDB version

  • This is a new feature or a refactoring, and the PR is based against the main branch.
  • This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.

PR quality check

  • I checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
  • For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

Return an error, and handle let the caller handler the SQL error.
Add the attribute warn_unused_result on the functions
to ensure they are handled.
Push a warning if the unescaping failed to resolve into the
target character set.

This uses the ER_JSON_BAD_CHAR, which is normally around functions,
but we can't add new error codes so use this as is. Use same args
for the error as JSON functions would for this error code.
emojis are a 4 byte utf sequence. Fix the conversion in JSON_UNQUOTE
to utf8mb4_bin by default.
@grooverdan grooverdan force-pushed the 10.5-MDEV-35614-json_unquote_utf8mb4 branch 2 times, most recently from 18ee060 to c1a7fde Compare December 13, 2024 03:39
JSON functions append in multiple ways, however there isn't always error
handling, and many time it doesn't make it to the end user.

Made the appending string functions withing item_jsonfunc warn if their
true/false result (did an error occur) isn't handled.

Add error handling to many json functions.

realloc_with_extra_if_needed was also previously lacking OOM handing.
@grooverdan grooverdan force-pushed the 10.5-MDEV-35614-json_unquote_utf8mb4 branch from c1a7fde to 7d024cd Compare December 13, 2024 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants