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: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.3.14, 10.5.9
    • 10.4, 10.5, 10.6
    • None
    • None
    • Mac OS, Debian Linux

    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

        Activity

          People

            rucha174 Rucha Deodhar
            warp Markus Peter
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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