Skip to content

Commit 1245968

Browse files
committed
add dialect to warn tests
1 parent 4796ab7 commit 1245968

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

enginetest/queries/script_queries.go

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ var ScriptTests = []ScriptTest{
249249
},
250250
},
251251
{
252-
Query: "SELECT TRUNCATE('123abc',1)",
252+
Dialect: "mysql",
253+
Query: "SELECT TRUNCATE('123abc',1)",
253254
Expected: []sql.Row{
254255
{123.0},
255256
},
@@ -258,7 +259,8 @@ var ScriptTests = []ScriptTest{
258259
ExpectedWarningMessageSubstring: fmt.Sprintf(sql.ErrTruncatedIncorrect.Message, types.Float64.String(), "123abc"),
259260
},
260261
{
261-
Query: "SELECT TRUNCATE('1.5abc',1)",
262+
Dialect: "mysql",
263+
Query: "SELECT TRUNCATE('1.5abc',1)",
262264
Expected: []sql.Row{
263265
{1.5},
264266
},
@@ -267,7 +269,8 @@ var ScriptTests = []ScriptTest{
267269
ExpectedWarningMessageSubstring: fmt.Sprintf(sql.ErrTruncatedIncorrect.Message, types.Float64.String(), "1.5abc"),
268270
},
269271
{
270-
Query: "SELECT TRUNCATE('999xyz',2)",
272+
Dialect: "mysql",
273+
Query: "SELECT TRUNCATE('999xyz',2)",
271274
Expected: []sql.Row{
272275
{999.0},
273276
},
@@ -276,7 +279,8 @@ var ScriptTests = []ScriptTest{
276279
ExpectedWarningMessageSubstring: fmt.Sprintf(sql.ErrTruncatedIncorrect.Message, types.Float64.String(), "999xyz"),
277280
},
278281
{
279-
Query: "SELECT TRUNCATE(1.223,'1.5abc')",
282+
Dialect: "mysql",
283+
Query: "SELECT TRUNCATE(1.223,'1.5abc')",
280284
Expected: []sql.Row{
281285
{"1.2"},
282286
},
@@ -285,7 +289,8 @@ var ScriptTests = []ScriptTest{
285289
ExpectedWarningMessageSubstring: fmt.Sprintf(sql.ErrTruncatedIncorrect.Message, types.Int32.String(), "1.5abc"),
286290
},
287291
{
288-
Query: "SELECT TRUNCATE(1.223,'0.5')",
292+
Dialect: "mysql",
293+
Query: "SELECT TRUNCATE(1.223,'0.5')",
289294
Expected: []sql.Row{
290295
{"1"},
291296
},
@@ -294,7 +299,8 @@ var ScriptTests = []ScriptTest{
294299
ExpectedWarningMessageSubstring: fmt.Sprintf(sql.ErrTruncatedIncorrect.Message, types.Int32.String(), "0.5"),
295300
},
296301
{
297-
Query: "SELECT TRUNCATE(1.223,'2.7')",
302+
Dialect: "mysql",
303+
Query: "SELECT TRUNCATE(1.223,'2.7')",
298304
Expected: []sql.Row{
299305
{"1.22"},
300306
},
@@ -303,7 +309,8 @@ var ScriptTests = []ScriptTest{
303309
ExpectedWarningMessageSubstring: fmt.Sprintf(sql.ErrTruncatedIncorrect.Message, types.Int32.String(), "2.7"),
304310
},
305311
{
306-
Query: "SELECT TRUNCATE(1.223,'invalid_precision')",
312+
Dialect: "mysql",
313+
Query: "SELECT TRUNCATE(1.223,'invalid_precision')",
307314
Expected: []sql.Row{
308315
{"1"},
309316
},

0 commit comments

Comments
 (0)