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

Commit6546ffb

Browse files
committed
Fix comparison logic in partition_bounds_equal for non-finite bounds.
If either bound is infinite, then we shouldn't even try to perform acomparison of the values themselves. Rearrange the logic so thatwe don't.Per buildfarm member skink and Tom Lane.
1 parent50cf1c8 commit6546ffb

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

‎src/backend/catalog/partition.c

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -624,16 +624,28 @@ partition_bounds_equal(PartitionKey key,
624624
{
625625
int32cmpval;
626626

627+
/* For range partitions, the bounds might not be finite. */
628+
if (b1->content!=NULL)
629+
{
630+
/*
631+
* A finite bound always differs from an infinite bound, and
632+
* different kinds of infinities differ from each other.
633+
*/
634+
if (b1->content[i][j]!=b2->content[i][j])
635+
return false;
636+
637+
/* Non-finite bounds are equal without further examination. */
638+
if (b1->content[i][j]!=RANGE_DATUM_FINITE)
639+
continue;
640+
}
641+
642+
/* Compare the actual values */
627643
cmpval=DatumGetInt32(FunctionCall2Coll(&key->partsupfunc[j],
628644
key->partcollation[j],
629645
b1->datums[i][j],
630646
b2->datums[i][j]));
631647
if (cmpval!=0)
632648
return false;
633-
634-
/* Range partitions can have infinite datums */
635-
if (b1->content!=NULL&&b1->content[i][j]!=b2->content[i][j])
636-
return false;
637649
}
638650

639651
if (b1->indexes[i]!=b2->indexes[i])

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp