Skip to content

Commit a426ff5

Browse files
committed
There, I'll leave this alone until Thomas catchs up *grin*
1 parent 832c0a4 commit a426ff5

File tree

4 files changed

+62
-71
lines changed

4 files changed

+62
-71
lines changed

src/test/regress/input/misc.source

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,6 @@ SELECT * FROM stud_emp;
7979
-- COPY aggtest TO stdout;
8080

8181

82-
--
83-
-- test the random function
84-
--
85-
-- count the number of tuples originally
86-
SELECT count(*) FROM onek;
87-
88-
-- select roughly 1/10 of the tuples
89-
SELECT count(*) FROM onek where oidrand(onek.oid, 10);
90-
91-
-- select again, the count should be different
92-
SELECT count(*) FROM onek where oidrand(onek.oid, 10);
93-
94-
9582
--
9683
-- inheritance stress test
9784
--
@@ -228,53 +215,3 @@ SELECT user_relns() AS user_relns
228215
--
229216
-- rewrite rules
230217
--
231-
232-
--
233-
-- ARRAYS
234-
--
235-
SELECT * FROM arrtest;
236-
237-
SELECT arrtest.a[1],
238-
arrtest.b[1][1][1],
239-
arrtest.c[1],
240-
arrtest.d[1][1],
241-
arrtest.e[0]
242-
FROM arrtest;
243-
-- ??? what about
244-
-- SELECT a[1], b[1][1][1], c[1], d[1][1], e[0]
245-
-- FROM arrtest;
246-
247-
SELECT arrtest.a[1:3],
248-
arrtest.b[1:1][1:2][1:2],
249-
arrtest.c[1:2],
250-
arrtest.d[1:1][1:2]
251-
FROM arrtest;
252-
253-
-- returns three different results--
254-
SELECT array_dims(arrtest.b) AS x;
255-
256-
-- returns nothing
257-
SELECT *
258-
FROM arrtest
259-
WHERE arrtest.a[1] < 5 and
260-
arrtest.c = '{"foobar"}'::_char16;
261-
262-
-- updating array subranges seems to be broken
263-
--
264-
-- UPDATE arrtest
265-
-- SET a[1:2] = '{16,25}',
266-
-- b[1:1][1:1][1:2] = '{113, 117}',
267-
-- c[1:1] = '{"new_word"}';
268-
269-
SELECT arrtest.a[1:3],
270-
arrtest.b[1:1][1:2][1:2],
271-
arrtest.c[1:2],
272-
arrtest.d[1:1][1:2]
273-
FROM arrtest;
274-
275-
276-
--
277-
-- expensive functions
278-
--
279-
280-

src/test/regress/sql/arrays.sql

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
--
2+
-- ARRAYS
3+
--
4+
SELECT * FROM arrtest;
5+
6+
SELECT arrtest.a[1],
7+
arrtest.b[1][1][1],
8+
arrtest.c[1],
9+
arrtest.d[1][1],
10+
arrtest.e[0]
11+
FROM arrtest;
12+
-- ??? what about
13+
-- SELECT a[1], b[1][1][1], c[1], d[1][1], e[0]
14+
-- FROM arrtest;
15+
16+
SELECT arrtest.a[1:3],
17+
arrtest.b[1:1][1:2][1:2],
18+
arrtest.c[1:2],
19+
arrtest.d[1:1][1:2]
20+
FROM arrtest;
21+
22+
-- returns three different results--
23+
SELECT array_dims(arrtest.b) AS x;
24+
25+
-- returns nothing
26+
SELECT *
27+
FROM arrtest
28+
WHERE arrtest.a[1] < 5 and
29+
arrtest.c = '{"foobar"}'::_char16;
30+
31+
-- updating array subranges seems to be broken
32+
--
33+
-- UPDATE arrtest
34+
-- SET a[1:2] = '{16,25}',
35+
-- b[1:1][1:1][1:2] = '{113, 117}',
36+
-- c[1:1] = '{"new_word"}';
37+
38+
SELECT arrtest.a[1:3],
39+
arrtest.b[1:1][1:2][1:2],
40+
arrtest.c[1:2],
41+
arrtest.d[1:1][1:2]
42+
FROM arrtest;

src/test/regress/sql/random.sql

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--
2+
-- test the random function
3+
--
4+
-- count the number of tuples originally
5+
SELECT count(*) FROM onek;
6+
7+
-- select roughly 1/10 of the tuples
8+
SELECT count(*) FROM onek where oidrand(onek.oid, 10);
9+
10+
-- select again, the count should be different
11+
SELECT count(*) FROM onek where oidrand(onek.oid, 10);
12+

src/test/regress/sql/tests

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ select_distinct_on
3939
transactions
4040
portals
4141
errors
42+
misc
43+
random
44+
arrays
4245
btree_index
4346
hash_index
44-
aggregates.sql
45-
select_views.sql
46-
alter_table.sql
47-
purge.sql
48-
portals_p2.sql
49-
misc
50-
51-
47+
aggregates
48+
select_views
49+
alter_table
50+
purge
51+
portals_p2

0 commit comments

Comments
 (0)