MariaDB Development
  1. MariaDB Development
  2. MDEV-4842

STR_TO_DATE does not work with UCS2/UTF16/UTF32

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.4, 5.5.33a, 5.3.13
    • Fix Version/s: 10.0.6
    • Labels:
    • Global Rank:
      3402

      Description

      STR_TO_DATE returns NULL with a warning in case of a correct input
      in combination with ucs2, utf16, utf16le, or utf32:

      MySQL [test]> set character_set_connection=ucs2; select str_to_date('2001-01-01','%Y-%m-%d');show warnings;
      Query OK, 0 rows affected (0.00 sec)
      
      +--------------------------------------+
      | str_to_date('2001-01-01','%Y-%m-%d') |
      +--------------------------------------+
      | NULL                                 |
      +--------------------------------------+
      1 row in set, 1 warning (0.00 sec)
      
      +---------+------+-------------------------------------------------------+
      | Level   | Code | Message                                               |
      +---------+------+-------------------------------------------------------+
      | Warning | 1411 | Incorrect datetime value: '' for function str_to_date |
      +---------+------+-------------------------------------------------------+
      1 row in set (0.00 sec)
      

      The expected result is: 2001-01-01.

      Note, MySQL-5.6 demonstrates the same problem.

        Activity

        Hide
        Alexander Barkov added a comment -

        Pushed into 5.3, 5.5, 10.0-base.

        Show
        Alexander Barkov added a comment - Pushed into 5.3, 5.5, 10.0-base.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: