Added tests

This commit is contained in:
Mikhail Korotov 2019-11-13 18:16:26 +03:00
parent 6b3d6d5dce
commit 2e0af1a8a6
4 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,5 @@
DROP TABLE IF EXISTS t_uuid;
CREATE TABLE t_uuid (x UUID) ENGINE=TinyLog;
INSERT INTO t_uuid SELECT generateUUIDv4();
INSERT INTO t_uuid SELECT generateUUIDv4();
SELECT count() FROM t_uuid WHERE cityHash64(x) = cityHash64(toString(x));

View File

@ -0,0 +1,6 @@
1
1
1
2
2
2

View File

@ -0,0 +1,7 @@
SELECT cityHash64(toDecimal32(32, 2)) = cityHash64(toString(toDecimal32(32, 2)));
SELECT cityHash64(toDecimal64(64, 5)) = cityHash64(toString(toDecimal64(64, 5)));
SELECT cityHash64(toDecimal128(128, 24)) = cityHash64(toString(toDecimal128(128, 24)));
SELECT count() FROM numbers(200, 2) WHERE cityHash64(toDecimal32(number, 4)) = cityHash64(toString(toDecimal32(number, 4)));
SELECT count() FROM numbers(2301, 2) WHERE cityHash64(toDecimal64(number, 6)) = cityHash64(toString(toDecimal64(number, 6)));
SELECT count() FROM numbers(2143, 2) WHERE cityHash64(toDecimal128(number, 10)) = cityHash64(toString(toDecimal128(number, 10)));