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

Commit34619f9

Browse files
authored
Fixed the content of the error message (#133)
Fixed the content of the error messageIf the "rum" index is created without the "WITH" operator,two columns must be specified for "ORDER BY" to work.But now error message in this case looks like: "ERROR: cannot order without attribute ... in WHERE clause"Fixed the content of error message: "WHERE" replaced by "ORDER BY".Added a test that checks the case when only one column isspecified in the "ORDER BY" and error message for this.Tags: rum.
1 parenta23de3d commit34619f9

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

‎expected/orderby.out

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,11 @@ SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND d >= '2016-05-16 14:21:25' ORDER
460460
458 | Fri May 20 21:21:22.326724 2016
461461
(3 rows)
462462

463+
-- Test "ORDER BY" error message
464+
DROP INDEX tsts_idx;
465+
CREATE INDEX tsts_idx ON tsts USING rum (t rum_tsvector_addon_ops, d);
466+
SELECT id, d, d <=> '2016-05-16 14:21:25' FROM tsts WHERE t @@ 'wr&qh' ORDER BY d <=> '2016-05-16 14:21:25' LIMIT 5;
467+
ERROR: cannot order without attribute 2 in ORDER BY clause
463468
-- Test multicolumn index
464469
RESET enable_indexscan;
465470
RESET enable_indexonlyscan;

‎sql/orderby.sql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ SELECT id, d FROM tsts WHERE t @@ 'wr&qh' AND d <= '2016-05-16 14:21:25' ORDER
9595
SELECT id, dFROM tstsWHERE t @@'wr&qh'AND d>='2016-05-16 14:21:25'ORDER BY dASCLIMIT3;
9696
SELECT id, dFROM tstsWHERE t @@'wr&qh'AND d>='2016-05-16 14:21:25'ORDER BY dDESCLIMIT3;
9797

98+
-- Test "ORDER BY" error message
99+
DROPINDEX tsts_idx;
100+
101+
CREATEINDEXtsts_idxON tsts USING rum (t rum_tsvector_addon_ops, d);
102+
103+
SELECT id, d, d<=>'2016-05-16 14:21:25'FROM tstsWHERE t @@'wr&qh'ORDER BY d<=>'2016-05-16 14:21:25'LIMIT5;
104+
98105
-- Test multicolumn index
99106

100107
RESET enable_indexscan;

‎src/rumscan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ rumFillScanKey(RumScanOpaque so, OffsetNumber attnum,
214214
}
215215

216216
if (scanKey==NULL)
217-
elog(ERROR,"cannot order without attribute %d inWHERE clause",
217+
elog(ERROR,"cannot order without attribute %d inORDER BY clause",
218218
key->attnum);
219219
elseif (scanKey->nentries>1)
220220
elog(ERROR,"scan key should contain only one value");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp