8000 [PGPRO-9336] Fix of isolation tests and beautify makefile · postgrespro/rum@6ba9b0c · GitHub
[go: up one dir, main page]

Skip to content

Commit 6ba9b0c

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

File tree

8 files changed

+712
-1586
lines changed

8 files changed

+712
-1586
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,3 @@ env:
3333
- PG_VERSION=13 LEVEL=hardcore
3434
- PG_VERSION=12
3535
- PG_VERSION=12 LEVEL=hardcore
36-
- PG_VERSION=11
37-
- PG_VERSION=11 LEVEL=hardcore

Makefile

Lines changed: 8 additions & 2 deletions
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)
@@ -69,8 +72,10 @@ rum--$(EXTVERSION).sql: $(DATA_first) $(DATA_updates)
6972
rum--%.sql: gen_rum_sql--%.pl
7073
perl $< > $@
7174

72-
install: installincludes
73-
75+
#
76+
# Make conditional targets to save backward compatibility with PG11, PG10 and PG9.6.
77+
#
78+
ifeq ($(MAJORVERSION), $(filter 9.6% 10% 11%, $(MAJORVERSION)))
7479
installincludes:
7580
$(INSTALL) -d '$(DESTDIR)$(includedir_server)/'
7681
$(INSTALL_DATA) $(addprefix $(srcdir)/, $(RELATIVE_INCLUDES)) '$(DESTDIR)$(includedir_server)/'
@@ -92,3 +97,4 @@ isolationcheck: | submake-isolation submake-rum temp-install
9297
$(pg_isolation_regress_check) \
9398
--temp-config $(top_srcdir)/contrib/rum/logical.conf \
9499
$(ISOLATIONCHECKS)
100+
endif

expected/predicate-rum-2.out

Lines changed: 340 additions & 260 deletions
Large diffs are not rendered by default.

expected/predicate-rum-2_1.out

Lines changed: 0 additions & 501 deletions
This file was deleted.

expected/predicate-rum.out

Lines changed: 342 additions & 280 deletions
Large diffs are not rendered by default.

expected/predicate-rum_1.out

Lines changed: 0 additions & 521 deletions
This file was deleted.

specs/predicate-rum-2.spec

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,26 @@
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[]);
1412

15-
SELECT SETSEED(0.5);
16-
1713
INSERT INTO text_table(t) SELECT array[chr(i) || chr(j)] FROM generate_series(65,90) i,
1814
generate_series(65,90) j ;
1915

20-
INSERT INTO rum_tbl(tsv) SELECT to_tsvector('simple', t[1] ) FROM text_table;
21-
2216
DO $$
17+
DECLARE
18+
c integer := 17;
19+
a integer := 261;
20+
m integer := 6760;
21+
Xi integer := 228;
2322
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;
23+
FOR i in 1..338 LOOP
24+
INSERT INTO rum_tbl(tsv) VALUES ('');
25+
FOR j in 1..10 LOOP
26+
UPDATE rum_tbl SET tsv = tsv || (SELECT to_tsvector(t[1]) FROM text_table WHERE id1 = Xi % 676 + 1) WHERE id = i;
27+
Xi = (a * Xi + c) % m;
28+
END LOOP;
2729
END LOOP;
2830
END;
2931
$$;
@@ -35,7 +37,6 @@ teardown
3537
{
3638
DROP TABLE text_table;
3739
DROP TABLE rum_tbl;
38-
DROP EXTENSION rum;
3940
}
4041

4142
session "s1"

specs/predicate-rum.spec

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,26 @@
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[]);
1412

15-
SELECT SETSEED(0.5);
16-
1713
INSERT INTO text_table(t) SELECT array[chr(i) || chr(j)] FROM generate_series(65,90) i,
1814
generate_series(65,90) j ;
1915

20-
INSERT INTO rum_tbl(tsv) SELECT to_tsvector('simple', t[1] ) FROM text_table;
21-
2216
DO $$
17+
DECLARE
18+
c integer := 17;
19+
a integer := 261;
20+
m integer := 6760;
21+
Xi integer := 228;
2322
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;
23+
FOR i in 1..338 LOOP
24+
INSERT INTO rum_tbl(tsv) VALUES ('');
25+
FOR j in 1..10 LOOP
26+
UPDATE rum_tbl SET tsv = tsv || (SELECT to_tsvector(t[1]) FROM text_table WHERE id1 = Xi % 676 + 1) WHERE id = i;
27+
Xi = (a * Xi + c) % m;
28+
END LOOP;
2729
END LOOP;
2830
END;
2931
$$;
@@ -35,7 +37,6 @@ teardown
3537
{
3638
DROP TABLE text_table;
3739
DROP TABLE rum_tbl;
38-
DROP EXTENSION rum;
3940
}
4041

4142
session "s1"

0 commit comments

Comments
 (0)
0