forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ClickHouse#55760 from ClickHouse/backport/23.8/55678
Backport ClickHouse#55678 to 23.8: Fix filtering by virtual columns with OR filter in query (resubmit)
- Loading branch information
Showing
5 changed files
with
93 additions
and
11 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
-- { echoOn } | ||
SELECT * FROM or_bug WHERE (key = 1) OR false OR false; | ||
1 | ||
SELECT * FROM or_bug WHERE (key = 1) OR false; | ||
1 | ||
SELECT * FROM or_bug WHERE (key = 1); | ||
1 | ||
-- { echoOn } | ||
select * from forms where text_field like '%this%' or 0 = 1 or 0 = 1; | ||
5840ead423829c1eab29fa97 this is a test | ||
select * from forms where text_field like '%this%' or 0 = 1; | ||
5840ead423829c1eab29fa97 this is a test | ||
select * from forms where text_field like '%this%'; | ||
5840ead423829c1eab29fa97 this is a 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,28 @@ | ||
-- https://github.com/ClickHouse/ClickHouse/pull/52653 | ||
DROP TABLE IF EXISTS or_bug; | ||
CREATE TABLE or_bug (key UInt8) ENGINE=MergeTree ORDER BY key; | ||
INSERT INTO TABLE or_bug VALUES (0), (1); | ||
|
||
-- { echoOn } | ||
SELECT * FROM or_bug WHERE (key = 1) OR false OR false; | ||
SELECT * FROM or_bug WHERE (key = 1) OR false; | ||
SELECT * FROM or_bug WHERE (key = 1); | ||
-- { echoOff } | ||
|
||
-- https://github.com/ClickHouse/ClickHouse/issues/55288 | ||
DROP TABLE IF EXISTS forms; | ||
CREATE TABLE forms | ||
( | ||
`form_id` FixedString(24), | ||
`text_field` String | ||
) | ||
ENGINE = MergeTree | ||
PRIMARY KEY form_id | ||
ORDER BY form_id; | ||
insert into forms values ('5840ead423829c1eab29fa97','this is a test'); | ||
|
||
-- { echoOn } | ||
select * from forms where text_field like '%this%' or 0 = 1 or 0 = 1; | ||
select * from forms where text_field like '%this%' or 0 = 1; | ||
select * from forms where text_field like '%this%'; | ||
-- { echoOff } |