-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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 #43507 from ClickHouse/backport/22.11/43387
Backport #43387 to 22.11: Fix default value used in row level filter
- Loading branch information
Showing
3 changed files
with
45 additions
and
2 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
16 changes: 16 additions & 0 deletions
16
tests/queries/0_stateless/02481_default_value_used_in_row_level_filter.reference
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,16 @@ | ||
-- { echoOn } | ||
|
||
SELECT a, c FROM test_rlp WHERE c%2 == 0 AND b < 5; | ||
0 10 | ||
2 12 | ||
4 14 | ||
DROP POLICY IF EXISTS test_rlp_policy ON test_rlp; | ||
CREATE ROW POLICY test_rlp_policy ON test_rlp FOR SELECT USING c%2 == 0 TO default; | ||
SELECT a, c FROM test_rlp WHERE b < 5 SETTINGS optimize_move_to_prewhere = 0; | ||
0 10 | ||
2 12 | ||
4 14 | ||
SELECT a, c FROM test_rlp PREWHERE b < 5; | ||
0 10 | ||
2 12 | ||
4 14 |
25 changes: 25 additions & 0 deletions
25
tests/queries/0_stateless/02481_default_value_used_in_row_level_filter.sql
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,25 @@ | ||
DROP TABLE IF EXISTS test_rlp; | ||
|
||
CREATE TABLE test_rlp (a Int32, b Int32) ENGINE=MergeTree() ORDER BY a SETTINGS index_granularity=5; | ||
|
||
INSERT INTO test_rlp SELECT number, number FROM numbers(15); | ||
|
||
ALTER TABLE test_rlp ADD COLUMN c Int32 DEFAULT b+10; | ||
|
||
-- { echoOn } | ||
|
||
SELECT a, c FROM test_rlp WHERE c%2 == 0 AND b < 5; | ||
|
||
DROP POLICY IF EXISTS test_rlp_policy ON test_rlp; | ||
|
||
CREATE ROW POLICY test_rlp_policy ON test_rlp FOR SELECT USING c%2 == 0 TO default; | ||
|
||
SELECT a, c FROM test_rlp WHERE b < 5 SETTINGS optimize_move_to_prewhere = 0; | ||
|
||
SELECT a, c FROM test_rlp PREWHERE b < 5; | ||
|
||
-- { echoOff } | ||
|
||
DROP POLICY test_rlp_policy ON test_rlp; | ||
|
||
DROP TABLE test_rlp; |