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

STR_TO_DATE should work with lc_time_names

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 10.3.14, 10.5.9
    • 12.3.2
    • Server
    • None
    • Mac OS, Debian Linux
    • Unexpected results

    Description

      STR_TO_DATE cannot handle German monthnames:

      MariaDB [(none)]> set lc_time_names="de_DE";
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [(none)]> select version();
      +--------------------+
      | version()          |
      +--------------------+
      | 10.5.9-MariaDB-log |
      +--------------------+
      1 row in set (0.000 sec)
       
      MariaDB [(none)]> select str_to_date(date_format("2010-04-01","%e. %M %Y"), "%e. %M %Y");
      +-----------------------------------------------------------------+
      | str_to_date(date_format("2010-04-01","%e. %M %Y"), "%e. %M %Y") |
      +-----------------------------------------------------------------+
      | 2010-04-01                                                      |
      +-----------------------------------------------------------------+
      1 row in set (0.000 sec)
       
      MariaDB [(none)]> select str_to_date(date_format("2010-03-01","%e. %M %Y"), "%e. %M %Y");
      +-----------------------------------------------------------------+
      | str_to_date(date_format("2010-03-01","%e. %M %Y"), "%e. %M %Y") |
      +-----------------------------------------------------------------+
      | NULL                                                            |
      +-----------------------------------------------------------------+
      1 row in set, 1 warning (0.000 sec)
       
      MariaDB [(none)]> show warnings;
      +---------+------+--------------------------------------------------------------------+
      | Level   | Code | Message                                                            |
      +---------+------+--------------------------------------------------------------------+
      | Warning | 1411 | Incorrect datetime value: '1. März 2010' for function str_to_date  |
      +---------+------+--------------------------------------------------------------------+
      1 row in set (0.000 sec)
       
      MariaDB [(none)]> set lc_time_names="de_DE";
      Query OK, 0 rows affected (0.000 sec)
       
      MariaDB [(none)]> select str_to_date(date_format("2010-06-01","%e. %M %Y"), "%e. %M %Y");
      +-----------------------------------------------------------------+
      | str_to_date(date_format("2010-06-01","%e. %M %Y"), "%e. %M %Y") |
      +-----------------------------------------------------------------+
      | NULL                                                            |
      +-----------------------------------------------------------------+
      1 row in set, 1 warning (0.000 sec)
      

      Attachments

        Issue Links

          Activity

            People

              alice Alice Sherepa
              warp Markus Peter
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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