Skip to content

Commit a817ad8

Browse files
[PGPRO-9336] Fix of isolation tests and beautify makefile
1 parent 9e78b97 commit a817ad8

7 files changed

+707
-1602
lines changed

Makefile

+3-24
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ REGRESS = security rum rum_validate rum_hash ruminv timestamp orderby orderby_ha
3434

3535
TAP_TESTS = 1
3636

37+
ISOLATION = predicate-rum predicate-rum-2
38+
ISOLATION_OPTS = --load-extension=rum
39+
3740
ifdef USE_PGXS
3841
PG_CONFIG = pg_config
3942
PGXS := $(shell $(PG_CONFIG) --pgxs)
@@ -68,27 +71,3 @@ rum--$(EXTVERSION).sql: $(DATA_first) $(DATA_updates)
6871
# rule for updates, e.g. rum--1.0--1.1.sql
6972
rum--%.sql: gen_rum_sql--%.pl
7073
perl $< > $@
71-
72-
install: installincludes
73-
74-
installincludes:
75-
$(INSTALL) -d '$(DESTDIR)$(includedir_server)/'
76-
$(INSTALL_DATA) $(addprefix $(srcdir)/, $(RELATIVE_INCLUDES)) '$(DESTDIR)$(includedir_server)/'
77-
78-
uninstall: uninstallincludes
79-
80-
uninstallincludes:
81-
rm -f $(addprefix '$(DESTDIR)$(includedir_server)/', $(INCLUDES))
82-
83-
ISOLATIONCHECKS= predicate-rum predicate-rum-2
84-
85-
submake-isolation:
86-
$(MAKE) -C $(top_builddir)/src/test/isolation all
87-
88-
submake-rum:
89-
$(MAKE) -C $(top_builddir)/contrib/rum
90-
91-
isolationcheck: | submake-isolation submake-rum temp-install
92-
$(pg_isolation_regress_check) \
93-
--temp-config $(top_srcdir)/contrib/rum/logical.conf \
94-
$(ISOLATIONCHECKS)

expected/predicate-rum-2.out

+340-260
Large diffs are not rendered by default.

expected/predicate-rum-2_1.out

-501
This file was deleted.

expected/predicate-rum.out

+342-280
Large diffs are not rendered by default.

expected/predicate-rum_1.out

-521
This file was deleted.

specs/predicate-rum-2.spec

+11-8
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
setup
88
{
9-
CREATE EXTENSION rum;
10-
119
CREATE TABLE rum_tbl (id serial, tsv tsvector);
1210

1311
CREATE TABLE text_table (id1 serial, t text[]);
@@ -17,13 +15,19 @@ setup
1715
INSERT INTO text_table(t) SELECT array[chr(i) || chr(j)] FROM generate_series(65,90) i,
1816
generate_series(65,90) j ;
1917

20-
INSERT INTO rum_tbl(tsv) SELECT to_tsvector('simple', t[1] ) FROM text_table;
21-
2218
DO $$
19+
DECLARE
20+
c integer := 17;
21+
a integer := 261;
22+
m integer := 6760;
23+
Xi integer := 228;
2324
BEGIN
24-
FOR j in 1..10 LOOP
25-
UPDATE rum_tbl SET tsv = tsv || q.t1 FROM (SELECT id1,to_tsvector('simple', t[1] )
26-
as t1 FROM text_table) as q WHERE id = (random()*q.id1)::integer;
25+
FOR i in 1..338 LOOP
26+
INSERT INTO rum_tbl(tsv) VALUES ('');
27+
FOR j in 1..10 LOOP
28+
UPDATE rum_tbl SET tsv = tsv || (SELECT to_tsvector(t[1]) FROM text_table WHERE id1 = Xi % 676 + 1) WHERE id = i;
29+
Xi = (a * Xi + c) % m;
30+
END LOOP;
2731
END LOOP;
2832
END;
2933
$$;
@@ -35,7 +39,6 @@ teardown
3539
{
3640
DROP TABLE text_table;
3741
DROP TABLE rum_tbl;
38-
DROP EXTENSION rum;
3942
}
4043

4144
session "s1"

specs/predicate-rum.spec

+11-8
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
setup
88
{
9-
CREATE EXTENSION rum;
10-
119
CREATE TABLE rum_tbl (id serial, tsv tsvector);
1210

1311
CREATE TABLE text_table (id1 serial, t text[]);
@@ -17,13 +15,19 @@ setup
1715
INSERT INTO text_table(t) SELECT array[chr(i) || chr(j)] FROM generate_series(65,90) i,
1816
generate_series(65,90) j ;
1917

20-
INSERT INTO rum_tbl(tsv) SELECT to_tsvector('simple', t[1] ) FROM text_table;
21-
2218
DO $$
19+
DECLARE
20+
c integer := 17;
21+
a integer := 261;
22+
m integer := 6760;
23+
Xi integer := 228;
2324
BEGIN
24-
FOR j in 1..10 LOOP
25-
UPDATE rum_tbl SET tsv = tsv || q.t1 FROM (SELECT id1,to_tsvector('simple', t[1] )
26-
as t1 FROM text_table) as q WHERE id = (random()*q.id1)::integer;
25+
FOR i in 1..338 LOOP
26+
INSERT INTO rum_tbl(tsv) VALUES ('');
27+
FOR j in 1..10 LOOP
28+
UPDATE rum_tbl SET tsv = tsv || (SELECT to_tsvector(t[1]) FROM text_table WHERE id1 = Xi % 676 + 1) WHERE id = i;
29+
Xi = (a * Xi + c) % m;
30+
END LOOP;
2731
END LOOP;
2832
END;
2933
$$;
@@ -35,7 +39,6 @@ teardown
3539
{
3640
DROP TABLE text_table;
3741
DROP TABLE rum_tbl;
38-
DROP EXTENSION rum;
3942
}
4043

4144
session "s1"

0 commit comments

Comments
 (0)