Do honest transformation and preprocessing of LIMIT/OFFSET clauses,

instead of the former kluge whereby gram.y emitted already-transformed
expressions.  This is needed so that Params appearing in these clauses
actually work correctly.  I suppose some might claim that the side effect
of 'SELECT ... LIMIT 2+2' working is a new feature, but I say this is
a bug fix.
This commit is contained in:
Tom Lane
2003-07-03 19:07:54 +00:00
parent 455891bf96
commit b89140a7ec
8 changed files with 150 additions and 86 deletions

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: parse_clause.h,v 1.32 2003/06/16 02:03:38 tgl Exp $
* $Id: parse_clause.h,v 1.33 2003/07/03 19:07:53 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -21,7 +21,10 @@ extern int setTargetTable(ParseState *pstate, RangeVar *relation,
bool inh, bool alsoSource);
extern bool interpretInhOption(InhOption inhOpt);
extern Node *transformWhereClause(ParseState *pstate, Node *where);
extern Node *transformWhereClause(ParseState *pstate, Node *clause,
const char *constructName);
extern Node *transformLimitClause(ParseState *pstate, Node *clause,
const char *constructName);
extern List *transformGroupClause(ParseState *pstate, List *grouplist,
List *targetlist, List *sortClause);
extern List *transformSortClause(ParseState *pstate, List *orderlist,

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: parse_coerce.h,v 1.52 2003/07/01 19:10:53 tgl Exp $
* $Id: parse_coerce.h,v 1.53 2003/07/03 19:07:54 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -54,6 +54,8 @@ extern Node *coerce_to_domain(Node *arg, Oid baseTypeId, Oid typeId,
extern Node *coerce_to_boolean(ParseState *pstate, Node *node,
const char *constructName);
extern Node *coerce_to_integer(ParseState *pstate, Node *node,
const char *constructName);
extern Oid select_common_type(List *typeids, const char *context);
extern Node *coerce_to_common_type(ParseState *pstate, Node *node,