Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ SELECT 9223372036854775807::unsigned_long * 2 AS x;
;

arithmeticDivide
SELECT 18446744073709551614 / 2 AS x;
SELECT 18446744073709551614 / 2 AS x, 18446744073709551614 / 7306.0 AS y, 18446744073709551614 / 7306 AS z ;

x:ul
---------------
9223372036854775807
x:ul | y:d | z:ul
--------------------+-------------------------+-------------------------
9223372036854775807 | 2.5248760024239735E15 | 2524876002423973
;

arithmeticModulo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,16 @@
// RAND takes an int.
// ROUND only works for values < Long.MAX_VALUE
// ES's CEIL & FLOOR don't work with unsigned_longs (TODO) + they can return longs, while H2's always returns doubles
// Divide and Modulo operations lose precision in H2 on big numbers (led to random failures in the past, so they were removed)

plus
SELECT 18446744073709551614 + 1 AS x;
plusLongMax
SELECT 9223372036854775808 + ROUND(RAND(DAY(CURRENT_TIMESTAMP())) * 10000) AS x;
minus
SELECT 18446744073709551615 - ROUND(RAND(DAY(CURRENT_TIMESTAMP())) * 10000) AS x;
// AwaitsFix https://github.com/elastic/elasticsearch/issues/83516
divide-Ignore
SELECT 18446744073709551615 / ROUND(RAND(DAY(CURRENT_TIMESTAMP())) * 10000) AS x;
multiply
SELECT 18446744073709551615 * 1 AS x;
// AwaitsFix https://github.com/elastic/elasticsearch/issues/83516
mod-Ignore
SELECT 18446744073709551615 % ROUND(RAND(DAY(CURRENT_TIMESTAMP())) * 10000) AS x;

abs
SELECT ABS(9223372036854775808 + ROUND(RAND(DAY(CURRENT_TIMESTAMP())) * 10000)) AS x;
Expand Down