Skip to content

Commit 7406f9e

Browse files
committed
added joining on decimal test
1 parent 32f6613 commit 7406f9e

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

enginetest/join_op_tests.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2046,6 +2046,23 @@ WHERE
20462046
},
20472047
},
20482048
},
2049+
{
2050+
name: "joining on decimals",
2051+
setup: [][]string{
2052+
{
2053+
"create table t1(c0 decimal(6,3))",
2054+
"create table t2(c0 decimal(5,2))",
2055+
"insert into t1 values (10.000),(20.505),(30.000)",
2056+
"insert into t2 values (20.5), (25.0), (30.0)",
2057+
},
2058+
},
2059+
tests: []JoinOpTests{
2060+
{
2061+
Query: "select * from t1 join t2 on t1.c0 = t2.c0",
2062+
Expected: []sql.Row{{"30.000", "30.00"}},
2063+
},
2064+
},
2065+
},
20492066
{
20502067
name: "join with % condition",
20512068
setup: [][]string{
@@ -2058,7 +2075,7 @@ WHERE
20582075
},
20592076
tests: []JoinOpTests{
20602077
{
2061-
Query: `select * from t1 join t2 on (t1.c0 % 2) = (t2.c0 % 2)`,
2078+
Query: "select * from t1 join t2 on (t1.c0 % 2) = (t2.c0 % 2)",
20622079
Expected: []sql.Row{
20632080
{1, 3},
20642081
{2, 4},

0 commit comments

Comments
 (0)