Skip to content

Commit 88486fb

Browse files
author
James Cor
committed
convert to bool rounds
1 parent 8515f29 commit 88486fb

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

enginetest/queries/script_queries.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -970,8 +970,8 @@ var ScriptTests = []ScriptTest{
970970
},
971971

972972
// TODO: these are not directly testing casting
973+
// https://github.com/dolthub/dolt/issues/9739
973974
{
974-
// https://github.com/dolthub/dolt/issues/9739
975975
Skip: true,
976976
Dialect: "mysql",
977977
Query: "select * from test01 where pk in (11)",
@@ -1013,17 +1013,13 @@ var ScriptTests = []ScriptTest{
10131013
ExpectedWarning: mysql.ERTruncatedWrongValue,
10141014
},
10151015
{
1016-
// https://github.com/dolthub/dolt/issues/9739
1017-
//Skip: true,
10181016
Dialect: "mysql",
10191017
Query: "select * from test02 where pk in ('11asdf');",
10201018
Expected: []sql.Row{{11}},
10211019
ExpectedWarningsCount: 1,
10221020
ExpectedWarning: mysql.ERTruncatedWrongValue,
10231021
},
10241022
{
1025-
// https://github.com/dolthub/dolt/issues/9739
1026-
//Skip: true,
10271023
Dialect: "mysql",
10281024
Query: "select * from test02 where pk='11.12asdf';",
10291025
Expected: []sql.Row{},

sql/core.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ func ConvertToBool(ctx *Context, v interface{}) (bool, error) {
317317
case float64:
318318
return b != 0, nil
319319
case string:
320-
truncStr, didTrunc := TruncateStringToInt(b)
320+
truncStr, didTrunc := TruncateStringToDouble(b)
321321
if didTrunc {
322322
ctx.Warn(mysql.ERTruncatedWrongValue, "%s", ErrTruncatedIncorrect.New("INTEGER", b))
323323
}

0 commit comments

Comments
 (0)