Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7f17fd6

Browse files
committed
Fix CompareIndexInfo's attnum comparisons
When an index column is an expression, it makes no sense to compare its attribute numbers. This seems to account for remaining buildfarm fallout from 8b08f7d. At least, it solves the issue in my local 32bit VM -- let's see what the rest thinks.
1 parent 8b9e964 commit 7f17fd6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/backend/catalog/index.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -1795,8 +1795,10 @@ CompareIndexInfo(IndexInfo *info1, IndexInfo *info2,
17951795
if (maplen < info2->ii_KeyAttrNumbers[i])
17961796
elog(ERROR, "incorrect attribute map");
17971797

1798-
if (attmap[info2->ii_KeyAttrNumbers[i] - 1] !=
1799-
info1->ii_KeyAttrNumbers[i])
1798+
/* ignore expressions at this stage */
1799+
if ((info1->ii_KeyAttrNumbers[i] != InvalidAttrNumber) &&
1800+
(attmap[info2->ii_KeyAttrNumbers[i] - 1] !=
1801+
info1->ii_KeyAttrNumbers[i]))
18001802
return false;
18011803

18021804
if (collations1[i] != collations2[i])

0 commit comments

Comments
 (0)