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

Commit2aaae1e

Browse files
committed
pathman: fix operations with ranges (by Alexander Korotkov)
1 parent5f4da06 commit2aaae1e

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

‎contrib/pg_pathman/rangeset.c

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
bool
1414
irange_intersects(IndexRangea,IndexRangeb)
1515
{
16-
return (irange_lower(a) <=irange_upper(b))||
16+
return (irange_lower(a) <=irange_upper(b))&&
1717
(irange_lower(b) <=irange_upper(a));
1818
}
1919

2020
/* Check if two ranges are conjuncted */
2121
bool
2222
irange_conjuncted(IndexRangea,IndexRangeb)
2323
{
24-
return (irange_lower(a)-1 <=irange_upper(b))||
24+
return (irange_lower(a)-1 <=irange_upper(b))&&
2525
(irange_lower(b)-1 <=irange_upper(a));
2626
}
2727

@@ -44,6 +44,27 @@ irange_intersect(IndexRange a, IndexRange b)
4444
irange_is_lossy(a)||irange_is_lossy(b));
4545
}
4646

47+
#ifdefNOT_USED
48+
/* Print range list in debug purposes */
49+
staticchar*
50+
print_irange(List*l)
51+
{
52+
ListCell*c;
53+
StringInfoDatastr;
54+
55+
initStringInfo(&str);
56+
57+
foreach (c,l)
58+
{
59+
IndexRangeir=lfirst_irange(c);
60+
61+
appendStringInfo(&str,"[%d,%d]%c ",irange_lower(ir),irange_upper(ir),
62+
irange_is_lossy(ir) ?'l' :'e');
63+
}
64+
returnstr.data;
65+
}
66+
#endif
67+
4768
/*
4869
* Make union of two index rage lists.
4970
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp