You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After rewriting expression dayname("1962-03-01")+0, it will generate a plus node having two children function dayname and constant 0.
Because the retType of dayname is string but it is int for constant 0, the plus node will wrap a cast function above dayname to convert its retType to real.
And in TiDB the result of casting nonnumerical stings like "Thursday" to real is 0.
But In MySQL, results of dayname can be regarded as number when doing numerical calculation, "Monday" is regarded as 0, "Tuesday" is 1 and so on.
Now, each builtin functions in TiDB only has one retType and it is string for dayname, so this issue is not easy to fix now.
Bug Report
Please answer these questions before submitting your issue. Thanks!
If possible, provide a recipe for reproducing the error.
In TiDB
tidb-server -V
or runselect tidb_version();
on TiDB)?The text was updated successfully, but these errors were encountered: