mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-10 04:27:35 +08:00
Arrange that no database accesses are attempted during parser() --- this
took some rejiggering of typename and ACL parsing, as well as moving parse_analyze call out of parser(). Restructure postgres.c processing so that parse analysis and rewrite are skipped when in abort-transaction state. Only COMMIT and ABORT statements will be processed beyond the raw parser() phase. This addresses problem of parser failing with database access errors while in aborted state (see pghackers discussions around 7/28/00). Also fix some bugs with COMMIT/ABORT statements appearing in the middle of a single query input string. Function, operator, and aggregate arguments/results can now use full TypeName production, in particular foo[] for array types. DROP OPERATOR and COMMENT ON OPERATOR were broken for unary operators. Allow CREATE AGGREGATE to accept unquoted numeric constants for initcond.
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: defrem.h,v 1.20 2000/08/24 03:29:09 tgl Exp $
|
||||
* $Id: defrem.h,v 1.21 2000/10/07 00:58:20 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -48,7 +48,7 @@ extern void DefineType(char *name, List *parameters);
|
||||
/*
|
||||
* prototypes in remove.c
|
||||
*/
|
||||
extern void RemoveFunction(char *functionName, int nargs, List *argNameList);
|
||||
extern void RemoveFunction(char *functionName, List *argTypes);
|
||||
extern void RemoveOperator(char *operatorName,
|
||||
char *typeName1, char *typeName2);
|
||||
extern void RemoveType(char *typeName);
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: parsenodes.h,v 1.115 2000/10/05 19:11:36 tgl Exp $
|
||||
* $Id: parsenodes.h,v 1.116 2000/10/07 00:58:21 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -114,9 +114,8 @@ typedef struct AlterTableStmt
|
||||
typedef struct ChangeACLStmt
|
||||
{
|
||||
NodeTag type;
|
||||
struct AclItem *aclitem;
|
||||
unsigned modechg;
|
||||
List *relNames;
|
||||
char *aclString;
|
||||
} ChangeACLStmt;
|
||||
|
||||
/* ----------------------
|
||||
@ -488,10 +487,8 @@ typedef struct ProcedureStmt
|
||||
{
|
||||
NodeTag type;
|
||||
char *funcname; /* name of function to create */
|
||||
List *defArgs; /* list of definitions a list of strings
|
||||
* (as Value *) */
|
||||
Node *returnType; /* the return type (as a string or a
|
||||
* TypeName (ie.setof) */
|
||||
List *argTypes; /* list of argument types (TypeName nodes) */
|
||||
Node *returnType; /* the return type (a TypeName node) */
|
||||
List *withClause; /* a list of DefElem */
|
||||
List *as; /* definition of function body */
|
||||
char *language; /* C, SQL, etc */
|
||||
@ -505,7 +502,7 @@ typedef struct RemoveAggrStmt
|
||||
{
|
||||
NodeTag type;
|
||||
char *aggname; /* aggregate to drop */
|
||||
char *aggtype; /* for this type */
|
||||
Node *aggtype; /* TypeName for input datatype, or NULL */
|
||||
} RemoveAggrStmt;
|
||||
|
||||
/* ----------------------
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: analyze.h,v 1.11 2000/10/05 19:11:38 tgl Exp $
|
||||
* $Id: analyze.h,v 1.12 2000/10/07 00:58:21 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -15,6 +15,6 @@
|
||||
|
||||
#include "parser/parse_node.h"
|
||||
|
||||
extern List *parse_analyze(List *pl, ParseState *parentParseState);
|
||||
extern List *parse_analyze(Node *parseTree, ParseState *parentParseState);
|
||||
|
||||
#endif /* ANALYZE_H */
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: parse_expr.h,v 1.19 2000/06/15 03:32:55 momjian Exp $
|
||||
* $Id: parse_expr.h,v 1.20 2000/10/07 00:58:21 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -26,5 +26,6 @@ extern Oid exprType(Node *expr);
|
||||
extern int32 exprTypmod(Node *expr);
|
||||
extern bool exprIsLengthCoercion(Node *expr, int32 *coercedTypmod);
|
||||
extern void parse_expr_init(void);
|
||||
extern char *TypeNameToInternalName(TypeName *typename);
|
||||
|
||||
#endif /* PARSE_EXPR_H */
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: tcopprot.h,v 1.34 2000/09/06 14:15:28 petere Exp $
|
||||
* $Id: tcopprot.h,v 1.35 2000/10/07 00:58:23 tgl Exp $
|
||||
*
|
||||
* OLD COMMENTS
|
||||
* This file was created so that other c files could get the two
|
||||
@ -35,9 +35,9 @@ extern bool ShowPortNumber;
|
||||
extern List *pg_parse_and_rewrite(char *query_string,
|
||||
Oid *typev, int nargs);
|
||||
extern Plan *pg_plan_query(Query *querytree);
|
||||
extern void pg_exec_query_dest(char *query_string,
|
||||
CommandDest dest,
|
||||
MemoryContext parse_context);
|
||||
extern void pg_exec_query_string(char *query_string,
|
||||
CommandDest dest,
|
||||
MemoryContext parse_context);
|
||||
|
||||
#endif /* BOOTSTRAP_INCLUDE */
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: acl.h,v 1.28 2000/10/02 04:49:27 tgl Exp $
|
||||
* $Id: acl.h,v 1.29 2000/10/07 00:58:23 tgl Exp $
|
||||
*
|
||||
* NOTES
|
||||
* For backward-compatibility purposes we have to allow there
|
||||
@ -167,12 +167,15 @@ extern char *aclcheck_error_strings[];
|
||||
/*#define ACLDEBUG_TRACE*/
|
||||
|
||||
/*
|
||||
* routines used internally (parser, etc.)
|
||||
* routines used internally
|
||||
*/
|
||||
extern Acl *acldefault(char *relname, AclId ownerid);
|
||||
|
||||
extern Acl *aclinsert3(Acl *old_acl, AclItem *mod_aip, unsigned modechg);
|
||||
|
||||
/*
|
||||
* routines used by the parser
|
||||
*/
|
||||
extern char *aclmakepriv(char *old_privlist, char new_priv);
|
||||
extern char *aclmakeuser(char *user_type, char *user);
|
||||
extern ChangeACLStmt *makeAclStmt(char *privs, List *rel_list, char *grantee,
|
||||
@ -187,6 +190,7 @@ extern Datum aclitemout(PG_FUNCTION_ARGS);
|
||||
extern Datum aclinsert(PG_FUNCTION_ARGS);
|
||||
extern Datum aclremove(PG_FUNCTION_ARGS);
|
||||
extern Datum aclcontains(PG_FUNCTION_ARGS);
|
||||
extern void ExecuteChangeACLStmt(ChangeACLStmt *stmt);
|
||||
|
||||
/*
|
||||
* prototypes for functions in aclchk.c
|
||||
|
||||
Reference in New Issue
Block a user