-
Notifications
You must be signed in to change notification settings - Fork 756
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
for merge-into stmt with both match branch, right join is used. after got the joined resultset, instead of using a arbitrary column of target table, use `row_id` column to split the set into matched and not-matched parts; since "arbitrary column" may have NULL values.
- Loading branch information
1 parent
9e1d397
commit 904173d
Showing
12 changed files
with
97 additions
and
76 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
tests/sqllogictests/suites/base/09_fuse_engine/09_0040_merge_into_issue_15643.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
statement ok | ||
create or replace database m_test; | ||
|
||
statement ok | ||
use m_test; | ||
|
||
statement ok | ||
create table t(a string, b string, c string, d string, k string); | ||
|
||
statement ok | ||
create table s(a string, b string, c string, d string, k string); | ||
|
||
statement ok | ||
insert into t(k) values('k'); | ||
|
||
statement ok | ||
insert into s(k) values('k'); | ||
|
||
|
||
# expects 1 row updated, 0 row inserted | ||
query II | ||
merge into t using s on t.k = s.k | ||
when matched then update * | ||
when not matched then insert *; | ||
--- | ||
0 1 | ||
|
||
query TTTTT | ||
select * from t; | ||
--- | ||
NULL NULL NULL NULL k |