[MDEV-12541] str_to_date option not properly escaped Created: 2017-04-20  Updated: 2017-05-02  Resolved: 2017-05-02

Status: Closed
Project: MariaDB Server
Component/s: Documentation
Affects Version/s: 10.1.22
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Ashwin Gopalakrishnan Assignee: Ian Gilfillan
Resolution: Fixed Votes: 0
Labels: 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.



 Comments   
Comment by Ian Gilfillan [ 2017-05-02 ]

Thanks, the documentation has been updated

Generated at Thu Feb 08 07:58:31 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.