forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 1
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#54212 from bharatnc/ncb/fix-ipv4-select
fix possible type mismatch with IPv4
- Loading branch information
Showing
4 changed files
with
28 additions
and
1 deletion.
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
8 changes: 8 additions & 0 deletions
8
tests/queries/0_stateless/02864_test_ipv4_type_mismatch.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,8 @@ | ||
1.1.1.1 | ||
8.8.8.8 | ||
1 | ||
0 | ||
1 | ||
0 | ||
0 | ||
1 |
14 changes: 14 additions & 0 deletions
14
tests/queries/0_stateless/02864_test_ipv4_type_mismatch.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,14 @@ | ||
DROP TABLE IF EXISTS test; | ||
|
||
CREATE TABLE test | ||
( | ||
ip IPv4 Codec(ZSTD(6)), | ||
) ENGINE MergeTree() order by ip; | ||
|
||
INSERT INTO test values ('1.1.1.1'); | ||
INSERT INTO test values (toIPv4('8.8.8.8')); | ||
|
||
SELECT * FROM test ORDER BY ip; | ||
SELECT ip IN IPv4StringToNum('1.1.1.1') FROM test order by ip; | ||
SELECT ip IN ('1.1.1.1') FROM test order by ip; | ||
SELECT ip IN IPv4StringToNum('8.8.8.8') FROM test order by ip; |