Do we consider the following a bug? ```SELECT coun...
# questions-and-troubleshooting
c
Do we consider the following a bug?
Copy code
SELECT count(*)
FROM sales
WHERE created_at >='2021-02-01T00:00:00'
  --                        vv 21st of Feb
  AND created_at <='2025-02-21T00:00:00';

+----------+
| count(*) |
+----------+
| 24176    |
+----------+

SELECT count(*)
FROM sales
WHERE created_at >='2021-02-01T00:00:00'
  --                        vv 30th of Feb which doesn't exist
  AND created_at <='2025-02-30T00:00:00';

+----------+
| count(*) |
+----------+
|        0 |
+----------+
With the invalid timestamp, it doesn't return anything anymore.
е
add FORBID_INVALID_DATE to sql_mode
c
Is it possible to set it like a global variable? I can see the doc here https://docs.starrocks.io/docs/sql-reference/System_variable/#sql_mode I tried
set forbid_invalid_date=1;
and it didn't work.
The MySQL library I am using won't let me set arbitrary thing to sql_mode. It only has some [pre-defined modes](https://docs.rs/sqlx-mysql/0.8.6/src/sqlx_mysql/options/mod.rs.html#95-113) like
pipes_as_concat,no_engine_substitution
е
it is set global sql_mode = ‘list of comma separated modes’
👍 1