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

uuid data type - convert from text with binary data based on length

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Won't Fix
    • Fix Version/s: N/A
    • Component/s: Data types
    • Labels:
      None

      Description

      text conversion to uuid data type is based on hex characters.

      binary data conversion is base on raw bytes.

      The case of a 16 byte string in a text data type is unambiguous and could be converted as raw bytes rather than the failed conversion below.

      MariaDB [(none)]> select cast(cast(x'00000000000000000000000000000001' as varchar(36)) as uuid);
      +------------------------------------------------------------------------+
      | cast(cast(x'00000000000000000000000000000001' as varchar(36)) as uuid) |
      +------------------------------------------------------------------------+
      | NULL                                                                   |
      +------------------------------------------------------------------------+
      1 row in set, 1 warning (0.000 sec)
       
      MariaDB [(none)]> show warnings;
      +---------+------+----------------------------------------------------------------------------------------------------------+
      | Level   | Code | Message                                                                                                  |
      +---------+------+----------------------------------------------------------------------------------------------------------+
      | Warning | 1292 | Incorrect uuid value: '\0000\0000\0000\0000\0000\0000\0000\0000\0000\0000\0000\0000\0000\0000\0000\0001' |
      +---------+------+----------------------------------------------------------------------------------------------------------+
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              danblack Daniel Black
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration