Skip to content

Commit

Permalink
Merge pull request pingcap#12 from WPH95/engine/add-plugin-engine-joi…
Browse files Browse the repository at this point in the history
…n-test

add test aboud pluginEngine join tikv
  • Loading branch information
wph95 authored Oct 27, 2019
2 parents 7d4b35d + 81d2a2b commit bb96bf6
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions plugin/file/file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,17 @@ func (s *testPlugin) TestPlugin(c *C) {
})

tk.MustExec("use test")
tk.MustExec("create table t1(a int, b char(255)) ENGINE = file")
tk.MustExec("insert into t1 values(1, 'lfkdsk')")
tk.MustExec("insert into t1 values(2, 'wph95')")
result := tk.MustQuery("select * from t1")
result.Check(testkit.Rows("1 lfkdsk","2 wph95"))
result = tk.MustQuery("select * from t1 where a = 2")
result.Check(testkit.Rows("2 wph95", ))
tk.MustExec("create table people(city int, name char(255)) ENGINE = file")
tk.MustExec("insert into people values(1, 'lfkdsk')")
tk.MustExec("insert into people values(2, 'wph95')")
tk.MustExec("insert into people values(2, 'guest')")
result := tk.MustQuery("select * from people")
result.Check(testkit.Rows("1 lfkdsk", "2 wph95", "2 guest"))
result = tk.MustQuery("select * from people where city = 2")
result.Check(testkit.Rows("2 wph95", "2 guest"))
tk.MustExec("create table city(id int, cityName char(255))")
tk.MustExec("insert into city values(1, 'beijing')")
tk.MustExec("insert into city values(2, 'shanghai')")
result = tk.MustQuery("SELECT city.cityName,people.name FROM city INNER JOIN people ON city.id=people.city")
result.Check(testkit.Rows("beijing lfkdsk", "shanghai wph95", "shanghai guest"))
}

0 comments on commit bb96bf6

Please sign in to comment.