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

Commiteffc1b8

Browse files
committed
TAP-tests was fixed
1 parent793bcd1 commiteffc1b8

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

‎t/001_wal.pl

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ sub test_index_replay
2323
my$queries =qq(SET enable_seqscan=off;
2424
SET enable_bitmapscan=on;
2525
SET enable_indexscan=on;
26-
SELECT * FROM tst WHERE t\@@ to_tsquery('simple', 'b');
27-
SELECT * FROM tst WHERE t\@@ to_tsquery('simple', 'f');
28-
SELECT * FROM tst WHEREi = 3 ANDt\@@ to_tsquery('simple', 'c');
29-
SELECT * FROM tst WHEREi = 7 ANDt\@@ to_tsquery('simple', 'e');
26+
SELECT * FROM tst WHERE t\@@ to_tsquery('simple', 'qscfq');
27+
SELECT * FROM tst WHERE t\@@ to_tsquery('simple', 'ztcow');
28+
SELECT * FROM tst WHERE t\@@ to_tsquery('simple', 'jqljy');
29+
SELECT * FROM tst WHERE t\@@ to_tsquery('simple', 'lvnex');
3030
);
3131

3232
# Run test queries and compare their result
@@ -54,7 +54,11 @@ sub test_index_replay
5454
# Create some rum index on master
5555
$node_master->psql("postgres","CREATE EXTENSION rum;");
5656
$node_master->psql("postgres","CREATE TABLE tst (i int4, t tsvector);");
57-
$node_master->psql("postgres","INSERT INTO tst SELECT i%10, to_tsvector('simple', substr(md5(i::text), 1, 1)) FROM generate_series(1,100000) i;");
57+
$node_master->psql("postgres","INSERT INTO tst SELECT i%10,
58+
to_tsvector('simple', array_to_string(array(
59+
select substr('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', trunc(random() * 52)::integer + 1, 1)
60+
FROM generate_series(i, i + 4)), ''))
61+
FROM generate_series(1,100000) i;");
5862
$node_master->psql("postgres","CREATE INDEX rumidx ON tst USING rum (t rum_tsvector_ops);");
5963

6064
# Test that queries give same result
@@ -68,6 +72,10 @@ sub test_index_replay
6872
$node_master->psql("postgres","VACUUM tst;");
6973
test_index_replay("vacuum$i");
7074
my ($start,$end) = (100001 + ($i - 1) * 10000, 100000 +$i * 10000);
71-
$node_master->psql("postgres","INSERT INTO tst SELECT i%10, to_tsvector('simple', substr(md5(i::text), 1, 1)) FROM generate_series($start,$end) i;");
75+
$node_master->psql("postgres","INSERT INTO tst SELECT i%10,
76+
to_tsvector('simple', array_to_string(array(
77+
select substr('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', trunc(random() * 52)::integer + 1, 1)
78+
FROM generate_series(i, i + 4)), ''))
79+
FROM generate_series($start,$end) i;");
7280
test_index_replay("insert$i");
7381
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp