Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.1.22
-
None
Description
https://mariadb.com/kb/en/mariadb/date_format/
On this page, the format options "#", "." and "@" seems to have been quoted with a typo. They should appear as "%#", "%." and "%@" respectively.
We sample tested the below expression - SELECT STR_TO_DATE('Wednesday, June 2, 2014', '%W, %M %e, %Y'), with and without "%" prefix for the above options. The expressions without "%" prefix gave NULL.
SELECT STR_TO_DATE('Wednesday23423, June 2, 2014', '%W#, %M %e, %Y'); printed NULL
SELECT STR_TO_DATE('Wednesday, June 2, sfsfsf2014', '%W, %M %e, @%Y'); printed NULL
SELECT STR_TO_DATE('Wednesday,##$#$ June 2, 2014', '%W, . %M %e, %Y'); printed NULL
Where as below expressions, with % prefix on above options, worked perfectly well and as per option description provided on the documentation page.
SELECT STR_TO_DATE('Wednesday23423, June 2, 2014', '%W%#, %M %e, %Y'); printed 2014-06-02
SELECT STR_TO_DATE('Wednesday, June 2, sfsfsf2014', '%W, %M %e, %@%Y'); printed 2014-06-02
SELECT STR_TO_DATE('Wednesday,##$#$ June 2, 2014', '%W, %. %M %e, %Y'); printed 2014-06-02
So these three options seem to filter out the undesirable ch from a particular date component. Please confirm.