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

Commitb18d5ca

Browse files
author
Alexander Korotkov
committed
Check for unsupported tsqueries.
1 parent4d6d293 commitb18d5ca

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

‎expected/ruminv.out

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,3 +267,7 @@ SELECT * FROM test_invrum WHERE q @@ 'a c d'::tsvector;
267267
( 'a' | 'b' ) & ( 'c' | 'd' )
268268
(5 rows)
269269

270+
INSERT INTO test_invrum VALUES ('a:*'::tsquery);
271+
ERROR: Indexing of prefix tsqueries isn't supported yet
272+
INSERT INTO test_invrum VALUES ('a <-> b'::tsquery);
273+
ERROR: Indexing of phrase tsqueries isn't supported yet

‎rumtsquery.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ make_query_item_wrap(QueryItem *item, QueryItemWrap *parent, bool not)
7373
{
7474
QueryOperand*operand= (QueryOperand*)item;
7575
QueryItemWrap*wrap=add_child(parent);
76+
77+
if (operand->prefix)
78+
elog(ERROR,"Indexing of prefix tsqueries isn't supported yet");
79+
7680
wrap->type=QI_VAL;
7781
wrap->distance=operand->distance;
7882
wrap->length=operand->length;
@@ -111,6 +115,7 @@ make_query_item_wrap(QueryItem *item, QueryItemWrap *parent, bool not)
111115
}
112116
}
113117
caseOP_PHRASE:
118+
elog(ERROR,"Indexing of phrase tsqueries isn't supported yet");
114119
default:
115120
elog(ERROR,"Invalid tsquery operator");
116121
}

‎sql/ruminv.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,6 @@ SELECT * FROM test_invrum WHERE q @@ 'b d'::tsvector;
4343
SELECT*FROM test_invrumWHERE q @@'a b d'::tsvector;
4444
SELECT*FROM test_invrumWHERE q @@'c d'::tsvector;
4545
SELECT*FROM test_invrumWHERE q @@'a c d'::tsvector;
46+
47+
INSERT INTO test_invrumVALUES ('a:*'::tsquery);
48+
INSERT INTO test_invrumVALUES ('a <-> b'::tsquery);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp