mirror of
https://github.com/postgres/postgres.git
synced 2025-11-06 07:49:08 +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:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: parsenodes.h,v 1.246 2003/08/08 21:42:48 momjian Exp $
|
||||
* $Id: parsenodes.h,v 1.247 2003/08/17 19:58:06 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -279,14 +279,19 @@ typedef struct ResTarget
|
||||
} ResTarget;
|
||||
|
||||
/*
|
||||
* SortGroupBy - for ORDER BY clause
|
||||
* SortBy - for ORDER BY clause
|
||||
*/
|
||||
typedef struct SortGroupBy
|
||||
#define SORTBY_ASC 1
|
||||
#define SORTBY_DESC 2
|
||||
#define SORTBY_USING 3
|
||||
|
||||
typedef struct SortBy
|
||||
{
|
||||
NodeTag type;
|
||||
List *useOp; /* operator to use */
|
||||
Node *node; /* Expression */
|
||||
} SortGroupBy;
|
||||
int sortby_kind; /* see codes above */
|
||||
List *useOp; /* name of op to use, if SORTBY_USING */
|
||||
Node *node; /* expression to sort on */
|
||||
} SortBy;
|
||||
|
||||
/*
|
||||
* RangeSubselect - subquery appearing in a FROM clause
|
||||
@@ -614,7 +619,7 @@ typedef struct SelectStmt
|
||||
* These fields are used in both "leaf" SelectStmts and upper-level
|
||||
* SelectStmts.
|
||||
*/
|
||||
List *sortClause; /* sort clause (a list of SortGroupBy's) */
|
||||
List *sortClause; /* sort clause (a list of SortBy's) */
|
||||
Node *limitOffset; /* # of result tuples to skip */
|
||||
Node *limitCount; /* # of result tuples to return */
|
||||
List *forUpdate; /* FOR UPDATE clause */
|
||||
|
||||
Reference in New Issue
Block a user