Commit f6072e5
committed
SQL: Fix getTime() methods in JDBC (#40484)
Previously, `getTime(colIdx/colLabel)` and
`getObject(colIdx/colLabel, java.sql.Time.class)` methods were computing
the time from a `ZonedDateTime` by applying day in millis modulo on the epoch millis
of the `ZonedDateTime` object. This is wrong as we need to keep the time
related fields at the timezone of the `ZonedDateTime` object and just
set the date info to the epoch date (01/01/1970).
Additionally fixes a testing issue as the original timezone id is converted
to an offset string when parsing the response from the server.1 parent c4848c5 commit f6072e5
File tree
3 files changed
+45
-53
lines changed- x-pack/plugin/sql
- jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc
- qa/src/main/java/org/elasticsearch/xpack/sql/qa/jdbc
3 files changed
+45
-53
lines changedLines changed: 5 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | 61 | | |
74 | | - | |
| 62 | + | |
| 63 | + | |
75 | 64 | | |
76 | 65 | | |
77 | 66 | | |
| |||
93 | 82 | | |
94 | 83 | | |
95 | 84 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | 85 | | |
Lines changed: 30 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| 17 | + | |
16 | 18 | | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
22 | | - | |
| 25 | + | |
23 | 26 | | |
24 | | - | |
| 27 | + | |
25 | 28 | | |
26 | | - | |
27 | | - | |
28 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
29 | 34 | | |
30 | | - | |
| 35 | + | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
| |||
57 | 62 | | |
58 | 63 | | |
59 | 64 | | |
60 | | - | |
61 | | - | |
62 | | - | |
| 65 | + | |
63 | 66 | | |
64 | | - | |
65 | | - | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
69 | 70 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
| 71 | + | |
79 | 72 | | |
80 | 73 | | |
81 | 74 | | |
82 | | - | |
| 75 | + | |
83 | 76 | | |
84 | | - | |
85 | | - | |
86 | | - | |
| 77 | + | |
| 78 | + | |
87 | 79 | | |
| 80 | + | |
88 | 81 | | |
| 82 | + | |
89 | 83 | | |
90 | 84 | | |
91 | 85 | | |
| |||
135 | 129 | | |
136 | 130 | | |
137 | 131 | | |
138 | | - | |
| 132 | + | |
139 | 133 | | |
140 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
141 | 146 | | |
Lines changed: 10 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
62 | 61 | | |
63 | 62 | | |
64 | 63 | | |
| 64 | + | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
822 | 823 | | |
823 | 824 | | |
824 | 825 | | |
825 | | - | |
826 | | - | |
827 | | - | |
828 | | - | |
| 826 | + | |
829 | 827 | | |
830 | 828 | | |
831 | 829 | | |
| |||
881 | 879 | | |
882 | 880 | | |
883 | 881 | | |
884 | | - | |
| 882 | + | |
885 | 883 | | |
886 | 884 | | |
887 | 885 | | |
888 | | - | |
| 886 | + | |
889 | 887 | | |
890 | 888 | | |
891 | 889 | | |
| |||
895 | 893 | | |
896 | 894 | | |
897 | 895 | | |
898 | | - | |
| 896 | + | |
899 | 897 | | |
900 | 898 | | |
901 | 899 | | |
| |||
1615 | 1613 | | |
1616 | 1614 | | |
1617 | 1615 | | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
1618 | 1620 | | |
0 commit comments