Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expression, executor: reset e.done for PointGetExecutor #19046

Merged
merged 1 commit into from
Aug 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions executor/point_get.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ func (e *PointGetExecutor) Close() error {
if e.runtimeStats != nil && e.snapshot != nil {
e.snapshot.DelOption(kv.CollectRuntimeStats)
}
e.done = false
return nil
}

Expand Down
29 changes: 29 additions & 0 deletions expression/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6722,3 +6722,32 @@ func (s *testIntegrationSerialSuite) TestIssue18662(c *C) {
tk.MustQuery("select * from t where field('A' collate utf8mb4_general_ci, a, b) > 1;").Check(testkit.Rows())
tk.MustQuery("select * from t where field('A', a, b) > 1;").Check(testkit.Rows("a A"))
}

func (s *testIntegrationSerialSuite) TestIssue19045(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
tk.MustExec("drop table if exists t, t1, t2")
tk.MustExec(`CREATE TABLE t (
id int(11) NOT NULL AUTO_INCREMENT,
a char(10) DEFAULT NULL,
PRIMARY KEY (id)
);`)
tk.MustExec(`CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
a char(10) DEFAULT NULL,
b char(10) DEFAULT NULL,
c char(10) DEFAULT NULL,
PRIMARY KEY (id)
);`)
tk.MustExec(`CREATE TABLE t2 (
id int(11) NOT NULL AUTO_INCREMENT,
a char(10) DEFAULT NULL,
b char(10) DEFAULT NULL,
PRIMARY KEY (id),
UNIQUE KEY b (b)
);`)
tk.MustExec(`insert into t1(a,b,c) values('hs4_0004', "04", "101"), ('a01', "01", "101"),('a011', "02", "101");`)
tk.MustExec(`insert into t2(a,b) values("02","03");`)
tk.MustExec(`insert into t(a) values('101'),('101');`)
tk.MustQuery(`select ( SELECT t1.a FROM t1, t2 WHERE t1.b = t2.a AND t2.b = '03' AND t1.c = a.a) invode from t a ;`).Check(testkit.Rows("a011", "a011"))
}