You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: executor/join_test.go
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -843,6 +843,14 @@ func (s *testSuite) TestIndexLookupJoin(c *C) {
843
843
tk.MustExec("CREATE TABLE t(a BIGINT PRIMARY KEY, b BIGINT);")
844
844
tk.MustExec("INSERT INTO t VALUES(1, 2);")
845
845
tk.MustQuery("SELECT /*+ TIDB_INLJ(t1, t2) */ * FROM t t1 JOIN t t2 ON t1.a=t2.a UNION ALL SELECT /*+ TIDB_INLJ(t1, t2) */ * FROM t t1 JOIN t t2 ON t1.a=t2.a;").Check(testkit.Rows("1 2 1 2", "1 2 1 2"))
846
+
847
+
tk.MustExec(`drop table if exists t;`)
848
+
tk.MustExec(`create table t(a decimal(6,2), index idx(a));`)
849
+
tk.MustExec(`insert into t values(1.01), (2.02), (NULL);`)
850
+
tk.MustQuery(`select /*+ TIDB_INLJ(t1) */ t1.a from t t1 join t t2 on t1.a=t2.a order by t1.a;`).Check(testkit.Rows(
851
+
`1.01`,
852
+
`2.02`,
853
+
))
846
854
}
847
855
848
856
func (s*testSuite) TestMergejoinOrder(c*C) {
@@ -880,4 +888,12 @@ func (s *testSuite) TestMergejoinOrder(c *C) {
880
888
`2 1 2 1`,
881
889
`2 2 2 2`,
882
890
))
891
+
892
+
tk.MustExec(`drop table if exists t;`)
893
+
tk.MustExec(`create table t(a decimal(6,2), index idx(a));`)
894
+
tk.MustExec(`insert into t values(1.01), (2.02), (NULL);`)
895
+
tk.MustQuery(`select /*+ TIDB_SMJ(t1) */ t1.a from t t1 join t t2 on t1.a=t2.a order by t1.a;`).Check(testkit.Rows(
0 commit comments