Skip to content
/ server Public

MDEV-38791: Disallow duplicate weekday formats in TO_DATE#4810

Open
alexDiaconuAlex wants to merge 1 commit intoMariaDB:12.3from
alexDiaconuAlex:MDEV-38791-fix-12.3
Open

MDEV-38791: Disallow duplicate weekday formats in TO_DATE#4810
alexDiaconuAlex wants to merge 1 commit intoMariaDB:12.3from
alexDiaconuAlex:MDEV-38791-fix-12.3

Conversation

@alexDiaconuAlex
Copy link

@alexDiaconuAlex alexDiaconuAlex commented Mar 15, 2026

Problem

When using TO_DATE with sql_mode='ORACLE', providing duplicate weekday format specifiers (such as 'DAY DY') did not throw an error during the format string parsing phase.

Solution

Added duplicate format checks for weekday specifiers in parse_format_string() (inside sql/item_timefunc.cc).

Now, inputs like SELECT TO_DATE('Monday Mon', 'DAY DY') FROM DUAL; correctly fail early and return ERROR 3047 (HY000): Invalid argument error: date format not recognized at DY in function to_date.

Reported-by: Elena Stepanova elenastepanova@github

Reported-by: Elena Stepanova <elenastepanova@github>

Signed-off-by: Alexandru Diaconu <alexandrudiaconu93@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant