Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-41153

json_escape() omits the second \u in surrogate pairs for non-BMP characters

    XMLWordPrintable

Details

    • Q4/2026 Server Development

    Description

      Test:

      SELECT JSON_SET(_latin1'{}', '$.x', _utf8mb4 0xF09F9880);
      JSON_SET(_latin1'{}', '$.x', _utf8mb4 0xF09F9880)
      NULL
      Warnings:
      Warning	4038	Syntax error in JSON text in argument 1 to function 'json_set' at position 12
      

      If we comment out json_nice:

      SELECT JSON_SET(_latin1'{}', '$.x', _utf8mb4 0xF09F9880);
      JSON_SET(_latin1'{}', '$.x', _utf8mb4 0xF09F9880)
      {"x":"\uD83DDE00"}
      

      Note "\uD83DDE00" whereas expected value is "\uD83D\uDE00".

      Attachments

        Issue Links

          Activity

            People

              gkodinov Georgi Kodinov
              svoj Sergey Vojtovich
              Raghunandan Bhat Raghunandan Bhat
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 0d
                  0d
                  Remaining:
                  Remaining Estimate - 3h
                  3h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified

                  Git Integration

                    Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.