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

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

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 5.3.12, 5.5.40, 10.0.14
    • Fix Version/s: 10.1
    • Component/s: None
    • Labels:
      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?).

        Gliffy Diagrams

          Attachments

            Activity

            There are no comments yet on this issue.

              People

              • Assignee:
                bar Alexander Barkov
                Reporter:
                bar Alexander Barkov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: