SQL: Fix incorrect field type returned by SYS TYPE (elastic/x-pack-elasticsearch#4358)
SYS TYPE returns an integer instead of a boolean (the bug was caused by reading the ODBC spec which refers to the wire representation instead of the JDBC one which uses primitives) Original commit: elastic/x-pack-elasticsearch@f9fe64ab0d
This commit is contained in:
parent
fc5e1631f1
commit
4252b3094c
|
@ -83,7 +83,7 @@ public class SysTypes extends Command {
|
|||
// only numerics are signed
|
||||
!t.isSigned(),
|
||||
//no fixed precision scale SQL_FALSE
|
||||
0,
|
||||
false,
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
|
|
|
@ -66,6 +66,8 @@ public class SysParserTests extends ESTestCase {
|
|||
assertFalse(r.schema().types().contains(DataType.NULL));
|
||||
// test numeric as signed
|
||||
assertFalse(r.column(9, Boolean.class));
|
||||
// make sure precision is returned as boolean (not int)
|
||||
assertFalse(r.column(10, Boolean.class));
|
||||
|
||||
for (int i = 0; i < r.size(); i++) {
|
||||
assertEquals(names.get(i), r.column(0));
|
||||
|
|
Loading…
Reference in New Issue