#!/bin/sh
set -e

# Verify that BIGINT (int64_t) arithmetic is correct.
result=$(echo "SELECT 9223372036854775807::BIGINT AS max_bigint;" | duckdb)
echo "$result" | grep -q "9223372036854775807"

# Collect 250 million integers into an array (~2 GB allocation) and verify
# the count. Tests that large contiguous allocations succeed.
result=$(echo "SELECT len(array_agg(i)) FROM range(250000000) t(i);" | duckdb)
echo "$result" | grep -q "250000000"
