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

QUOTE() does not wok well with NULL+UCS2

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 5.3.12, 5.5.39, 10.0.13
    • Fix Version/s: 10.0
    • Component/s: None
    • Labels:
      None

      Description

      MariaDB [test]> SELECT QUOTE(CAST(NULL AS CHAR CHARACTER SET utf8)), QUOTE(_ucs2 0x0061), QUOTE(CAST(NULL AS CHAR CHARACTER SET ucs2));
      +----------------------------------------------+---------------------+----------------------------------------------+
      | QUOTE(CAST(NULL AS CHAR CHARACTER SET utf8)) | QUOTE(_ucs2 0x0061) | QUOTE(CAST(NULL AS CHAR CHARACTER SET ucs2)) |
      +----------------------------------------------+---------------------+----------------------------------------------+
      | NULL                                         | 'a'                 | 乕䱌                                         |
      +----------------------------------------------+---------------------+----------------------------------------------+
      1 row in set (0.00 sec)
      

      The expected result according to the manual
      for the third column should be a string 'NULL' (four letters),
      similar to the first column.

      For non-NULL values QUOTE seem to work fine for an UCS2 argument,
      as the second column demonstrates.

        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: