## 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.-->
## Proposed changes
Issue Number: close #xxx
<!--Describe your changes.-->
This commit is contained in:
@ -831,7 +831,7 @@ struct UnixTimeStampStrImpl {
|
||||
std::tie(col_right, format_const) =
|
||||
unpack_if_const(block.get_by_position(arguments[1]).column);
|
||||
|
||||
auto col_result = ColumnDecimal<Decimal64>::create(input_rows_count, 0);
|
||||
auto col_result = ColumnDecimal<Decimal64>::create(input_rows_count, 6);
|
||||
auto null_map = ColumnVector<UInt8>::create(input_rows_count);
|
||||
auto& col_result_data = col_result->get_data();
|
||||
auto& null_map_data = null_map->get_data();
|
||||
|
||||
Reference in New Issue
Block a user