[fix](function) error scale set in unix_timestamp (#36110)#37619
[fix](function) error scale set in unix_timestamp (#36110)#37619yiguolei merged 2 commits intoapache:branch-2.1from
Conversation
## Proposed changes
```
mysql [test]>set DEBUG_SKIP_FOLD_CONSTANT = true;
Query OK, 0 rows affected (0.00 sec)
mysql [test]>select cast(unix_timestamp("2024-01-01",'yyyy-MM-dd') as bigint);
+------------------------------------------------------------+
| cast(unix_timestamp('2024-01-01', 'yyyy-MM-dd') as BIGINT) |
+------------------------------------------------------------+
| 1704038400000000 |
+------------------------------------------------------------+
```
now
```
mysql [test]>select cast(unix_timestamp("2024-01-01",'yyyy-MM-dd') as bigint);
+------------------------------------------------------------+
| cast(unix_timestamp('2024-01-01', 'yyyy-MM-dd') as BIGINT) |
+------------------------------------------------------------+
| 1704038400 |
+------------------------------------------------------------+
1 row in set (0.01 sec)
```
The column does not have a scale set, but the cast uses the scale to
perform the cast.
<!--Describe your changes.-->
|
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
|
run buildall |
|
clang-tidy review says "All clean, LGTM! 👍" |
|
TeamCity be ut coverage result: |
|
run buildall |
|
clang-tidy review says "All clean, LGTM! 👍" |
|
TeamCity be ut coverage result: |
| // UNIX_TIMESTAMP | ||
| def unin_timestamp_str = """ select unix_timestamp() """ | ||
| assertTrue(unin_timestamp_str[0].size() == 1) | ||
|
|
There was a problem hiding this comment.
sql """set DEBUG_SKIP_FOLD_CONSTANT = true;""" is missing?
|
Is this picked from #36110 ? If so, why |
Because no such variable in 2.1 java.sql.SQLException: errCode = 2, detailMessage = Unknown system variable 'DEBUG_SKIP_FOLD_CONSTANT',the similar variables are {'forbid_unknown_col_stats', 'enable_strong_consistency_read', 'enable_function_pushdown'} |
Proposed changes
#36110
now
The column does not have a scale set, but the cast uses the scale to perform the cast.
Proposed changes
Issue Number: close #xxx