dialect/sql: avoid passing bool arguments on bool predicates (#2405)

This commit is contained in:
Ariel Mashraki
2022-03-15 22:52:49 +02:00
committed by GitHub
parent db1617bb29
commit 412947d274
6 changed files with 102 additions and 37 deletions

View File

@@ -81,8 +81,8 @@ func TestWritePath(t *testing.T) {
sql.EQ("active", true),
),
),
wantQuery: "SELECT * FROM `test` WHERE `id` > ? AND (JSON_EXTRACT(`j`, \"$.a.*.c\") IS NOT NULL OR JSON_TYPE(`j`, \"$.a.*.c\") = 'null') AND `active` = ?",
wantArgs: []interface{}{100, true},
wantQuery: "SELECT * FROM `test` WHERE `id` > ? AND (JSON_EXTRACT(`j`, \"$.a.*.c\") IS NOT NULL OR JSON_TYPE(`j`, \"$.a.*.c\") = 'null') AND `active`",
wantArgs: []interface{}{100},
},
{
input: sql.Dialect(dialect.Postgres).