Commit d6b2cda
authored
[AMORO-4193][ams] Fix MysqlDataTruncation caused by negative finishTime in TableProcessMeta (#4192)
* Fix MysqlDataTruncation caused by negative finishTime in TableProcessMeta
When creating a new TableProcessMeta via createProcessMeta(), finishTime
was initialized to -1. Long2TsConverter only converted 0 to null, so
Timestamp(-1) was passed to MySQL, which is outside the valid TIMESTAMP
range (1970-01-01 00:00:01 UTC ~), causing MysqlDataTruncation.
- Long2TsConverter: convert parameter <= 0 to null instead of only 0
- TableProcessMeta: initialize finishTime to 0 in createProcessMeta()
for consistency with the of() factory method
Signed-off-by: Jiwon Park <jpark92@outlook.kr>
* Add unit tests for Long2TsConverter
Signed-off-by: Jiwon Park <jpark92@outlook.kr>
---------
Signed-off-by: Jiwon Park <jpark92@outlook.kr>1 parent 93cde39 commit d6b2cda
3 files changed
Lines changed: 61 additions & 2 deletions
File tree
- amoro-ams/src
- main/java/org/apache/amoro/server
- persistence/converter
- process
- test/java/org/apache/amoro/server/persistence/converter
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
| 205 | + | |
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| |||
Lines changed: 59 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
0 commit comments