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

Multi-chunk string literals are not consistent against character set introducer

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 5.3.12, 5.5.40, 10.0.14, 10.6, 10.11, 11.4, 11.8, 12.1
    • 12.2
    • None
    • None

    Description

      MariaDB [test]> SELECT HEX(_ucs2'abc' ''),HEX(_ucs2 'ab' 'c'), HEX(_ucs2'a' 'bc');
      +--------------------+---------------------+--------------------+
      | HEX(_ucs2'abc' '') | HEX(_ucs2 'ab' 'c') | HEX(_ucs2'a' 'bc') |
      +--------------------+---------------------+--------------------+
      | 00616263           | 61620063            | 006100620063       |
      +--------------------+---------------------+--------------------+
      1 row in set (0.00 sec)

      The leftmost chunk is "cast" to the character set of the introducer.
      The second and further chunks are converted.

      All chunks must be either "cast" individually,
      or all chunks must be concatenated together, then cast.

      Btw, according to the SQL standard, all chunks should
      actually be converted (not cast!) from the session character set
      to the introducer character set. But this can be changed only
      in a major release (10.1?).

      Attachments

        Activity

          People

            bar Alexander Barkov
            bar Alexander Barkov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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