v.23.3New Feature

Add OrNull and OrZero variants for parseDateTime and alias str_to_date for MySQL compatibility

Add *OrNull() and *OrZero() variants for parseDateTime, add alias str_to_date for MySQL parity. #48000 (Robert Schulze).
Added *OrNull() and *OrZero() variants for parseDateTime functions and introduced the alias str_to_date for MySQL compatibility.

Why it matters

These additions improve date-time parsing flexibility by allowing users to handle parse failures gracefully with OrNull() and OrZero() variants, returning NULL or zero timestamps instead of errors. The alias str_to_date aligns ClickHouse syntax closer to MySQL, easing migration and interoperability.

How to use it

Use the new variants by appending OrNull() or OrZero() to existing parseDateTime function names, e.g., parseDateTimeOrNull(). To utilize the MySQL-compatible alias, replace parseDateTime with str_to_date in your queries.