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

Commit5033e95

Browse files
committed
Provide stable test for NULL-values in KNN SP-GiST
f5f084f has removed test because of its instability. This commit providesalternative test with determined ordering using extra ORDER BY expression.Backpatch-through: 12
1 parentc53e40a commit5033e95

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

‎src/test/regress/expected/create_index_spgist.out

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,16 @@ WHERE seq.dist IS DISTINCT FROM idx.dist;
555555
---+------+---+---+------+---
556556
(0 rows)
557557

558+
-- check ORDER BY distance to NULL
559+
SELECT (SELECT p FROM kd_point_tbl ORDER BY p <-> pt, p <-> '0,0' LIMIT 1)
560+
FROM (VALUES (point '1,2'), (NULL), ('1234,5678')) pts(pt);
561+
p
562+
-------------
563+
(59,21)
564+
(59,21)
565+
(1239,5647)
566+
(3 rows)
567+
558568
EXPLAIN (COSTS OFF)
559569
SELECT count(*) FROM radix_text_tbl WHERE t = 'P0123456789abcdef';
560570
QUERY PLAN

‎src/test/regress/sql/create_index_spgist.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,10 @@ SELECT * FROM quad_point_tbl_ord_seq3 seq FULL JOIN kd_point_tbl_ord_idx3 idx
225225
ONseq.n=idx.n
226226
WHEREseq.dist IS DISTINCTFROMidx.dist;
227227

228+
-- check ORDER BY distance to NULL
229+
SELECT (SELECT pFROM kd_point_tblORDER BY p<-> pt, p<->'0,0'LIMIT1)
230+
FROM (VALUES (point'1,2'), (NULL), ('1234,5678')) pts(pt);
231+
228232

229233
EXPLAIN (COSTS OFF)
230234
SELECTcount(*)FROM radix_text_tblWHERE t='P0123456789abcdef';

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp