#!/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"

# Test BIGINT storage/aggregation: range() always yields BIGINT values
# regardless of magnitude.
result=$(echo "SELECT len(array_agg(i)) FROM range(1000000) t(i);" | duckdb)
echo "$result" | grep -q "1000000"
