Skip to content

Commit 908ebda

Browse files
committed
Updating IsSigned to return true for Boolean (i.e. TINYINT(1))
1 parent f1f9457 commit 908ebda

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

enginetest/queries/query_plans.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3608,7 +3608,7 @@ inner join pq on true
36083608
" ├─ HashIn\n" +
36093609
" │ ├─ Eq\n" +
36103610
" │ │ ├─ mytable.i:0!null\n" +
3611-
" │ │ └─ 1 (double)\n" +
3611+
" │ │ └─ 1 (bigint)\n" +
36123612
" │ └─ TUPLE(true (tinyint(1)))\n" +
36133613
" └─ Table\n" +
36143614
" ├─ name: mytable\n" +
@@ -3621,7 +3621,7 @@ inner join pq on true
36213621
" ├─ HashIn\n" +
36223622
" │ ├─ Eq\n" +
36233623
" │ │ ├─ mytable.i:0!null\n" +
3624-
" │ │ └─ 0 (double)\n" +
3624+
" │ │ └─ 0 (bigint)\n" +
36253625
" │ └─ TUPLE(true (tinyint(1)))\n" +
36263626
" └─ Table\n" +
36273627
" ├─ name: mytable\n" +

sql/types/typecheck.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func IsSigned(t sql.Type) bool {
102102
if _, ok := t.(SystemBoolType); ok {
103103
return true
104104
}
105-
return t == Int8 || t == Int16 || t == Int24 || t == Int32 || t == Int64
105+
return t == Int8 || t == Int16 || t == Int24 || t == Int32 || t == Int64 || t == Boolean
106106
}
107107

108108
// IsText checks if t is a CHAR, VARCHAR, TEXT, BINARY, VARBINARY, or BLOB (including TEXT and BLOB variants).

0 commit comments

Comments
 (0)