diff --git a/src/test/regress/expected/aggregate_null_behavior.out b/src/test/regress/expected/aggregate_null_behavior.out new file mode 100644 index 00000000000..6f0fb9b26f3 --- /dev/null +++ b/src/test/regress/expected/aggregate_null_behavior.out @@ -0,0 +1,19 @@ + count +------- + 2 +(1 row) + + count +------- + 3 +(1 row) + + avg +-------------------- + 1.5000000000000000 +(1 row) + + avg +----- + +(1 row) diff --git a/src/test/regress/parallel_schedule b/src/test/regress/parallel_schedule index 905f9bca959..efd462eea17 100644 --- a/src/test/regress/parallel_schedule +++ b/src/test/regress/parallel_schedule @@ -43,7 +43,7 @@ test: copy copyselect copydml copyencoding insert insert_conflict # Note: many of the tests in later groups depend on create_index # ---------- test: create_function_c create_misc create_operator create_procedure create_table create_type create_schema -test: create_index create_index_spgist create_view index_including index_including_gist + # ---------- # Another group of parallel tests @@ -140,3 +140,7 @@ test: fast_default # run tablespace test at the end because it drops the tablespace created during # setup that other tests may use. test: tablespace +# ---------- +# Aggregate NULL behavior tests +# ---------- +test: aggregate_null_behavior diff --git a/src/test/regress/sql/aggregate_null_behavior.sql b/src/test/regress/sql/aggregate_null_behavior.sql new file mode 100644 index 00000000000..e76891d9f12 --- /dev/null +++ b/src/test/regress/sql/aggregate_null_behavior.sql @@ -0,0 +1,11 @@ +CREATE TEMP TABLE t (x INT); + +INSERT INTO t VALUES (1), (NULL), (2); + +SELECT COUNT(x) FROM t; +SELECT COUNT(*) FROM t; +SELECT AVG(x) FROM t; + +DELETE FROM t; +SELECT AVG(x) FROM t; +