Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6ce5e0a

Browse files
committed
Update arrays regress test to reflect fact that several things
work now that did not work in 6.5.
1 parent2a1bfbc commit6ce5e0a

File tree

2 files changed

+80
-64
lines changed

2 files changed

+80
-64
lines changed

‎src/test/regress/expected/arrays.out

Lines changed: 60 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,79 @@
1-
QUERY: SELECT * FROM arrtest;
2-
a |b |c |d |e |f |g
3-
-----------+---------------+-------------+-----------------+-------------+-----------------+---------------
4-
{1,2,3,4,5}|{{{0,0},{1,2}}}|{} |{} | |{} |{}
5-
{11,12,23} |{{3,4},{4,5}} |{"foobar"} |{{"elt1","elt2"}}|{"3.4","6.7"}|{"abc ","abcde"}|{"abc","abcde"}
6-
{} |{3,4} |{"foo","bar"}|{"bar","foo"} | | |
1+
--
2+
-- ARRAYS
3+
--
4+
SELECT * FROM arrtest;
5+
a | b | c | d | e | f | g
6+
-------------+-----------------+---------------+-------------------+---------------+-------------------+-----------------
7+
{1,2,3,4,5} | {{{0,0},{1,2}}} | {} | {} | | {} | {}
8+
{11,12,23} | {{3,4},{4,5}} | {"foobar"} | {{"elt1","elt2"}} | {"3.4","6.7"} | {"abc ","abcde"} | {"abc","abcde"}
9+
{} | {3,4} | {"foo","bar"} | {"bar","foo"} | | |
710
(3 rows)
811

9-
QUERY:SELECT arrtest.a[1],
12+
SELECT arrtest.a[1],
1013
arrtest.b[1][1][1],
1114
arrtest.c[1],
12-
arrtest.d[1][1],
15+
arrtest.d[1][1],
1316
arrtest.e[0]
1417
FROM arrtest;
15-
a|b|c |d |e
16-
--+-+------+----+-
17-
1|0| ||
18-
11| |foobar|elt1|
19-
| |foo ||
18+
a | b |c |d | e
19+
----+---+--------+------+---
20+
1 | 0|| |
21+
11 | |foobar |elt1 |
22+
| |foo| |
2023
(3 rows)
2124

22-
QUERY: SELECT arrtest.a[1:3],
23-
arrtest.b[1:1][1:2][1:2],
24-
arrtest.c[1:2],
25-
arrtest.d[1:1][1:2]
25+
SELECT a[1], b[1][1][1], c[1], d[1][1], e[0]
2626
FROM arrtest;
27-
a |b |c |d
28-
----------+---------------+-------------+-----------------
29-
{1,2,3} |{{{0,0},{1,2}}}||
30-
{11,12,23}|| |{{"elt1","elt2"}}
31-
| |{"foo","bar"}|
27+
a| b |c| d| e
28+
----+---+--------+------+---
29+
1 | 0| ||
30+
11|| foobar | elt1|
31+
|| foo||
3232
(3 rows)
3333

34-
QUERY: SELECT array_dims(arrtest.b) AS x;
35-
x
36-
---------------
37-
[1:1][1:2][1:2]
38-
[1:2][1:2]
39-
[1:2]
34+
SELECT a[1:3],
35+
b[1:1][1:2][1:2],
36+
c[1:2],
37+
d[1:1][1:2]
38+
FROM arrtest;
39+
a | b | c | d
40+
------------+-----------------+---------------+-------------------
41+
{1,2,3} | {{{0,0},{1,2}}} | |
42+
{11,12,23} | | | {{"elt1","elt2"}}
43+
| | {"foo","bar"} |
44+
(3 rows)
45+
46+
-- returns three different results--
47+
SELECT array_dims(arrtest.b) AS x;
48+
x
49+
-----------------
50+
[1:1][1:2][1:2]
51+
[1:2][1:2]
52+
[1:2]
4053
(3 rows)
4154

42-
QUERY: SELECT *
55+
-- returns nothing
56+
SELECT *
4357
FROM arrtest
44-
WHEREarrtest.a[1] < 5 and
45-
arrtest.c = '{"foobar"}'::_name;
46-
a|b|c|d|e|f|g
47-
-+-+-+-+-+-+-
58+
WHERE a[1] < 5 and
59+
c = '{"foobar"}'::_name;
60+
a | b | c | d | e | f | g
61+
---+---+---+---+---+---+---
4862
(0 rows)
4963

50-
QUERY: SELECT arrtest.a[1:3],
51-
arrtest.b[1:1][1:2][1:2],
52-
arrtest.c[1:2],
53-
arrtest.d[1:1][1:2]
64+
UPDATE arrtest
65+
SET a[1:2] = '{16,25}',
66+
b[1:1][1:1][1:2] = '{113, 117}',
67+
c[1:1] = '{"new_word"}';
68+
SELECT a[1:3],
69+
b[1:1][1:2][1:2],
70+
c[1:2],
71+
d[1:1][2:2]
5472
FROM arrtest;
55-
a|b|c|d
56-
----------+---------------+-------------+-----------------
57-
{1,2,3} |{{{0,0},{1,2}}}||
58-
{11,12,23}| ||{{"elt1","elt2"}}
59-
||{"foo","bar"}|
73+
a |b |c| d
74+
------------+---------------------+--------------------+------------
75+
{16,25,3}|{{{113,117},{1,2}}}||
76+
{16,25,23}|| | {{"elt2"}}
77+
| | {"new_word","bar"} |
6078
(3 rows)
6179

‎src/test/regress/sql/arrays.sql

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ SELECT arrtest.a[1],
1010
arrtest.d[1][1],
1111
arrtest.e[0]
1212
FROM arrtest;
13-
-- ??? what about
14-
--SELECT a[1], b[1][1][1], c[1], d[1][1], e[0]
15-
-- FROM arrtest;
16-
17-
SELECTarrtest.a[1:3],
18-
arrtest.b[1:1][1:2][1:2],
19-
arrtest.c[1:2],
20-
arrtest.d[1:1][1:2]
13+
14+
SELECT a[1], b[1][1][1], c[1], d[1][1], e[0]
15+
FROM arrtest;
16+
17+
SELECT a[1:3],
18+
b[1:1][1:2][1:2],
19+
c[1:2],
20+
d[1:1][1:2]
2121
FROM arrtest;
2222

2323
-- returns three different results--
@@ -26,18 +26,16 @@ SELECT array_dims(arrtest.b) AS x;
2626
-- returns nothing
2727
SELECT*
2828
FROM arrtest
29-
WHEREarrtest.a[1]<5and
30-
arrtest.c='{"foobar"}'::_name;
31-
32-
-- updating array subranges seems to be broken
33-
--
34-
-- UPDATE arrtest
35-
-- SET a[1:2] = '{16,25}',
36-
-- b[1:1][1:1][1:2] = '{113, 117}',
37-
-- c[1:1] = '{"new_word"}';
38-
39-
SELECTarrtest.a[1:3],
40-
arrtest.b[1:1][1:2][1:2],
41-
arrtest.c[1:2],
42-
arrtest.d[1:1][1:2]
29+
WHERE a[1]<5and
30+
c='{"foobar"}'::_name;
31+
32+
UPDATE arrtest
33+
SET a[1:2]='{16,25}',
34+
b[1:1][1:1][1:2]='{113, 117}',
35+
c[1:1]='{"new_word"}';
36+
37+
SELECT a[1:3],
38+
b[1:1][1:2][1:2],
39+
c[1:2],
40+
d[1:1][2:2]
4341
FROM arrtest;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp