should be it

This commit is contained in:
2025-10-24 19:21:19 -05:00
parent a4b23fc57c
commit f09560c7b1
14047 changed files with 3161551 additions and 1 deletions

View File

@@ -0,0 +1,87 @@
# name: test/sql/overflow/test_numeric_overflow.test
# description: Test handling of overflows in float/double
# group: [overflow]
statement ok
PRAGMA enable_verification
query I
SELECT 1e1000
----
inf
# overflow on cast from double to real results in an error
statement error
SELECT 1e308::REAL
----
Conversion Error
# except we can cast inf -> inf
query I
SELECT 1e1000::REAL
----
inf
# test string casts
query I
SELECT '1e1000'::DOUBLE
----
inf
query I
SELECT '1e100'::REAL
----
inf
# overflow in SUM/AVG overflow
query I
SELECT SUM(i) FROM (VALUES (1e308), (1e308)) tbl(i)
----
inf
query I
SELECT AVG(i) FROM (VALUES (1e308), (1e308)) tbl(i)
----
inf
# overflow in arithmetic as well
query I
SELECT 1e308+1e308
----
inf
query I
SELECT 1e308*2
----
inf
query I
SELECT -1e308-1e308
----
-inf
query I
SELECT 1e308/0.1
----
inf
query I
SELECT 2e38::REAL+2e38::REAL
----
inf
query I
SELECT 2e38::REAL*2
----
inf
query I
SELECT -2e38::REAL-2e38::REAL
----
-inf
query I
SELECT 2e38::REAL/0.1::REAL
----
inf