mirror of
https://github.com/postgres/postgres.git
synced 2025-06-29 10:41:53 +03:00
Create a 'type cache' that keeps track of the data needed for any particular
datatype by array_eq and array_cmp; use this to solve problems with memory leaks in array indexing support. The parser's equality_oper and ordering_oper routines also use the cache. Change the operator search algorithms to look for appropriate btree or hash index opclasses, instead of assuming operators named '<' or '=' have the right semantics. (ORDER BY ASC/DESC now also look at opclasses, instead of assuming '<' and '>' are the right things.) Add several more index opclasses so that there is no regression in functionality for base datatypes. initdb forced due to catalog additions.
This commit is contained in:
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.95 2003/08/14 14:19:07 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/acl.c,v 1.96 2003/08/17 19:58:05 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -480,6 +480,23 @@ aclitem_eq(PG_FUNCTION_ARGS)
|
||||
PG_RETURN_BOOL(result);
|
||||
}
|
||||
|
||||
/*
|
||||
* aclitem hash function
|
||||
*
|
||||
* We make aclitems hashable not so much because anyone is likely to hash
|
||||
* them, as because we want array equality to work on aclitem arrays, and
|
||||
* with the typcache mechanism we must have a hash or btree opclass.
|
||||
*/
|
||||
Datum
|
||||
hash_aclitem(PG_FUNCTION_ARGS)
|
||||
{
|
||||
AclItem *a = PG_GETARG_ACLITEM_P(0);
|
||||
|
||||
/* not very bright, but avoids any issue of padding in struct */
|
||||
PG_RETURN_UINT32((uint32) (a->ai_privs + a->ai_grantee + a->ai_grantor));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* acldefault() --- create an ACL describing default access permissions
|
||||
*
|
||||
|
Reference in New Issue
Block a user