Bug #73612 STR_TO_DATE format should allow wildcards
Submitted: 16 Aug 2014 17:40 Modified: 14 May 2018 12:17
Reporter: Adam Fleming Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:all OS:Any
Assigned to: CPU Architecture:Any

[16 Aug 2014 17:40] Adam Fleming
Description:
STR_TO_DATE() format string should allow the '@', '.' and '#' character-class format specifiers
(and really a wild-card that matches ANY character should be supported, like '*' or '?')

How to repeat:
This works: 
SELECT STR_TO_DATE('1:15 EDT 33', '%H:%i EDT %s');

This does not (but should!):
SELECT STR_TO_DATE('1:15 EDT 33', '%H:%i E%@T %s');
[9 Dec 2014 14:11] MySQL Verification Team
Hello Adam Fleming,

Thank you for the report.
Imho this is expected behavior, since this is not a comparison function and these functions can have only 1:1 relationship and if you wants to cover the range, then use appropriate comparison functions, like < , > or BETWEEN etc.

Thanks,
Umesh
[9 Dec 2014 15:38] Adam Fleming
Disagree

Clearly extract_date_time(), which does the pattern matching, already supports this

Look at the source code!
https://github.com/mysql/mysql-server/blob/feac5e02ab298a5c3329ab63ee6db7d9f52bf28d/sql/it...
[14 May 2018 12:17] MySQL Verification Team
Hi,

Thank you for your comment, but this is not a bug. 

Our Reference Manual clearly explains what format string elements can be used with DATE and which could be used with TIME.

Regarding your code reference, it is not relevant, plus it does not say what version and release is it from.