From c12eebb5668fdcd48c96a117ef8b72f43fce45b9 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Tue, 15 Jun 2021 03:28:57 +0300 Subject: [PATCH] Add a test --- .../01906_bigint_accurate_cast_ubsan.reference | 5 +++++ .../01906_bigint_accurate_cast_ubsan.sql | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 tests/queries/0_stateless/01906_bigint_accurate_cast_ubsan.reference create mode 100644 tests/queries/0_stateless/01906_bigint_accurate_cast_ubsan.sql diff --git a/tests/queries/0_stateless/01906_bigint_accurate_cast_ubsan.reference b/tests/queries/0_stateless/01906_bigint_accurate_cast_ubsan.reference new file mode 100644 index 00000000000..a293d9344f8 --- /dev/null +++ b/tests/queries/0_stateless/01906_bigint_accurate_cast_ubsan.reference @@ -0,0 +1,5 @@ +10000000000000000000 +10000000000000000000 +10000000000000000000 +10000000000000000000 +10000000000000000000 diff --git a/tests/queries/0_stateless/01906_bigint_accurate_cast_ubsan.sql b/tests/queries/0_stateless/01906_bigint_accurate_cast_ubsan.sql new file mode 100644 index 00000000000..4b9fa9662a9 --- /dev/null +++ b/tests/queries/0_stateless/01906_bigint_accurate_cast_ubsan.sql @@ -0,0 +1,15 @@ +SELECT accurateCast(1e35, 'UInt32'); -- { serverError 70 } +SELECT accurateCast(1e35, 'UInt64'); -- { serverError 70 } +SELECT accurateCast(1e35, 'UInt128'); -- { serverError 70 } +SELECT accurateCast(1e35, 'UInt256'); -- { serverError 70 } + +SELECT accurateCast(1e19, 'UInt64'); +SELECT accurateCast(1e19, 'UInt128'); +SELECT accurateCast(1e19, 'UInt256'); +SELECT accurateCast(1e20, 'UInt64'); -- { serverError 70 } +SELECT accurateCast(1e20, 'UInt128'); -- { serverError 70 } +SELECT accurateCast(1e20, 'UInt256'); -- { serverError 70 } + +SELECT accurateCast(1e19, 'Int64'); -- { serverError 70 } +SELECT accurateCast(1e19, 'Int128'); +SELECT accurateCast(1e19, 'Int256');