Skip to content

[Bug] Function "dayofweek"'s result is not same as MySQL's #4785

@morningman

Description

@morningman

Describe the bug
Doris:

mysql> select dayofweek("10:00:00");
+-----------------------+
| dayofweek('10:00:00') |
+-----------------------+
|                     2 |
+-----------------------+
1 row in set (0.06 sec)

MySQL:

mysql> select dayofweek("10:00:00");
+-----------------------+
| dayofweek("10:00:00") |
+-----------------------+
|                  NULL |
+-----------------------+
1 row in set, 1 warning (0.05 sec)

Why
This is because "10:00:00" is converted to "2020-00-00", both in Doris and MySQL.
but dayofweek("2020-00-00") results in NULL in MySQL.

Metadata

Metadata

Assignees

Labels

area/mysql-compatibilityIssues or PRs related to the mysql compatibilityarea/sql/functionIssues or PRs related to the SQL functionskind/fixCategorizes issue or PR as related to a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions