mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Clean up cruft around collation initialization for tupdescs and scankeys.
I found actual bugs in GiST and plpgsql; the rest of this is cosmetic but meant to decrease the odds of future bugs of omission.
This commit is contained in:
@@ -721,10 +721,9 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
|
||||
cur->sk_attno,
|
||||
InvalidStrategy,
|
||||
cur->sk_subtype,
|
||||
cur->sk_func.fn_collation,
|
||||
procinfo,
|
||||
cur->sk_argument);
|
||||
ScanKeyEntryInitializeCollation(scankeys + i,
|
||||
cur->sk_func.fn_collation);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -743,10 +742,9 @@ _bt_first(IndexScanDesc scan, ScanDirection dir)
|
||||
cur->sk_attno,
|
||||
InvalidStrategy,
|
||||
cur->sk_subtype,
|
||||
cur->sk_func.fn_collation,
|
||||
cmp_proc,
|
||||
cur->sk_argument);
|
||||
ScanKeyEntryInitializeCollation(scankeys + i,
|
||||
cur->sk_func.fn_collation);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,7 +70,8 @@ _bt_mkscankey(Relation rel, IndexTuple itup)
|
||||
|
||||
/*
|
||||
* We can use the cached (default) support procs since no cross-type
|
||||
* comparison can be needed.
|
||||
* comparison can be needed. The cached support proc entries have
|
||||
* the right collation for the index, too.
|
||||
*/
|
||||
procinfo = index_getprocinfo(rel, i + 1, BTORDER_PROC);
|
||||
arg = index_getattr(itup, i + 1, itupdesc, &null);
|
||||
@@ -80,6 +81,7 @@ _bt_mkscankey(Relation rel, IndexTuple itup)
|
||||
(AttrNumber) (i + 1),
|
||||
InvalidStrategy,
|
||||
InvalidOid,
|
||||
procinfo->fn_collation,
|
||||
procinfo,
|
||||
arg);
|
||||
}
|
||||
@@ -118,7 +120,8 @@ _bt_mkscankey_nodata(Relation rel)
|
||||
|
||||
/*
|
||||
* We can use the cached (default) support procs since no cross-type
|
||||
* comparison can be needed.
|
||||
* comparison can be needed. The cached support proc entries have
|
||||
* the right collation for the index, too.
|
||||
*/
|
||||
procinfo = index_getprocinfo(rel, i + 1, BTORDER_PROC);
|
||||
flags = SK_ISNULL | (indoption[i] << SK_BT_INDOPTION_SHIFT);
|
||||
@@ -127,6 +130,7 @@ _bt_mkscankey_nodata(Relation rel)
|
||||
(AttrNumber) (i + 1),
|
||||
InvalidStrategy,
|
||||
InvalidOid,
|
||||
procinfo->fn_collation,
|
||||
procinfo,
|
||||
(Datum) 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user