aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/arrays.out27
-rw-r--r--src/test/regress/sql/arrays.sql8
2 files changed, 35 insertions, 0 deletions
diff --git a/src/test/regress/expected/arrays.out b/src/test/regress/expected/arrays.out
index 89f1be3318a..104523c2afb 100644
--- a/src/test/regress/expected/arrays.out
+++ b/src/test/regress/expected/arrays.out
@@ -1295,16 +1295,43 @@ select array_fill('juhu'::text, array[3,3]);
{{juhu,juhu,juhu},{juhu,juhu,juhu},{juhu,juhu,juhu}}
(1 row)
+select a, a = '{}' as is_eq, array_dims(a)
+ from (select array_fill(42, array[0]) as a) ss;
+ a | is_eq | array_dims
+----+-------+------------
+ {} | t |
+(1 row)
+
+select a, a = '{}' as is_eq, array_dims(a)
+ from (select array_fill(42, '{}') as a) ss;
+ a | is_eq | array_dims
+----+-------+------------
+ {} | t |
+(1 row)
+
+select a, a = '{}' as is_eq, array_dims(a)
+ from (select array_fill(42, '{}', '{}') as a) ss;
+ a | is_eq | array_dims
+----+-------+------------
+ {} | t |
+(1 row)
+
-- raise exception
select array_fill(1, null, array[2,2]);
ERROR: dimension array or low bound array cannot be null
select array_fill(1, array[2,2], null);
ERROR: dimension array or low bound array cannot be null
+select array_fill(1, array[2,2], '{}');
+ERROR: wrong number of array subscripts
+DETAIL: Low bound array has different size than dimensions array.
select array_fill(1, array[3,3], array[1,1,1]);
ERROR: wrong number of array subscripts
DETAIL: Low bound array has different size than dimensions array.
select array_fill(1, array[1,2,null]);
ERROR: dimension values cannot be null
+select array_fill(1, array[[1,2],[3,4]]);
+ERROR: wrong number of array subscripts
+DETAIL: Dimension array must be one dimensional.
select string_to_array('1|2|3', '|');
string_to_array
-----------------
diff --git a/src/test/regress/sql/arrays.sql b/src/test/regress/sql/arrays.sql
index d9f7cbfa8d2..54b0be7a7d7 100644
--- a/src/test/regress/sql/arrays.sql
+++ b/src/test/regress/sql/arrays.sql
@@ -383,11 +383,19 @@ select array_fill(7, array[3,3],array[2,2]);
select array_fill(7, array[3,3]);
select array_fill('juhu'::text, array[3,3],array[2,2]);
select array_fill('juhu'::text, array[3,3]);
+select a, a = '{}' as is_eq, array_dims(a)
+ from (select array_fill(42, array[0]) as a) ss;
+select a, a = '{}' as is_eq, array_dims(a)
+ from (select array_fill(42, '{}') as a) ss;
+select a, a = '{}' as is_eq, array_dims(a)
+ from (select array_fill(42, '{}', '{}') as a) ss;
-- raise exception
select array_fill(1, null, array[2,2]);
select array_fill(1, array[2,2], null);
+select array_fill(1, array[2,2], '{}');
select array_fill(1, array[3,3], array[1,1,1]);
select array_fill(1, array[1,2,null]);
+select array_fill(1, array[[1,2],[3,4]]);
select string_to_array('1|2|3', '|');
select string_to_array('1|2|3|', '|');