[Fix](function) Fix wrong decimal of unix_timestamp#55013
[Fix](function) Fix wrong decimal of unix_timestamp#55013zclllyybb merged 1 commit intoapache:masterfrom
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
FE UT Coverage ReportIncrement line coverage |
TPC-H: Total hot run time: 33755 ms |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
TPC-DS: Total hot run time: 184602 ms |
ClickBench: Total hot run time: 32.56 s |
|
run buildall |
|
run buildall |
TPC-H: Total hot run time: 33501 ms |
TPC-DS: Total hot run time: 183979 ms |
ClickBench: Total hot run time: 32.58 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
|
run buildall |
TPC-H: Total hot run time: 33763 ms |
TPC-DS: Total hot run time: 184993 ms |
ClickBench: Total hot run time: 32.47 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
when the input datetime has decimal part start with zero, the result was
wrong before. now fixed.
before:
```sql
mysql> select UNIX_TIMESTAMP('2015-11-13 10:20:19.012');
+-------------------------------------------+
| UNIX_TIMESTAMP('2015-11-13 10:20:19.012') |
+-------------------------------------------+
| 1447381219.120 |
+-------------------------------------------+
```
now:
```sql
mysql> select UNIX_TIMESTAMP('2015-11-13 10:20:19.012');
+-------------------------------------------+
| UNIX_TIMESTAMP('2015-11-13 10:20:19.012') |
+-------------------------------------------+
| 1447381219.012 |
+-------------------------------------------+
```
when the input datetime has decimal part start with zero, the result was
wrong before. now fixed.
before:
```sql
mysql> select UNIX_TIMESTAMP('2015-11-13 10:20:19.012');
+-------------------------------------------+
| UNIX_TIMESTAMP('2015-11-13 10:20:19.012') |
+-------------------------------------------+
| 1447381219.120 |
+-------------------------------------------+
```
now:
```sql
mysql> select UNIX_TIMESTAMP('2015-11-13 10:20:19.012');
+-------------------------------------------+
| UNIX_TIMESTAMP('2015-11-13 10:20:19.012') |
+-------------------------------------------+
| 1447381219.012 |
+-------------------------------------------+
```
when the input datetime has decimal part start with zero, the result was
wrong before. now fixed.
before:
```sql
mysql> select UNIX_TIMESTAMP('2015-11-13 10:20:19.012');
+-------------------------------------------+
| UNIX_TIMESTAMP('2015-11-13 10:20:19.012') |
+-------------------------------------------+
| 1447381219.120 |
+-------------------------------------------+
```
now:
```sql
mysql> select UNIX_TIMESTAMP('2015-11-13 10:20:19.012');
+-------------------------------------------+
| UNIX_TIMESTAMP('2015-11-13 10:20:19.012') |
+-------------------------------------------+
| 1447381219.012 |
+-------------------------------------------+
```
when the input datetime has decimal part start with zero, the result was
wrong before. now fixed.
before:
```sql
mysql> select UNIX_TIMESTAMP('2015-11-13 10:20:19.012');
+-------------------------------------------+
| UNIX_TIMESTAMP('2015-11-13 10:20:19.012') |
+-------------------------------------------+
| 1447381219.120 |
+-------------------------------------------+
```
now:
```sql
mysql> select UNIX_TIMESTAMP('2015-11-13 10:20:19.012');
+-------------------------------------------+
| UNIX_TIMESTAMP('2015-11-13 10:20:19.012') |
+-------------------------------------------+
| 1447381219.012 |
+-------------------------------------------+
```
when the input datetime has decimal part start with zero, the result was
wrong before. now fixed.
before:
```sql
mysql> select UNIX_TIMESTAMP('2015-11-13 10:20:19.012');
+-------------------------------------------+
| UNIX_TIMESTAMP('2015-11-13 10:20:19.012') |
+-------------------------------------------+
| 1447381219.120 |
+-------------------------------------------+
```
now:
```sql
mysql> select UNIX_TIMESTAMP('2015-11-13 10:20:19.012');
+-------------------------------------------+
| UNIX_TIMESTAMP('2015-11-13 10:20:19.012') |
+-------------------------------------------+
| 1447381219.012 |
+-------------------------------------------+
```
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
when the input datetime has decimal part start with zero, the result was wrong before. now fixed.
before:
now:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)