diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-01-15 19:11:40 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-01-15 19:11:40 +0000 |
commit | 6ce5e0abb67add892c5d726a5fdfe7aed686c1af (patch) | |
tree | 640307d3a2acb9b7a83d955bdd63485ab188be37 /src | |
parent | 2a1bfbce24c5a34a9fbe82d3569b96459cb898cf (diff) | |
download | postgresql-6ce5e0abb67add892c5d726a5fdfe7aed686c1af.tar.gz postgresql-6ce5e0abb67add892c5d726a5fdfe7aed686c1af.zip |
Update arrays regress test to reflect fact that several things
work now that did not work in 6.5.
Diffstat (limited to 'src')
-rw-r--r-- | src/test/regress/expected/arrays.out | 102 | ||||
-rw-r--r-- | src/test/regress/sql/arrays.sql | 42 |
2 files changed, 80 insertions, 64 deletions
diff --git a/src/test/regress/expected/arrays.out b/src/test/regress/expected/arrays.out index b0869a94950..c100ea6ce4b 100644 --- a/src/test/regress/expected/arrays.out +++ b/src/test/regress/expected/arrays.out @@ -1,61 +1,79 @@ -QUERY: SELECT * FROM arrtest; -a |b |c |d |e |f |g ------------+---------------+-------------+-----------------+-------------+-----------------+--------------- -{1,2,3,4,5}|{{{0,0},{1,2}}}|{} |{} | |{} |{} -{11,12,23} |{{3,4},{4,5}} |{"foobar"} |{{"elt1","elt2"}}|{"3.4","6.7"}|{"abc ","abcde"}|{"abc","abcde"} -{} |{3,4} |{"foo","bar"}|{"bar","foo"} | | | +-- +-- ARRAYS +-- +SELECT * FROM arrtest; + a | b | c | d | e | f | g +-------------+-----------------+---------------+-------------------+---------------+-------------------+----------------- + {1,2,3,4,5} | {{{0,0},{1,2}}} | {} | {} | | {} | {} + {11,12,23} | {{3,4},{4,5}} | {"foobar"} | {{"elt1","elt2"}} | {"3.4","6.7"} | {"abc ","abcde"} | {"abc","abcde"} + {} | {3,4} | {"foo","bar"} | {"bar","foo"} | | | (3 rows) -QUERY: SELECT arrtest.a[1], +SELECT arrtest.a[1], arrtest.b[1][1][1], arrtest.c[1], - arrtest.d[1][1], + arrtest.d[1][1], arrtest.e[0] FROM arrtest; - a|b|c |d |e ---+-+------+----+- - 1|0| | | -11| |foobar|elt1| - | |foo | | + a | b | c | d | e +----+---+--------+------+--- + 1 | 0 | | | + 11 | | foobar | elt1 | + | | foo | | (3 rows) -QUERY: SELECT arrtest.a[1:3], - arrtest.b[1:1][1:2][1:2], - arrtest.c[1:2], - arrtest.d[1:1][1:2] +SELECT a[1], b[1][1][1], c[1], d[1][1], e[0] FROM arrtest; -a |b |c |d -----------+---------------+-------------+----------------- -{1,2,3} |{{{0,0},{1,2}}}| | -{11,12,23}| | |{{"elt1","elt2"}} - | |{"foo","bar"}| + a | b | c | d | e +----+---+--------+------+--- + 1 | 0 | | | + 11 | | foobar | elt1 | + | | foo | | (3 rows) -QUERY: SELECT array_dims(arrtest.b) AS x; -x ---------------- -[1:1][1:2][1:2] -[1:2][1:2] -[1:2] +SELECT a[1:3], + b[1:1][1:2][1:2], + c[1:2], + d[1:1][1:2] + FROM arrtest; + a | b | c | d +------------+-----------------+---------------+------------------- + {1,2,3} | {{{0,0},{1,2}}} | | + {11,12,23} | | | {{"elt1","elt2"}} + | | {"foo","bar"} | +(3 rows) + +-- returns three different results-- +SELECT array_dims(arrtest.b) AS x; + x +----------------- + [1:1][1:2][1:2] + [1:2][1:2] + [1:2] (3 rows) -QUERY: SELECT * +-- returns nothing +SELECT * FROM arrtest - WHERE arrtest.a[1] < 5 and - arrtest.c = '{"foobar"}'::_name; -a|b|c|d|e|f|g --+-+-+-+-+-+- + WHERE a[1] < 5 and + c = '{"foobar"}'::_name; + a | b | c | d | e | f | g +---+---+---+---+---+---+--- (0 rows) -QUERY: SELECT arrtest.a[1:3], - arrtest.b[1:1][1:2][1:2], - arrtest.c[1:2], - arrtest.d[1:1][1:2] +UPDATE arrtest + SET a[1:2] = '{16,25}', + b[1:1][1:1][1:2] = '{113, 117}', + c[1:1] = '{"new_word"}'; +SELECT a[1:3], + b[1:1][1:2][1:2], + c[1:2], + d[1:1][2:2] FROM arrtest; -a |b |c |d -----------+---------------+-------------+----------------- -{1,2,3} |{{{0,0},{1,2}}}| | -{11,12,23}| | |{{"elt1","elt2"}} - | |{"foo","bar"}| + a | b | c | d +------------+---------------------+--------------------+------------ + {16,25,3} | {{{113,117},{1,2}}} | | + {16,25,23} | | | {{"elt2"}} + | | {"new_word","bar"} | (3 rows) diff --git a/src/test/regress/sql/arrays.sql b/src/test/regress/sql/arrays.sql index c403ad5befc..58615a66b97 100644 --- a/src/test/regress/sql/arrays.sql +++ b/src/test/regress/sql/arrays.sql @@ -10,14 +10,14 @@ SELECT arrtest.a[1], arrtest.d[1][1], arrtest.e[0] FROM arrtest; --- ??? what about --- SELECT a[1], b[1][1][1], c[1], d[1][1], e[0] --- FROM arrtest; - -SELECT arrtest.a[1:3], - arrtest.b[1:1][1:2][1:2], - arrtest.c[1:2], - arrtest.d[1:1][1:2] + +SELECT a[1], b[1][1][1], c[1], d[1][1], e[0] + FROM arrtest; + +SELECT a[1:3], + b[1:1][1:2][1:2], + c[1:2], + d[1:1][1:2] FROM arrtest; -- returns three different results-- @@ -26,18 +26,16 @@ SELECT array_dims(arrtest.b) AS x; -- returns nothing SELECT * FROM arrtest - WHERE arrtest.a[1] < 5 and - arrtest.c = '{"foobar"}'::_name; - --- updating array subranges seems to be broken --- --- UPDATE arrtest --- SET a[1:2] = '{16,25}', --- b[1:1][1:1][1:2] = '{113, 117}', --- c[1:1] = '{"new_word"}'; - -SELECT arrtest.a[1:3], - arrtest.b[1:1][1:2][1:2], - arrtest.c[1:2], - arrtest.d[1:1][1:2] + WHERE a[1] < 5 and + c = '{"foobar"}'::_name; + +UPDATE arrtest + SET a[1:2] = '{16,25}', + b[1:1][1:1][1:2] = '{113, 117}', + c[1:1] = '{"new_word"}'; + +SELECT a[1:3], + b[1:1][1:2][1:2], + c[1:2], + d[1:1][2:2] FROM arrtest; |