I am running into an inconsistent behaviour across two different Docker image with the STR_TO_DATE function. On running on a ubuntu box and the other one running on my Mac.
On Linux:
SELECT STR_TO_DATE('203005','%H%i%s');
+--------------------------------+
| STR_TO_DATE('203005','%H%i%s') |
+--------------------------------+
| 20:30:05 |
+--------------------------------+
SELECT VERSION();
+-----------+
| VERSION() |
+-----------+
| 8.0.19 |
+-----------+
On my Mac:
SELECT STR_TO_DATE('203005','%H%i%s');
+--------------------------------+
| STR_TO_DATE('203005','%H%i%s') |
+--------------------------------+
| NULL |
+--------------------------------+
SELECT VERSION();
+-----------+
| VERSION() |
+-----------+
| 8.0.12 |
+-----------+
show warnings;
+---------+------+-------------------------------------------------------------+
| Level | Code | Message |
+---------+------+-------------------------------------------------------------+
| Warning | 1411 | Incorrect datetime value: '203005' for function str_to_date |
+---------+------+-------------------------------------------------------------+
Both running Mysql on a Docker image:
docker_container:
name: mysql
image: mysql:8.0