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

Fix isolation tests#131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
sokolcati merged 1 commit intopostgrespro:masterfromVadimMinigaliev:PGPRO-9336
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions.travis.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,10 +35,3 @@ env:
- PG_VERSION=13 LEVEL=hardcore
- PG_VERSION=12
- PG_VERSION=12 LEVEL=hardcore
- PG_VERSION=11
- PG_VERSION=11 LEVEL=hardcore

matrix:
allow_failures:
- env: PG_VERSION=11
- env: PG_VERSION=11 LEVEL=hardcore
17 changes: 17 additions & 0 deletionsMakefile
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -30,9 +30,20 @@ REGRESS = security rum rum_validate rum_hash ruminv timestamp orderby orderby_ha

TAP_TESTS = 1

ISOLATION = predicate-rum predicate-rum-2
ISOLATION_OPTS = --load-extension=rum
EXTRA_CLEAN = pglist_tmp

ifdef USE_PGXS

# We cannot run isolation test for versions 12,13 in PGXS case
# because 'pg_isolation_regress' is not copied to install
# directory, see src/test/isolation/Makefile
ifeq ($(MAJORVERSION),$(filter 12% 13%,$(MAJORVERSION)))
undefine ISOLATION
undefine ISOLATION_OPTS
endif

PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
include $(PGXS)
Expand DownExpand Up@@ -60,6 +71,11 @@ wal-check: temp-install
check: wal-check
endif

#
# Make conditional targets to save backward compatibility with PG11, PG10 and PG9.6.
#
ifeq ($(MAJORVERSION), $(filter 9.6% 10% 11%, $(MAJORVERSION)))

install: installincludes

installincludes:
Expand All@@ -83,3 +99,4 @@ isolationcheck: | submake-isolation submake-rum temp-install
$(pg_isolation_regress_check) \
--temp-config $(top_srcdir)/contrib/rum/logical.conf \
$(ISOLATIONCHECKS)
endif
600 changes: 340 additions & 260 deletionsexpected/predicate-rum-2.out
View file
Open in desktop

Large diffs are not rendered by default.

501 changes: 0 additions & 501 deletionsexpected/predicate-rum-2_1.out
View file
Open in desktop

This file was deleted.

622 changes: 342 additions & 280 deletionsexpected/predicate-rum.out
View file
Open in desktop

Large diffs are not rendered by default.

521 changes: 0 additions & 521 deletionsexpected/predicate-rum_1.out
View file
Open in desktop

This file was deleted.

16 changes: 14 additions & 2 deletionsmeson.build
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -24,7 +24,7 @@ rum_sources = files(
if host_system == 'windows'
rum_sources += rc_lib_gen.process(win32ver_rc, extra_args: [
'--NAME', 'rum',
'--FILEDESC', 'rum - providesaccess method to work with the RUM indexes.',])
'--FILEDESC', 'RUM indexaccess method',])
endif

rum = shared_module('rum',
Expand DownExpand Up@@ -87,10 +87,22 @@ tests += {
'expr',
'array',
],
'regress_args': [
'--temp-config', files('logical.conf')
],
},
'tap': {
'tests': [
't/001_wal.pl',
],
},
}
'isolation': {
'specs': [
'predicate-rum',
'predicate-rum-2',
],
'regress_args': [
'--temp-config', files('logical.conf'),
],
},
}
24 changes: 14 additions & 10 deletionsspecs/predicate-rum-2.spec
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,24 +6,29 @@

setup
{
CREATE EXTENSION rum;

CREATE TABLE rum_tbl (id serial, tsv tsvector);

CREATE TABLE text_table (id1 serial, t text[]);

SELECT SETSEED(0.5);

INSERT INTO text_table(t) SELECT array[chr(i) || chr(j)] FROM generate_series(65,90) i,
generate_series(65,90) j ;

INSERT INTO rum_tbl(tsv) SELECT to_tsvector('simple', t[1] ) FROM text_table;

-- We need to use pseudorandom to generate values for test table
-- In this case we use linear congruential generator because random()
-- function may generate different outputs with different systems
DO $$
DECLARE
c integer := 17;
a integer := 261;
m integer := 6760;
Xi integer := 228;
BEGIN
FOR j in 1..10 LOOP
UPDATE rum_tbl SET tsv = tsv || q.t1 FROM (SELECT id1,to_tsvector('simple', t[1] )
as t1 FROM text_table) as q WHERE id = (random()*q.id1)::integer;
FOR i in 1..338 LOOP
INSERT INTO rum_tbl(tsv) VALUES ('');
FOR j in 1..10 LOOP
UPDATE rum_tbl SET tsv = tsv || (SELECT to_tsvector(t[1]) FROM text_table WHERE id1 = Xi % 676 + 1) WHERE id = i;
Xi = (a * Xi + c) % m;
END LOOP;
END LOOP;
END;
$$;
Expand All@@ -35,7 +40,6 @@ teardown
{
DROP TABLE text_table;
DROP TABLE rum_tbl;
DROP EXTENSION rum;
}

session "s1"
Expand Down
24 changes: 14 additions & 10 deletionsspecs/predicate-rum.spec
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,24 +6,29 @@

setup
{
CREATE EXTENSION rum;

CREATE TABLE rum_tbl (id serial, tsv tsvector);

CREATE TABLE text_table (id1 serial, t text[]);

SELECT SETSEED(0.5);

INSERT INTO text_table(t) SELECT array[chr(i) || chr(j)] FROM generate_series(65,90) i,
generate_series(65,90) j ;

INSERT INTO rum_tbl(tsv) SELECT to_tsvector('simple', t[1] ) FROM text_table;

-- We need to use pseudorandom to generate values for test table
-- In this case we use linear congruential generator because random()
-- function may generate different outputs with different systems
DO $$
DECLARE
c integer := 17;
a integer := 261;
m integer := 6760;
Xi integer := 228;
BEGIN
FOR j in 1..10 LOOP
UPDATE rum_tbl SET tsv = tsv || q.t1 FROM (SELECT id1,to_tsvector('simple', t[1] )
as t1 FROM text_table) as q WHERE id = (random()*q.id1)::integer;
FOR i in 1..338 LOOP
INSERT INTO rum_tbl(tsv) VALUES ('');
FOR j in 1..10 LOOP
UPDATE rum_tbl SET tsv = tsv || (SELECT to_tsvector(t[1]) FROM text_table WHERE id1 = Xi % 676 + 1) WHERE id = i;
Xi = (a * Xi + c) % m;
END LOOP;
END LOOP;
END;
$$;
Expand All@@ -35,7 +40,6 @@ teardown
{
DROP TABLE text_table;
DROP TABLE rum_tbl;
DROP EXTENSION rum;
}

session "s1"
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp