Commit 3bf2452
committed
Modify UUID when passing it as a bind variable
When parsing an UUID from a string literal DuckDB modifies it with
flipping the most significant bit in `UUID::FromString` for the
following reason:
"Flip the first bit to make `order by uuid` same as `order by
uuid::varchar`"
When an UUID is read from a result set, JDBC driver flips the MSB again
to get back the original UUID in Java.
This bit-flipping logic was missing when an UUID was passed from Java
as a bind variable. The proposed change adds the same logic when
passing bind variables.
Testing: existing test is improved to cover both string literal and a
bind variable.
Fixes: duckdb#1471 parent a179e86 commit 3bf2452
File tree
3 files changed
+29
-8
lines changed- src
- jni
- main/java/org/duckdb
- test/java/org/duckdb
3 files changed
+29
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
16 | 19 | | |
17 | 20 | | |
18 | 21 | | |
| |||
625 | 628 | | |
626 | 629 | | |
627 | 630 | | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
628 | 634 | | |
629 | 635 | | |
630 | 636 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
232 | | - | |
233 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
234 | 235 | | |
235 | 236 | | |
236 | 237 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4317 | 4317 | | |
4318 | 4318 | | |
4319 | 4319 | | |
4320 | | - | |
4321 | | - | |
4322 | | - | |
4323 | | - | |
4324 | | - | |
| 4320 | + | |
| 4321 | + | |
| 4322 | + | |
| 4323 | + | |
| 4324 | + | |
| 4325 | + | |
| 4326 | + | |
| 4327 | + | |
| 4328 | + | |
| 4329 | + | |
| 4330 | + | |
| 4331 | + | |
| 4332 | + | |
| 4333 | + | |
| 4334 | + | |
| 4335 | + | |
| 4336 | + | |
| 4337 | + | |
| 4338 | + | |
4325 | 4339 | | |
4326 | 4340 | | |
4327 | 4341 | | |
| |||
0 commit comments