Skip to content

Commit 1f2cd7f

Browse files
authored
chore(ci): add fuzz decimal tests (#18176)
1 parent 903671f commit 1f2cd7f

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
3+
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
4+
. "$CURDIR"/../../../shell_env.sh
5+
6+
7+
MAX_SCALE=74
8+
TIMES=30
9+
10+
echo "SELECT 1 + 1" > /tmp/decimal.sql
11+
for scale in `seq 0 ${MAX_SCALE}`;do
12+
precisions=$(shuf -i 1-$[$MAX_SCALE - scale] -n ${TIMES})
13+
for precision in ${precisions};do
14+
printf ", 1.1 + 2.%0${scale}d\n"
15+
printf ", 1.%0${scale}d + 2.%0${scale}d\n"
16+
printf ", 1%0${precision}d.%0${scale}d + 2.1\n"
17+
printf ", 1%0${precision}d.%0${scale}d + 2.%0${scale}d\n"
18+
printf ", 1%0${precision}d.%0${scale}d + 2%0${precision}d.%0${scale}d\n"
19+
done
20+
done >> /tmp/decimal.sql
21+
22+
cat /tmp/decimal.sql | $BENDSQL_CLIENT_OUTPUT_NULL
23+
echo "1"
24+

0 commit comments

Comments
 (0)