Skip to content

Commit c9d633d

Browse files
committed
add tests
1 parent 29c0168 commit c9d633d

File tree

1 file changed

+37
-6
lines changed

1 file changed

+37
-6
lines changed

enginetest/queries/script_queries.go

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,7 @@ FROM task_instance INNER JOIN job ON job.id = task_instance.queued_by_job_id INN
10321032
// Related Issues:
10331033
// https://github.com/dolthub/dolt/issues/9733
10341034
// https://github.com/dolthub/dolt/issues/9739
1035+
// https://github.com/dolthub/dolt/issues/9936
10351036
Dialect: "mysql",
10361037
Name: "strings cast to numbers",
10371038
SetUpScript: []string{
@@ -1042,6 +1043,9 @@ FROM task_instance INNER JOIN job ON job.id = task_instance.queued_by_job_id INN
10421043
('3. 12 4'),('5.932887e+07'),('5.932887e+07abc'),('5.932887e7'),('5.932887e7abc');`,
10431044
"create table test02(pk int primary key);",
10441045
"insert into test02 values(11),(12),(13),(14),(15);",
1046+
"create table t0(c0 varchar(500))",
1047+
"insert into t0(c0) values (77367106)",
1048+
"create index i0 using hash on t0(c0) invisible",
10451049
},
10461050
Assertions: []ScriptTestAssertion{
10471051
{
@@ -1176,10 +1180,8 @@ FROM task_instance INNER JOIN job ON job.id = task_instance.queued_by_job_id INN
11761180
Expected: []sql.Row{{"11"}},
11771181
ExpectedWarningsCount: 0,
11781182
},
1179-
11801183
{
11811184
// https://github.com/dolthub/dolt/issues/9739
1182-
Skip: true,
11831185
Dialect: "mysql",
11841186
Query: "select * from test01 where pk in (11)",
11851187
Expected: []sql.Row{
@@ -1193,25 +1195,21 @@ FROM task_instance INNER JOIN job ON job.id = task_instance.queued_by_job_id INN
11931195
},
11941196
{
11951197
// https://github.com/dolthub/dolt/issues/9739
1196-
Skip: true,
11971198
Dialect: "mysql",
11981199
Query: "select * from test01 where pk=3",
11991200
Expected: []sql.Row{
12001201
{" 3 12 4"},
1201-
{" 3. 12 4"},
12021202
{"3. 12 4"},
12031203
},
12041204
ExpectedWarningsCount: 12,
12051205
ExpectedWarning: mysql.ERTruncatedWrongValue,
12061206
},
12071207
{
12081208
// https://github.com/dolthub/dolt/issues/9739
1209-
Skip: true,
12101209
Dialect: "mysql",
12111210
Query: "select * from test01 where pk>=3 and pk < 4",
12121211
Expected: []sql.Row{
12131212
{" 3 12 4"},
1214-
{" 3. 12 4"},
12151213
{" 3.2 12 4"},
12161214
{"+3.1234"},
12171215
{"3. 12 4"},
@@ -1233,6 +1231,38 @@ FROM task_instance INNER JOIN job ON job.id = task_instance.queued_by_job_id INN
12331231
ExpectedWarningsCount: 1,
12341232
ExpectedWarning: mysql.ERTruncatedWrongValue,
12351233
},
1234+
{
1235+
Query: "select c0 from t0 where 1630944823 >= t0.c0",
1236+
Expected: []sql.Row{{"77367106"}},
1237+
},
1238+
{
1239+
Query: "select c0 from t0 where 1630944823 <= t0.c0",
1240+
Expected: []sql.Row{},
1241+
},
1242+
{
1243+
Query: "select c0 from t0 where '1630944823' >= t0.c0",
1244+
Expected: []sql.Row{},
1245+
},
1246+
{
1247+
Query: "select c0 from t0 where '1630944823' <= t0.c0",
1248+
Expected: []sql.Row{{"77367106"}},
1249+
},
1250+
{
1251+
Query: "select c0 from t0 where 1630944823.2 >= t0.c0",
1252+
Expected: []sql.Row{{"77367106"}},
1253+
},
1254+
{
1255+
Query: "select c0 from t0 where 1630944823.2 <= t0.c0",
1256+
Expected: []sql.Row{},
1257+
},
1258+
{
1259+
Query: "select c0 from t0 where '1630944823.2' >= t0.c0",
1260+
Expected: []sql.Row{},
1261+
},
1262+
{
1263+
Query: "select c0 from t0 where '1630944823.2' <= t0.c0",
1264+
Expected: []sql.Row{{"77367106"}},
1265+
},
12361266
},
12371267
},
12381268
{
@@ -7772,6 +7802,7 @@ CREATE TABLE tab3 (
77727802
},
77737803
},
77747804
{
7805+
// https://github.com/dolthub/dolt/issues/7372
77757806
Name: "range query convert int to string zero value",
77767807
Dialect: "mysql",
77777808
SetUpScript: []string{

0 commit comments

Comments
 (0)