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

Commit35438e5

Browse files
committed
Minor code beautification in partition_bounds_equal.
Use get_greatest_modulus more consistently, instead of doing thesame thing in an ad-hoc manner in this one place.Ashutosh BapatDiscussion:http://postgr.es/m/CAFjFpReT9L4RCiJBKOyWC2=i02kv9uG2fx=4Fv7kFY2t0SPCgw@mail.gmail.com
1 parent9502227 commit35438e5

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

‎src/backend/catalog/partition.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -751,15 +751,13 @@ partition_bounds_equal(int partnatts, int16 *parttyplen, bool *parttypbyval,
751751

752752
if (b1->strategy==PARTITION_STRATEGY_HASH)
753753
{
754-
intgreatest_modulus;
754+
intgreatest_modulus=get_greatest_modulus(b1);
755755

756756
/*
757757
* If two hash partitioned tables have different greatest moduli,
758-
* their partition schemes don't match. For hash partitioned table,
759-
* the greatest modulus is given by the last datum and number of
760-
* partitions is given by ndatums.
758+
* their partition schemes don't match.
761759
*/
762-
if (b1->datums[b1->ndatums-1][0]!=b2->datums[b2->ndatums-1][0])
760+
if (greatest_modulus!=get_greatest_modulus(b2))
763761
return false;
764762

765763
/*
@@ -773,7 +771,6 @@ partition_bounds_equal(int partnatts, int16 *parttyplen, bool *parttypbyval,
773771
* their indexes array will be same. So, it suffices to compare
774772
* indexes array.
775773
*/
776-
greatest_modulus=get_greatest_modulus(b1);
777774
for (i=0;i<greatest_modulus;i++)
778775
if (b1->indexes[i]!=b2->indexes[i])
779776
return false;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp