mirror of
https://github.com/postgres/postgres.git
synced 2025-07-18 17:42:25 +03:00
Change elog(WARN) to elog(ERROR) and elog(ABORT).
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.60 1997/12/29 05:13:35 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/analyze.c,v 1.61 1998/01/05 03:32:12 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -478,7 +478,7 @@ printf("transformCreateStmt- found constraint(s) on column %s\n",column->colname
|
||||
printf("transformCreateStmt- found NOT NULL constraint on column %s\n",column->colname);
|
||||
#endif
|
||||
if (column->is_not_null)
|
||||
elog(WARN,"CREATE TABLE/NOT NULL already specified"
|
||||
elog(ERROR,"CREATE TABLE/NOT NULL already specified"
|
||||
" for %s.%s", stmt->relname, column->colname);
|
||||
column->is_not_null = TRUE;
|
||||
break;
|
||||
@ -488,7 +488,7 @@ printf("transformCreateStmt- found NOT NULL constraint on column %s\n",column->c
|
||||
printf("transformCreateStmt- found DEFAULT clause on column %s\n",column->colname);
|
||||
#endif
|
||||
if (column->defval != NULL)
|
||||
elog(WARN,"CREATE TABLE/DEFAULT multiple values specified"
|
||||
elog(ERROR,"CREATE TABLE/DEFAULT multiple values specified"
|
||||
" for %s.%s", stmt->relname, column->colname);
|
||||
column->defval = constraint->def;
|
||||
break;
|
||||
@ -525,7 +525,7 @@ printf("transformCreateStmt- found CHECK clause on column %s\n",column->colname)
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(WARN,"parser: internal error; unrecognized constraint",NULL);
|
||||
elog(ERROR,"parser: internal error; unrecognized constraint",NULL);
|
||||
break;
|
||||
}
|
||||
clist = lnext(clist);
|
||||
@ -569,16 +569,16 @@ printf("transformCreateStmt- found CHECK clause\n");
|
||||
|
||||
case CONSTR_NOTNULL:
|
||||
case CONSTR_DEFAULT:
|
||||
elog(WARN,"parser: internal error; illegal context for constraint",NULL);
|
||||
elog(ERROR,"parser: internal error; illegal context for constraint",NULL);
|
||||
break;
|
||||
default:
|
||||
elog(WARN,"parser: internal error; unrecognized constraint",NULL);
|
||||
elog(ERROR,"parser: internal error; unrecognized constraint",NULL);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(WARN,"parser: internal error; unrecognized node",NULL);
|
||||
elog(ERROR,"parser: internal error; unrecognized node",NULL);
|
||||
}
|
||||
|
||||
elements = lnext(elements);
|
||||
@ -601,7 +601,7 @@ printf("transformCreateStmt- found CHECK clause\n");
|
||||
{
|
||||
constraint = lfirst(dlist);
|
||||
if (nodeTag(constraint) != T_Constraint)
|
||||
elog(WARN,"parser: internal error; unrecognized deferred node",NULL);
|
||||
elog(ERROR,"parser: internal error; unrecognized deferred node",NULL);
|
||||
|
||||
#if PARSEDEBUG
|
||||
printf("transformCreateStmt- found deferred constraint %s\n",
|
||||
@ -610,12 +610,12 @@ printf("transformCreateStmt- found deferred constraint %s\n",
|
||||
|
||||
if (constraint->contype == CONSTR_PRIMARY)
|
||||
if (have_pkey)
|
||||
elog(WARN,"CREATE TABLE/PRIMARY KEY multiple primary keys"
|
||||
elog(ERROR,"CREATE TABLE/PRIMARY KEY multiple primary keys"
|
||||
" for table %s are not legal", stmt->relname);
|
||||
else
|
||||
have_pkey = TRUE;
|
||||
else if (constraint->contype != CONSTR_UNIQUE)
|
||||
elog(WARN,"parser: internal error; unrecognized deferred constraint",NULL);
|
||||
elog(ERROR,"parser: internal error; unrecognized deferred constraint",NULL);
|
||||
|
||||
#if PARSEDEBUG
|
||||
printf("transformCreateStmt- found deferred %s clause\n",
|
||||
@ -630,7 +630,7 @@ printf("transformCreateStmt- found deferred %s clause\n",
|
||||
else if (constraint->contype == CONSTR_PRIMARY)
|
||||
{
|
||||
if (have_pkey)
|
||||
elog(WARN,"CREATE TABLE/PRIMARY KEY multiple keys for table %s are not legal", stmt->relname);
|
||||
elog(ERROR,"CREATE TABLE/PRIMARY KEY multiple keys for table %s are not legal", stmt->relname);
|
||||
|
||||
have_pkey = TRUE;
|
||||
index->idxname = makeTableName(stmt->relname, "pkey", NULL);
|
||||
@ -664,7 +664,7 @@ printf("transformCreateStmt- check column %s for key match\n", column->colname);
|
||||
columns = lnext(columns);
|
||||
}
|
||||
if (column == NULL)
|
||||
elog(WARN,"parser: column '%s' in key does not exist",key->name);
|
||||
elog(ERROR,"parser: column '%s' in key does not exist",key->name);
|
||||
|
||||
if (constraint->contype == CONSTR_PRIMARY)
|
||||
{
|
||||
@ -687,7 +687,7 @@ printf("transformCreateStmt- mark column %s as NOT NULL\n", column->colname);
|
||||
}
|
||||
|
||||
if (index->idxname == NULL)
|
||||
elog(WARN,"parser: unable to construct implicit index for table %s"
|
||||
elog(ERROR,"parser: unable to construct implicit index for table %s"
|
||||
"; name too long", stmt->relname);
|
||||
else
|
||||
elog(NOTICE,"CREATE TABLE/%s will create implicit index %s for table %s",
|
||||
|
@ -10,7 +10,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.83 1998/01/04 04:31:08 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.84 1998/01/05 03:32:18 momjian Exp $
|
||||
*
|
||||
* HISTORY
|
||||
* AUTHOR DATE MAJOR EVENT
|
||||
@ -590,17 +590,17 @@ alter_clause: ADD opt_column columnDef
|
||||
Node *lp = lfirst($3);
|
||||
|
||||
if (length($3) != 1)
|
||||
elog(WARN,"ALTER TABLE/ADD() allows one column only",NULL);
|
||||
elog(ABORT,"ALTER TABLE/ADD() allows one column only",NULL);
|
||||
$$ = lp;
|
||||
}
|
||||
| DROP opt_column ColId
|
||||
{ elog(WARN,"ALTER TABLE/DROP COLUMN not yet implemented",NULL); }
|
||||
{ elog(ABORT,"ALTER TABLE/DROP COLUMN not yet implemented",NULL); }
|
||||
| ALTER opt_column ColId SET DEFAULT default_expr
|
||||
{ elog(WARN,"ALTER TABLE/ALTER COLUMN/SET DEFAULT not yet implemented",NULL); }
|
||||
{ elog(ABORT,"ALTER TABLE/ALTER COLUMN/SET DEFAULT not yet implemented",NULL); }
|
||||
| ALTER opt_column ColId DROP DEFAULT
|
||||
{ elog(WARN,"ALTER TABLE/ALTER COLUMN/DROP DEFAULT not yet implemented",NULL); }
|
||||
{ elog(ABORT,"ALTER TABLE/ALTER COLUMN/DROP DEFAULT not yet implemented",NULL); }
|
||||
| ADD ConstraintElem
|
||||
{ elog(WARN,"ALTER TABLE/ADD CONSTRAINT not yet implemented",NULL); }
|
||||
{ elog(ABORT,"ALTER TABLE/ADD CONSTRAINT not yet implemented",NULL); }
|
||||
;
|
||||
|
||||
|
||||
@ -811,11 +811,11 @@ default_expr: AexprConst
|
||||
| default_expr '*' default_expr
|
||||
{ $$ = nconc( $1, lcons( makeString( "*"), $3)); }
|
||||
| default_expr '=' default_expr
|
||||
{ elog(WARN,"boolean expressions not supported in DEFAULT",NULL); }
|
||||
{ elog(ABORT,"boolean expressions not supported in DEFAULT",NULL); }
|
||||
| default_expr '<' default_expr
|
||||
{ elog(WARN,"boolean expressions not supported in DEFAULT",NULL); }
|
||||
{ elog(ABORT,"boolean expressions not supported in DEFAULT",NULL); }
|
||||
| default_expr '>' default_expr
|
||||
{ elog(WARN,"boolean expressions not supported in DEFAULT",NULL); }
|
||||
{ elog(ABORT,"boolean expressions not supported in DEFAULT",NULL); }
|
||||
| ':' default_expr
|
||||
{ $$ = lcons( makeString( ":"), $2); }
|
||||
| ';' default_expr
|
||||
@ -848,7 +848,7 @@ default_expr: AexprConst
|
||||
| default_expr Op default_expr
|
||||
{
|
||||
if (!strcmp("<=", $2) || !strcmp(">=", $2))
|
||||
elog(WARN,"boolean expressions not supported in DEFAULT",NULL);
|
||||
elog(ABORT,"boolean expressions not supported in DEFAULT",NULL);
|
||||
$$ = nconc( $1, lcons( makeString( $2), $3));
|
||||
}
|
||||
| Op default_expr
|
||||
@ -1200,13 +1200,13 @@ TriggerOneEvent: INSERT { $$ = 'i'; }
|
||||
TriggerForSpec: FOR name name
|
||||
{
|
||||
if ( strcmp ($2, "each") != 0 )
|
||||
elog(WARN,"parser: syntax error near %s",$2);
|
||||
elog(ABORT,"parser: syntax error near %s",$2);
|
||||
if ( strcmp ($3, "row") == 0 )
|
||||
$$ = TRUE;
|
||||
else if ( strcmp ($3, "statement") == 0 )
|
||||
$$ = FALSE;
|
||||
else
|
||||
elog(WARN,"parser: syntax error near %s",$3);
|
||||
elog(ABORT,"parser: syntax error near %s",$3);
|
||||
}
|
||||
;
|
||||
|
||||
@ -1379,7 +1379,7 @@ opt_direction: FORWARD { $$ = FORWARD; }
|
||||
|
||||
fetch_how_many: Iconst
|
||||
{ $$ = $1;
|
||||
if ($1 <= 0) elog(WARN,"Please specify nonnegative count for fetch",NULL); }
|
||||
if ($1 <= 0) elog(ABORT,"Please specify nonnegative count for fetch",NULL); }
|
||||
| ALL { $$ = 0; /* 0 means fetch all tuples*/ }
|
||||
| /*EMPTY*/ { $$ = 1; /*default*/ }
|
||||
;
|
||||
@ -1597,7 +1597,7 @@ RecipeStmt: EXECUTE RECIPE recipe_name
|
||||
{
|
||||
RecipeStmt *n;
|
||||
if (!IsTransactionBlock())
|
||||
elog(WARN,"EXECUTE RECIPE may only be used in begin/end transaction blocks",NULL);
|
||||
elog(ABORT,"EXECUTE RECIPE may only be used in begin/end transaction blocks",NULL);
|
||||
|
||||
n = makeNode(RecipeStmt);
|
||||
n->recipeName = $3;
|
||||
@ -1725,7 +1725,7 @@ MathOp: '+' { $$ = "+"; }
|
||||
|
||||
oper_argtypes: name
|
||||
{
|
||||
elog(WARN,"parser: argument type missing (use NONE for unary operators)",NULL);
|
||||
elog(ABORT,"parser: argument type missing (use NONE for unary operators)",NULL);
|
||||
}
|
||||
| name ',' name
|
||||
{ $$ = makeList(makeString($1), makeString($3), -1); }
|
||||
@ -2063,7 +2063,7 @@ VacuumStmt: VACUUM opt_verbose opt_analyze
|
||||
n->vacrel = $4;
|
||||
n->va_spec = $5;
|
||||
if ( $5 != NIL && !$4 )
|
||||
elog(WARN,"parser: syntax error at or near \"(\"",NULL);
|
||||
elog(ABORT,"parser: syntax error at or near \"(\"",NULL);
|
||||
$$ = (Node *)n;
|
||||
}
|
||||
;
|
||||
@ -2240,7 +2240,7 @@ CursorStmt: DECLARE name opt_binary CURSOR FOR
|
||||
* -- mao
|
||||
*/
|
||||
if (!IsTransactionBlock())
|
||||
elog(WARN,"Named portals may only be used in begin/end transaction blocks",NULL);
|
||||
elog(ABORT,"Named portals may only be used in begin/end transaction blocks",NULL);
|
||||
|
||||
n->portalname = $2;
|
||||
n->binary = $3;
|
||||
@ -2444,7 +2444,7 @@ having_clause: HAVING a_expr { $$ = $2; }
|
||||
from_clause: FROM '(' relation_expr join_expr JOIN relation_expr join_spec ')'
|
||||
{
|
||||
$$ = NIL;
|
||||
elog(WARN,"JOIN not yet implemented",NULL);
|
||||
elog(ABORT,"JOIN not yet implemented",NULL);
|
||||
}
|
||||
| FROM from_list { $$ = $2; }
|
||||
| /*EMPTY*/ { $$ = NIL; }
|
||||
@ -2453,7 +2453,7 @@ from_clause: FROM '(' relation_expr join_expr JOIN relation_expr join_spec ')'
|
||||
from_list: from_list ',' from_val
|
||||
{ $$ = lappend($1, $3); }
|
||||
| from_val CROSS JOIN from_val
|
||||
{ elog(WARN,"CROSS JOIN not yet implemented",NULL); }
|
||||
{ elog(ABORT,"CROSS JOIN not yet implemented",NULL); }
|
||||
| from_val
|
||||
{ $$ = lcons($1, NIL); }
|
||||
;
|
||||
@ -2480,19 +2480,19 @@ from_val: relation_expr AS ColLabel
|
||||
|
||||
join_expr: NATURAL join_expr { $$ = NULL; }
|
||||
| FULL join_outer
|
||||
{ elog(WARN,"FULL OUTER JOIN not yet implemented",NULL); }
|
||||
{ elog(ABORT,"FULL OUTER JOIN not yet implemented",NULL); }
|
||||
| LEFT join_outer
|
||||
{ elog(WARN,"LEFT OUTER JOIN not yet implemented",NULL); }
|
||||
{ elog(ABORT,"LEFT OUTER JOIN not yet implemented",NULL); }
|
||||
| RIGHT join_outer
|
||||
{ elog(WARN,"RIGHT OUTER JOIN not yet implemented",NULL); }
|
||||
{ elog(ABORT,"RIGHT OUTER JOIN not yet implemented",NULL); }
|
||||
| OUTER_P
|
||||
{ elog(WARN,"OUTER JOIN not yet implemented",NULL); }
|
||||
{ elog(ABORT,"OUTER JOIN not yet implemented",NULL); }
|
||||
| INNER_P
|
||||
{ elog(WARN,"INNER JOIN not yet implemented",NULL); }
|
||||
{ elog(ABORT,"INNER JOIN not yet implemented",NULL); }
|
||||
| UNION
|
||||
{ elog(WARN,"UNION JOIN not yet implemented",NULL); }
|
||||
{ elog(ABORT,"UNION JOIN not yet implemented",NULL); }
|
||||
| /*EMPTY*/
|
||||
{ elog(WARN,"INNER JOIN not yet implemented",NULL); }
|
||||
{ elog(ABORT,"INNER JOIN not yet implemented",NULL); }
|
||||
;
|
||||
|
||||
join_outer: OUTER_P { $$ = NULL; }
|
||||
@ -2653,13 +2653,13 @@ Numeric: FLOAT opt_float
|
||||
opt_float: '(' Iconst ')'
|
||||
{
|
||||
if ($2 < 1)
|
||||
elog(WARN,"precision for FLOAT must be at least 1",NULL);
|
||||
elog(ABORT,"precision for FLOAT must be at least 1",NULL);
|
||||
else if ($2 < 7)
|
||||
$$ = xlateSqlType("float4");
|
||||
else if ($2 < 16)
|
||||
$$ = xlateSqlType("float8");
|
||||
else
|
||||
elog(WARN,"precision for FLOAT must be less than 16",NULL);
|
||||
elog(ABORT,"precision for FLOAT must be less than 16",NULL);
|
||||
}
|
||||
| /*EMPTY*/
|
||||
{
|
||||
@ -2670,14 +2670,14 @@ opt_float: '(' Iconst ')'
|
||||
opt_numeric: '(' Iconst ',' Iconst ')'
|
||||
{
|
||||
if ($2 != 9)
|
||||
elog(WARN,"NUMERIC precision %d must be 9",$2);
|
||||
elog(ABORT,"NUMERIC precision %d must be 9",$2);
|
||||
if ($4 != 0)
|
||||
elog(WARN,"NUMERIC scale %d must be zero",$4);
|
||||
elog(ABORT,"NUMERIC scale %d must be zero",$4);
|
||||
}
|
||||
| '(' Iconst ')'
|
||||
{
|
||||
if ($2 != 9)
|
||||
elog(WARN,"NUMERIC precision %d must be 9",$2);
|
||||
elog(ABORT,"NUMERIC precision %d must be 9",$2);
|
||||
}
|
||||
| /*EMPTY*/
|
||||
{
|
||||
@ -2688,15 +2688,15 @@ opt_numeric: '(' Iconst ',' Iconst ')'
|
||||
opt_decimal: '(' Iconst ',' Iconst ')'
|
||||
{
|
||||
if ($2 > 9)
|
||||
elog(WARN,"DECIMAL precision %d exceeds implementation limit of 9",$2);
|
||||
elog(ABORT,"DECIMAL precision %d exceeds implementation limit of 9",$2);
|
||||
if ($4 != 0)
|
||||
elog(WARN,"DECIMAL scale %d must be zero",$4);
|
||||
elog(ABORT,"DECIMAL scale %d must be zero",$4);
|
||||
$$ = NULL;
|
||||
}
|
||||
| '(' Iconst ')'
|
||||
{
|
||||
if ($2 > 9)
|
||||
elog(WARN,"DECIMAL precision %d exceeds implementation limit of 9",$2);
|
||||
elog(ABORT,"DECIMAL precision %d exceeds implementation limit of 9",$2);
|
||||
$$ = NULL;
|
||||
}
|
||||
| /*EMPTY*/
|
||||
@ -2722,14 +2722,14 @@ Character: character '(' Iconst ')'
|
||||
else
|
||||
yyerror("parse error");
|
||||
if ($3 < 1)
|
||||
elog(WARN,"length for '%s' type must be at least 1",$1);
|
||||
elog(ABORT,"length for '%s' type must be at least 1",$1);
|
||||
else if ($3 > 4096)
|
||||
/* we can store a char() of length up to the size
|
||||
* of a page (8KB) - page headers and friends but
|
||||
* just to be safe here... - ay 6/95
|
||||
* XXX note this hardcoded limit - thomas 1997-07-13
|
||||
*/
|
||||
elog(WARN,"length for type '%s' cannot exceed 4096",$1);
|
||||
elog(ABORT,"length for type '%s' cannot exceed 4096",$1);
|
||||
|
||||
/* we actually implement this sort of like a varlen, so
|
||||
* the first 4 bytes is the length. (the difference
|
||||
@ -2762,7 +2762,7 @@ character: CHARACTER opt_varying opt_charset opt_collate
|
||||
}
|
||||
};
|
||||
if ($4 != NULL)
|
||||
elog(WARN,"COLLATE %s not yet implemented",$4);
|
||||
elog(ABORT,"COLLATE %s not yet implemented",$4);
|
||||
$$ = type;
|
||||
}
|
||||
| CHAR opt_varying { $$ = xlateSqlType($2? "varchar": "char"); }
|
||||
@ -3098,7 +3098,7 @@ a_expr: attr opt_indirection
|
||||
*/
|
||||
| EXISTS '(' SubSelect ')'
|
||||
{
|
||||
elog(WARN,"EXISTS not yet implemented",NULL);
|
||||
elog(ABORT,"EXISTS not yet implemented",NULL);
|
||||
$$ = $3;
|
||||
}
|
||||
| EXTRACT '(' extract_list ')'
|
||||
@ -3428,7 +3428,7 @@ trim_list: a_expr FROM expr_list
|
||||
|
||||
in_expr: SubSelect
|
||||
{
|
||||
elog(WARN,"IN (SUBSELECT) not yet implemented",NULL);
|
||||
elog(ABORT,"IN (SUBSELECT) not yet implemented",NULL);
|
||||
$$ = $1;
|
||||
}
|
||||
| in_expr_nodes
|
||||
@ -3445,7 +3445,7 @@ in_expr_nodes: AexprConst
|
||||
|
||||
not_in_expr: SubSelect
|
||||
{
|
||||
elog(WARN,"NOT IN (SUBSELECT) not yet implemented",NULL);
|
||||
elog(ABORT,"NOT IN (SUBSELECT) not yet implemented",NULL);
|
||||
$$ = $1;
|
||||
}
|
||||
| not_in_expr_nodes
|
||||
@ -3606,7 +3606,7 @@ relation_name: SpecialRuleRelation
|
||||
/* disallow refs to variable system tables */
|
||||
if (strcmp(LogRelationName, $1) == 0
|
||||
|| strcmp(VariableRelationName, $1) == 0)
|
||||
elog(WARN,"%s cannot be accessed by users",$1);
|
||||
elog(ABORT,"%s cannot be accessed by users",$1);
|
||||
else
|
||||
$$ = $1;
|
||||
StrNCpy(saved_relname, $1, NAMEDATALEN);
|
||||
@ -3765,14 +3765,14 @@ SpecialRuleRelation: CURRENT
|
||||
if (QueryIsRule)
|
||||
$$ = "*CURRENT*";
|
||||
else
|
||||
elog(WARN,"CURRENT used in non-rule query",NULL);
|
||||
elog(ABORT,"CURRENT used in non-rule query",NULL);
|
||||
}
|
||||
| NEW
|
||||
{
|
||||
if (QueryIsRule)
|
||||
$$ = "*NEW*";
|
||||
else
|
||||
elog(WARN,"NEW used in non-rule query",NULL);
|
||||
elog(ABORT,"NEW used in non-rule query",NULL);
|
||||
}
|
||||
;
|
||||
|
||||
@ -3800,7 +3800,7 @@ makeRowExpr(char *opr, List *largs, List *rargs)
|
||||
Node *larg, *rarg;
|
||||
|
||||
if (length(largs) != length(rargs))
|
||||
elog(WARN,"Unequal number of entries in row expression",NULL);
|
||||
elog(ABORT,"Unequal number of entries in row expression",NULL);
|
||||
|
||||
if (lnext(largs) != NIL)
|
||||
expr = makeRowExpr(opr,lnext(largs),lnext(rargs));
|
||||
@ -3828,7 +3828,7 @@ makeRowExpr(char *opr, List *largs, List *rargs)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(WARN,"Operator '%s' not implemented for row expressions",opr);
|
||||
elog(ABORT,"Operator '%s' not implemented for row expressions",opr);
|
||||
}
|
||||
|
||||
#if FALSE
|
||||
@ -3858,7 +3858,7 @@ mapTargetColumns(List *src, List *dst)
|
||||
ResTarget *d;
|
||||
|
||||
if (length(src) != length(dst))
|
||||
elog(WARN,"CREATE TABLE/AS SELECT has mismatched column count",NULL);
|
||||
elog(ABORT,"CREATE TABLE/AS SELECT has mismatched column count",NULL);
|
||||
|
||||
while ((src != NIL) && (dst != NIL))
|
||||
{
|
||||
@ -4069,7 +4069,7 @@ makeConstantList( A_Const *n)
|
||||
{
|
||||
char *defval = NULL;
|
||||
if (nodeTag(n) != T_A_Const) {
|
||||
elog(WARN,"Cannot handle non-constant parameter",NULL);
|
||||
elog(ABORT,"Cannot handle non-constant parameter",NULL);
|
||||
|
||||
} else if (n->val.type == T_Float) {
|
||||
defval = (char*) palloc(20+1);
|
||||
@ -4086,7 +4086,7 @@ makeConstantList( A_Const *n)
|
||||
strcat( defval, "'");
|
||||
|
||||
} else {
|
||||
elog(WARN,"Internal error in makeConstantList(): cannot encode node",NULL);
|
||||
elog(ABORT,"Internal error in makeConstantList(): cannot encode node",NULL);
|
||||
};
|
||||
|
||||
#ifdef PARSEDEBUG
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.28 1997/12/16 05:04:00 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.29 1998/01/05 03:32:22 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -248,7 +248,7 @@ AtomValueGetString(int atomval)
|
||||
if (ScanKeywords[i].value == atomval)
|
||||
return (ScanKeywords[i].name);
|
||||
|
||||
elog(WARN, "AtomGetString called with bogus atom # : %d", atomval);
|
||||
elog(ERROR, "AtomGetString called with bogus atom # : %d", atomval);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_agg.c,v 1.5 1998/01/04 04:31:14 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_agg.c,v 1.6 1998/01/05 03:32:25 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -208,7 +208,7 @@ tleIsAggOrGroupCol(TargetEntry *tle, List *groupClause)
|
||||
if (tle->resdom->resno == grpcl->entry->resdom->resno)
|
||||
{
|
||||
if (contain_agg_clause((Node *) expr))
|
||||
elog(WARN, "parser: aggregates not allowed in GROUP BY clause");
|
||||
elog(ERROR, "parser: aggregates not allowed in GROUP BY clause");
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@ -248,7 +248,7 @@ parseCheckAggregates(ParseState *pstate, Query *qry)
|
||||
* non-group column in target list may fail.)
|
||||
*/
|
||||
if (contain_agg_clause(qry->qual))
|
||||
elog(WARN, "parser: aggregates not allowed in WHERE clause");
|
||||
elog(ERROR, "parser: aggregates not allowed in WHERE clause");
|
||||
|
||||
/*
|
||||
* the target list can only contain aggregates, group columns and
|
||||
@ -259,7 +259,7 @@ parseCheckAggregates(ParseState *pstate, Query *qry)
|
||||
TargetEntry *tle = lfirst(tl);
|
||||
|
||||
if (!tleIsAggOrGroupCol(tle, qry->groupClause))
|
||||
elog(WARN,
|
||||
elog(ERROR,
|
||||
"parser: illegal use of aggregates or non-group column in target list");
|
||||
}
|
||||
|
||||
@ -271,7 +271,7 @@ parseCheckAggregates(ParseState *pstate, Query *qry)
|
||||
* Need to change here when we get HAVING works. Currently
|
||||
* qry->havingQual is NULL. - vadim 04/05/97
|
||||
if (!exprIsAggOrGroupCol(qry->havingQual, qry->groupClause))
|
||||
elog(WARN,
|
||||
elog(ERROR,
|
||||
"parser: illegal use of aggregates or non-group column in HAVING clause");
|
||||
*/
|
||||
return;
|
||||
@ -295,7 +295,7 @@ ParseAgg(ParseState *pstate, char *aggname, Oid basetype,
|
||||
0, 0);
|
||||
if (!HeapTupleIsValid(theAggTuple))
|
||||
{
|
||||
elog(WARN, "aggregate %s does not exist", aggname);
|
||||
elog(ERROR, "aggregate %s does not exist", aggname);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -346,7 +346,7 @@ ParseAgg(ParseState *pstate, char *aggname, Oid basetype,
|
||||
break;
|
||||
}
|
||||
if (first_valid_rte == NULL)
|
||||
elog(WARN, "Can't find column to do aggregate(*) on.");
|
||||
elog(ERROR, "Can't find column to do aggregate(*) on.");
|
||||
|
||||
attr->relname = first_valid_rte->refname;
|
||||
attr->attrs = lcons(makeString(
|
||||
@ -379,7 +379,7 @@ ParseAgg(ParseState *pstate, char *aggname, Oid basetype,
|
||||
tp1 = typeidType(basetype);
|
||||
tp2 = typeidType(vartype);
|
||||
elog(NOTICE, "Aggregate type mismatch:");
|
||||
elog(WARN, "%s works on %s, not %s", aggname,
|
||||
elog(ERROR, "%s works on %s, not %s", aggname,
|
||||
typeTypeName(tp1), typeTypeName(tp2));
|
||||
}
|
||||
}
|
||||
@ -411,11 +411,11 @@ agg_error(char *caller, char *aggname, Oid basetypeID)
|
||||
|
||||
if (basetypeID == InvalidOid)
|
||||
{
|
||||
elog(WARN, "%s: aggregate '%s' for all types does not exist", caller, aggname);
|
||||
elog(ERROR, "%s: aggregate '%s' for all types does not exist", caller, aggname);
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(WARN, "%s: aggregate '%s' for '%s' does not exist", caller, aggname,
|
||||
elog(ERROR, "%s: aggregate '%s' for '%s' does not exist", caller, aggname,
|
||||
typeidTypeName(basetypeID));
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.6 1997/12/29 04:31:31 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.7 1998/01/05 03:32:26 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -75,7 +75,7 @@ transformWhereClause(ParseState *pstate, Node *a_expr)
|
||||
pstate->p_in_where_clause = false;
|
||||
if (exprType(qual) != BOOLOID)
|
||||
{
|
||||
elog(WARN,
|
||||
elog(ERROR,
|
||||
"where clause must return type bool, not %s",
|
||||
typeidTypeName(exprType(qual)));
|
||||
}
|
||||
@ -170,7 +170,7 @@ find_targetlist_entry(ParseState *pstate, SortGroupBy *sortgroupby, List *tlist)
|
||||
if (real_rtable_pos == test_rtable_pos)
|
||||
{
|
||||
if (target_result != NULL)
|
||||
elog(WARN, "Order/Group By '%s' is ambiguous", sortgroupby->name);
|
||||
elog(ERROR, "Order/Group By '%s' is ambiguous", sortgroupby->name);
|
||||
else
|
||||
target_result = target;
|
||||
}
|
||||
@ -178,7 +178,7 @@ find_targetlist_entry(ParseState *pstate, SortGroupBy *sortgroupby, List *tlist)
|
||||
else
|
||||
{
|
||||
if (target_result != NULL)
|
||||
elog(WARN, "Order/Group By '%s' is ambiguous", sortgroupby->name);
|
||||
elog(ERROR, "Order/Group By '%s' is ambiguous", sortgroupby->name);
|
||||
else
|
||||
target_result = target;
|
||||
}
|
||||
@ -208,7 +208,7 @@ transformGroupClause(ParseState *pstate, List *grouplist, List *targetlist)
|
||||
restarget = find_targetlist_entry(pstate, lfirst(grouplist), targetlist);
|
||||
|
||||
if (restarget == NULL)
|
||||
elog(WARN, "The field being grouped by must appear in the target list");
|
||||
elog(ERROR, "The field being grouped by must appear in the target list");
|
||||
|
||||
grpcl->entry = restarget;
|
||||
resdom = restarget->resdom;
|
||||
@ -267,7 +267,7 @@ transformSortClause(ParseState *pstate,
|
||||
|
||||
restarget = find_targetlist_entry(pstate, sortby, targetlist);
|
||||
if (restarget == NULL)
|
||||
elog(WARN, "The field being ordered by must appear in the target list");
|
||||
elog(ERROR, "The field being ordered by must appear in the target list");
|
||||
|
||||
sortcl->resdom = resdom = restarget->resdom;
|
||||
sortcl->opoid = oprid(oper(sortby->useOp,
|
||||
@ -349,7 +349,7 @@ transformSortClause(ParseState *pstate,
|
||||
}
|
||||
if (i == NIL)
|
||||
{
|
||||
elog(WARN, "The field specified in the UNIQUE ON clause is not in the targetlist");
|
||||
elog(ERROR, "The field specified in the UNIQUE ON clause is not in the targetlist");
|
||||
}
|
||||
s = sortlist;
|
||||
foreach(s, sortlist)
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.5 1998/01/04 04:53:50 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.6 1998/01/05 03:32:27 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -69,12 +69,12 @@ transformExpr(ParseState *pstate, Node *expr, int precedence)
|
||||
|
||||
uexpr = transformExpr(pstate, ai->uidx, precedence); /* must exists */
|
||||
if (exprType(uexpr) != INT4OID)
|
||||
elog(WARN, "array index expressions must be int4's");
|
||||
elog(ERROR, "array index expressions must be int4's");
|
||||
if (ai->lidx != NULL)
|
||||
{
|
||||
lexpr = transformExpr(pstate, ai->lidx, precedence);
|
||||
if (exprType(lexpr) != INT4OID)
|
||||
elog(WARN, "array index expressions must be int4's");
|
||||
elog(ERROR, "array index expressions must be int4's");
|
||||
}
|
||||
#if 0
|
||||
pfree(ai->uidx);
|
||||
@ -125,7 +125,7 @@ transformExpr(ParseState *pstate, Node *expr, int precedence)
|
||||
toid = param_type(paramno);
|
||||
if (!OidIsValid(toid))
|
||||
{
|
||||
elog(WARN, "Parameter '$%d' is out of range", paramno);
|
||||
elog(ERROR, "Parameter '$%d' is out of range", paramno);
|
||||
}
|
||||
param = makeNode(Param);
|
||||
param->paramkind = PARAM_NUM;
|
||||
@ -178,11 +178,11 @@ transformExpr(ParseState *pstate, Node *expr, int precedence)
|
||||
Node *rexpr = transformExpr(pstate, a->rexpr, precedence);
|
||||
|
||||
if (exprType(lexpr) != BOOLOID)
|
||||
elog(WARN, "left-hand side of AND is type '%s', not bool",
|
||||
elog(ERROR, "left-hand side of AND is type '%s', not bool",
|
||||
typeidTypeName(exprType(lexpr)));
|
||||
|
||||
if (exprType(rexpr) != BOOLOID)
|
||||
elog(WARN, "right-hand side of AND is type '%s', not bool",
|
||||
elog(ERROR, "right-hand side of AND is type '%s', not bool",
|
||||
typeidTypeName(exprType(rexpr)));
|
||||
|
||||
expr->typeOid = BOOLOID;
|
||||
@ -198,10 +198,10 @@ transformExpr(ParseState *pstate, Node *expr, int precedence)
|
||||
Node *rexpr = transformExpr(pstate, a->rexpr, precedence);
|
||||
|
||||
if (exprType(lexpr) != BOOLOID)
|
||||
elog(WARN, "left-hand side of OR is type '%s', not bool",
|
||||
elog(ERROR, "left-hand side of OR is type '%s', not bool",
|
||||
typeidTypeName(exprType(lexpr)));
|
||||
if (exprType(rexpr) != BOOLOID)
|
||||
elog(WARN, "right-hand side of OR is type '%s', not bool",
|
||||
elog(ERROR, "right-hand side of OR is type '%s', not bool",
|
||||
typeidTypeName(exprType(rexpr)));
|
||||
expr->typeOid = BOOLOID;
|
||||
expr->opType = OR_EXPR;
|
||||
@ -215,7 +215,7 @@ transformExpr(ParseState *pstate, Node *expr, int precedence)
|
||||
Node *rexpr = transformExpr(pstate, a->rexpr, precedence);
|
||||
|
||||
if (exprType(rexpr) != BOOLOID)
|
||||
elog(WARN, "argument to NOT is type '%s', not bool",
|
||||
elog(ERROR, "argument to NOT is type '%s', not bool",
|
||||
typeidTypeName(exprType(rexpr)));
|
||||
expr->typeOid = BOOLOID;
|
||||
expr->opType = NOT_EXPR;
|
||||
@ -251,7 +251,7 @@ transformExpr(ParseState *pstate, Node *expr, int precedence)
|
||||
}
|
||||
default:
|
||||
/* should not reach here */
|
||||
elog(WARN, "transformExpr: does not know how to transform node %d",
|
||||
elog(ERROR, "transformExpr: does not know how to transform node %d",
|
||||
nodeTag(expr));
|
||||
break;
|
||||
}
|
||||
@ -305,7 +305,7 @@ transformIdent(ParseState *pstate, Node *expr, int precedence)
|
||||
}
|
||||
|
||||
if (result == NULL)
|
||||
elog(WARN, "attribute '%s' not found", ident->name);
|
||||
elog(ERROR, "attribute '%s' not found", ident->name);
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -350,7 +350,7 @@ exprType(Node *expr)
|
||||
type = UNKNOWNOID;
|
||||
break;
|
||||
default:
|
||||
elog(WARN, "exprType: don't know how to get type for %d node",
|
||||
elog(ERROR, "exprType: don't know how to get type for %d node",
|
||||
nodeTag(expr));
|
||||
break;
|
||||
}
|
||||
@ -426,7 +426,7 @@ parser_typecast(Value *expr, TypeName *typename, int typlen)
|
||||
sprintf(const_string, "%ld", expr->val.ival);
|
||||
break;
|
||||
default:
|
||||
elog(WARN,
|
||||
elog(ERROR,
|
||||
"parser_typecast: cannot cast this expression to type '%s'",
|
||||
typename->name);
|
||||
}
|
||||
@ -488,7 +488,7 @@ parser_typecast(Value *expr, TypeName *typename, int typlen)
|
||||
break;
|
||||
|
||||
default:
|
||||
elog(WARN, "unknown type %d", CInteger(lfirst(expr)));
|
||||
elog(ERROR, "unknown type %d", CInteger(lfirst(expr)));
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -612,7 +612,7 @@ parser_typecast2(Node *expr, Oid exprType, Type tp, int typlen)
|
||||
const_string = (char *) textout((struct varlena *) const_string);
|
||||
break;
|
||||
default:
|
||||
elog(WARN, "unknown type %u", exprType);
|
||||
elog(ERROR, "unknown type %u", exprType);
|
||||
}
|
||||
|
||||
if (!exprType)
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.4 1998/01/04 04:31:18 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.5 1998/01/05 03:32:28 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -114,7 +114,7 @@ ParseFunc(ParseState *pstate, char *funcname, List *fargs,
|
||||
{
|
||||
first_arg = lfirst(fargs);
|
||||
if (first_arg == NULL)
|
||||
elog(WARN, "function '%s' does not allow NULL input", funcname);
|
||||
elog(ERROR, "function '%s' does not allow NULL input", funcname);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -184,7 +184,7 @@ ParseFunc(ParseState *pstate, char *funcname, List *fargs,
|
||||
heap_close(rd);
|
||||
}
|
||||
else
|
||||
elog(WARN,
|
||||
elog(ERROR,
|
||||
"Type '%s' is not a relation type",
|
||||
typeidTypeName(toid));
|
||||
argrelid = typeidTypeRelid(toid);
|
||||
@ -195,7 +195,7 @@ ParseFunc(ParseState *pstate, char *funcname, List *fargs,
|
||||
*/
|
||||
if ((get_attnum(argrelid, funcname) == InvalidAttrNumber)
|
||||
&& strcmp(funcname, "*"))
|
||||
elog(WARN, "Functions on sets are not yet supported");
|
||||
elog(ERROR, "Functions on sets are not yet supported");
|
||||
}
|
||||
|
||||
if (retval)
|
||||
@ -286,7 +286,7 @@ ParseFunc(ParseState *pstate, char *funcname, List *fargs,
|
||||
if (exprType(pair) == UNKNOWNOID &&
|
||||
!IsA(pair, Const))
|
||||
{
|
||||
elog(WARN, "ParseFunc: no function named '%s' that takes in an unknown type as argument #%d", funcname, nargs);
|
||||
elog(ERROR, "ParseFunc: no function named '%s' that takes in an unknown type as argument #%d", funcname, nargs);
|
||||
}
|
||||
else
|
||||
toid = exprType(pair);
|
||||
@ -329,7 +329,7 @@ ParseFunc(ParseState *pstate, char *funcname, List *fargs,
|
||||
}
|
||||
|
||||
if (!exists)
|
||||
elog(WARN, "no such attribute or function '%s'", funcname);
|
||||
elog(ERROR, "no such attribute or function '%s'", funcname);
|
||||
|
||||
/* got it */
|
||||
funcnode = makeNode(Func);
|
||||
@ -387,7 +387,7 @@ ParseFunc(ParseState *pstate, char *funcname, List *fargs,
|
||||
Assert(length(fargs) == 1);
|
||||
seq = (Const *) lfirst(fargs);
|
||||
if (!IsA((Node *) seq, Const))
|
||||
elog(WARN, "%s: only constant sequence names are acceptable", funcname);
|
||||
elog(ERROR, "%s: only constant sequence names are acceptable", funcname);
|
||||
seqname = lower ((text*)DatumGetPointer(seq->constvalue));
|
||||
pfree (DatumGetPointer(seq->constvalue));
|
||||
seq->constvalue = PointerGetDatum (seqname);
|
||||
@ -396,13 +396,13 @@ ParseFunc(ParseState *pstate, char *funcname, List *fargs,
|
||||
if ((aclcheck_result = pg_aclcheck(seqrel, GetPgUserName(),
|
||||
((funcid == SeqNextValueRegProcedure) ? ACL_WR : ACL_RD)))
|
||||
!= ACLCHECK_OK)
|
||||
elog(WARN, "%s.%s: %s",
|
||||
elog(ERROR, "%s.%s: %s",
|
||||
seqrel, funcname, aclcheck_error_strings[aclcheck_result]);
|
||||
|
||||
pfree(seqrel);
|
||||
|
||||
if (funcid == SeqNextValueRegProcedure && pstate->p_in_where_clause)
|
||||
elog(WARN, "nextval of a sequence in WHERE disallowed");
|
||||
elog(ERROR, "nextval of a sequence in WHERE disallowed");
|
||||
}
|
||||
|
||||
expr = makeNode(Expr);
|
||||
@ -441,7 +441,7 @@ funcid_get_rettype(Oid funcid)
|
||||
0, 0, 0);
|
||||
|
||||
if (!HeapTupleIsValid(func_tuple))
|
||||
elog(WARN, "function %d does not exist", funcid);
|
||||
elog(ERROR, "function %d does not exist", funcid);
|
||||
|
||||
funcrettype = (Oid)
|
||||
((Form_pg_proc) GETSTRUCT(func_tuple))->prorettype;
|
||||
@ -721,7 +721,7 @@ func_get_detail(char *funcname,
|
||||
{
|
||||
tp = typeidType(oid_array[0]);
|
||||
if (typeTypeFlag(tp) == 'c')
|
||||
elog(WARN, "no such attribute or function \"%s\"",
|
||||
elog(ERROR, "no such attribute or function \"%s\"",
|
||||
funcname);
|
||||
}
|
||||
func_error("func_get_detail", funcname, nargs, oid_array);
|
||||
@ -883,7 +883,7 @@ static int find_inheritors(Oid relid, Oid **supervec)
|
||||
|
||||
/* save the type id, rather than the relation id */
|
||||
if ((rd = heap_open(qentry->sqe_relid)) == (Relation) NULL)
|
||||
elog(WARN, "relid %d does not exist", qentry->sqe_relid);
|
||||
elog(ERROR, "relid %d does not exist", qentry->sqe_relid);
|
||||
qentry->sqe_relid = typeTypeId(typenameType(RelationGetRelationName(rd)->data));
|
||||
heap_close(rd);
|
||||
|
||||
@ -1029,7 +1029,7 @@ setup_tlist(char *attname, Oid relid)
|
||||
|
||||
attno = get_attnum(relid, attname);
|
||||
if (attno < 0)
|
||||
elog(WARN, "cannot reference attribute '%s' of tuple params/return values for functions", attname);
|
||||
elog(ERROR, "cannot reference attribute '%s' of tuple params/return values for functions", attname);
|
||||
|
||||
typeid = get_atttype(relid, attno);
|
||||
resnode = makeResdom(1,
|
||||
@ -1130,7 +1130,7 @@ ParseComplexProjection(ParseState *pstate,
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(WARN,
|
||||
elog(ERROR,
|
||||
"Function '%s' has bad returntype %d",
|
||||
funcname, argtype);
|
||||
}
|
||||
@ -1200,7 +1200,7 @@ ParseComplexProjection(ParseState *pstate,
|
||||
|
||||
}
|
||||
|
||||
elog(WARN, "Function '%s' has bad returntype %d",
|
||||
elog(ERROR, "Function '%s' has bad returntype %d",
|
||||
funcname, argtype);
|
||||
break;
|
||||
}
|
||||
@ -1267,7 +1267,7 @@ func_error(char *caller, char *funcname, int nargs, Oid *argtypes)
|
||||
ptr += strlen(ptr);
|
||||
}
|
||||
|
||||
elog(WARN, "%s: function %s(%s) does not exist", caller, funcname, p);
|
||||
elog(ERROR, "%s: function %s(%s) does not exist", caller, funcname, p);
|
||||
}
|
||||
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_node.c,v 1.4 1997/12/29 05:13:46 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_node.c,v 1.5 1998/01/05 03:32:29 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -126,7 +126,7 @@ disallow_setop(char *op, Type optype, Node *operand)
|
||||
{
|
||||
elog(NOTICE, "An operand to the '%s' operator returns a set of %s,",
|
||||
op, typeTypeName(optype));
|
||||
elog(WARN, "but '%s' takes single values, not sets.",
|
||||
elog(ERROR, "but '%s' takes single values, not sets.",
|
||||
op);
|
||||
}
|
||||
}
|
||||
@ -268,7 +268,7 @@ make_var(ParseState *pstate, char *refname, char *attrname, Oid *type_id)
|
||||
|
||||
rd = heap_open(rte->relid);
|
||||
|
||||
attid = attnameAttNum(rd, attrname); /* could elog(WARN) */
|
||||
attid = attnameAttNum(rd, attrname); /* could elog(ERROR) */
|
||||
vartypeid = attnumTypeId(rd, attid);
|
||||
|
||||
varnode = makeVar(vnum, attid, vartypeid, vnum, attid);
|
||||
@ -311,7 +311,7 @@ make_array_ref(Node *expr,
|
||||
0, 0, 0);
|
||||
|
||||
if (!HeapTupleIsValid(type_tuple))
|
||||
elog(WARN, "make_array_ref: Cache lookup failed for type %d\n",
|
||||
elog(ERROR, "make_array_ref: Cache lookup failed for type %d\n",
|
||||
typearray);
|
||||
|
||||
/* get the array type struct from the type tuple */
|
||||
@ -319,7 +319,7 @@ make_array_ref(Node *expr,
|
||||
|
||||
if (type_struct_array->typelem == InvalidOid)
|
||||
{
|
||||
elog(WARN, "make_array_ref: type %s is not an array",
|
||||
elog(ERROR, "make_array_ref: type %s is not an array",
|
||||
(Name) &(type_struct_array->typname.data[0]));
|
||||
}
|
||||
|
||||
@ -328,7 +328,7 @@ make_array_ref(Node *expr,
|
||||
ObjectIdGetDatum(type_struct_array->typelem),
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(type_tuple))
|
||||
elog(WARN, "make_array_ref: Cache lookup failed for type %d\n",
|
||||
elog(ERROR, "make_array_ref: Cache lookup failed for type %d\n",
|
||||
typearray);
|
||||
|
||||
type_struct_element = (TypeTupleForm) GETSTRUCT(type_tuple);
|
||||
@ -393,7 +393,7 @@ make_array_set(Expr *target_expr,
|
||||
0, 0, 0);
|
||||
|
||||
if (!HeapTupleIsValid(type_tuple))
|
||||
elog(WARN, "make_array_ref: Cache lookup failed for type %d\n",
|
||||
elog(ERROR, "make_array_ref: Cache lookup failed for type %d\n",
|
||||
typearray);
|
||||
|
||||
/* get the array type struct from the type tuple */
|
||||
@ -401,7 +401,7 @@ make_array_set(Expr *target_expr,
|
||||
|
||||
if (type_struct_array->typelem == InvalidOid)
|
||||
{
|
||||
elog(WARN, "make_array_ref: type %s is not an array",
|
||||
elog(ERROR, "make_array_ref: type %s is not an array",
|
||||
(Name) &(type_struct_array->typname.data[0]));
|
||||
}
|
||||
/* get the type tuple for the element type */
|
||||
@ -410,7 +410,7 @@ make_array_set(Expr *target_expr,
|
||||
0, 0, 0);
|
||||
|
||||
if (!HeapTupleIsValid(type_tuple))
|
||||
elog(WARN, "make_array_ref: Cache lookup failed for type %d\n",
|
||||
elog(ERROR, "make_array_ref: Cache lookup failed for type %d\n",
|
||||
typearray);
|
||||
|
||||
type_struct_element = (TypeTupleForm) GETSTRUCT(type_tuple);
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_oper.c,v 1.4 1998/01/01 05:44:54 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_oper.c,v 1.5 1998/01/05 03:32:29 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -367,7 +367,7 @@ oper(char *op, Oid arg1, Oid arg2, bool noWarnings)
|
||||
elog(NOTICE, "there is more than one operator %s for types", op);
|
||||
elog(NOTICE, "%s and %s. You will have to retype this query",
|
||||
typeTypeName(tp1), typeTypeName(tp2));
|
||||
elog(WARN, "using an explicit cast");
|
||||
elog(ERROR, "using an explicit cast");
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
@ -473,7 +473,7 @@ right_oper(char *op, Oid arg)
|
||||
ncandidates = unary_oper_get_candidates(op, arg, &candidates, 'r');
|
||||
if (ncandidates == 0)
|
||||
{
|
||||
elog(WARN,
|
||||
elog(ERROR,
|
||||
"Can't find right op: %s for type %d", op, arg);
|
||||
return (NULL);
|
||||
}
|
||||
@ -490,7 +490,7 @@ right_oper(char *op, Oid arg)
|
||||
{
|
||||
elog(NOTICE, "there is more than one right operator %s", op);
|
||||
elog(NOTICE, "you will have to retype this query");
|
||||
elog(WARN, "using an explicit cast");
|
||||
elog(ERROR, "using an explicit cast");
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
@ -518,7 +518,7 @@ left_oper(char *op, Oid arg)
|
||||
ncandidates = unary_oper_get_candidates(op, arg, &candidates, 'l');
|
||||
if (ncandidates == 0)
|
||||
{
|
||||
elog(WARN,
|
||||
elog(ERROR,
|
||||
"Can't find left op: %s for type %d", op, arg);
|
||||
return (NULL);
|
||||
}
|
||||
@ -535,7 +535,7 @@ left_oper(char *op, Oid arg)
|
||||
{
|
||||
elog(NOTICE, "there is more than one left operator %s", op);
|
||||
elog(NOTICE, "you will have to retype this query");
|
||||
elog(WARN, "using an explicit cast");
|
||||
elog(ERROR, "using an explicit cast");
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
@ -575,7 +575,7 @@ op_error(char *op, Oid arg1, Oid arg2)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(WARN, "left hand side of operator %s has an unknown type, probably a bad attribute name", op);
|
||||
elog(ERROR, "left hand side of operator %s has an unknown type, probably a bad attribute name", op);
|
||||
}
|
||||
|
||||
if (typeidIsValid(arg2))
|
||||
@ -584,7 +584,7 @@ op_error(char *op, Oid arg1, Oid arg2)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(WARN, "right hand side of operator %s has an unknown type, probably a bad attribute name", op);
|
||||
elog(ERROR, "right hand side of operator %s has an unknown type, probably a bad attribute name", op);
|
||||
}
|
||||
|
||||
#if FALSE
|
||||
@ -592,10 +592,10 @@ op_error(char *op, Oid arg1, Oid arg2)
|
||||
op, typeTypeName(tp1), typeTypeName(tp2));
|
||||
elog(NOTICE, "You will either have to retype this query using an");
|
||||
elog(NOTICE, "explicit cast, or you will have to define the operator");
|
||||
elog(WARN, "%s for %s and %s using CREATE OPERATOR",
|
||||
elog(ERROR, "%s for %s and %s using CREATE OPERATOR",
|
||||
op, typeTypeName(tp1), typeTypeName(tp2));
|
||||
#endif
|
||||
elog(WARN, "There is no operator '%s' for types '%s' and '%s'"
|
||||
elog(ERROR, "There is no operator '%s' for types '%s' and '%s'"
|
||||
"\n\tYou will either have to retype this query using an explicit cast,"
|
||||
"\n\tor you will have to define the operator using CREATE OPERATOR",
|
||||
op, typeTypeName(tp1), typeTypeName(tp2));
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_relation.c,v 1.4 1998/01/04 04:31:19 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_relation.c,v 1.5 1998/01/05 03:32:30 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -130,7 +130,7 @@ colnameRangeTableEntry(ParseState *pstate, char *colname)
|
||||
{
|
||||
if (!pstate->p_is_insert ||
|
||||
rte != pstate->p_target_rangetblentry)
|
||||
elog(WARN, "Column %s is ambiguous", colname);
|
||||
elog(ERROR, "Column %s is ambiguous", colname);
|
||||
}
|
||||
else
|
||||
rte_result = rte;
|
||||
@ -155,7 +155,7 @@ addRangeTableEntry(ParseState *pstate,
|
||||
|
||||
if (pstate != NULL &&
|
||||
refnameRangeTableEntry(pstate->p_rtable, refname) != NULL)
|
||||
elog(WARN, "Table name %s specified more than once", refname);
|
||||
elog(ERROR, "Table name %s specified more than once", refname);
|
||||
|
||||
rte->relname = pstrdup(relname);
|
||||
rte->refname = pstrdup(refname);
|
||||
@ -163,7 +163,7 @@ addRangeTableEntry(ParseState *pstate,
|
||||
relation = heap_openr(relname);
|
||||
if (relation == NULL)
|
||||
{
|
||||
elog(WARN, "%s: %s",
|
||||
elog(ERROR, "%s: %s",
|
||||
relname, aclcheck_error_strings[ACLCHECK_NO_CLASS]);
|
||||
}
|
||||
|
||||
@ -216,7 +216,7 @@ expandAll(ParseState *pstate, char *relname, char *refname, int *this_resno)
|
||||
|
||||
if (rdesc == NULL)
|
||||
{
|
||||
elog(WARN, "Unable to expand all -- heap_open failed on %s",
|
||||
elog(ERROR, "Unable to expand all -- heap_open failed on %s",
|
||||
rte->refname);
|
||||
return NIL;
|
||||
}
|
||||
@ -274,7 +274,7 @@ attnameAttNum(Relation rd, char *a)
|
||||
return (special_attr[i].code);
|
||||
|
||||
/* on failure */
|
||||
elog(WARN, "Relation %s does not have attribute %s",
|
||||
elog(ERROR, "Relation %s does not have attribute %s",
|
||||
RelationGetRelationName(rd), a);
|
||||
return 0; /* lint */
|
||||
}
|
||||
@ -319,7 +319,7 @@ attnumAttName(Relation rd, int attrno)
|
||||
return (name);
|
||||
}
|
||||
}
|
||||
elog(WARN, "Illegal attr no %d for relation %s",
|
||||
elog(ERROR, "Illegal attr no %d for relation %s",
|
||||
attrno, RelationGetRelationName(rd));
|
||||
}
|
||||
else if (attrno >= 1 && attrno <= RelationGetNumberOfAttributes(rd))
|
||||
@ -329,7 +329,7 @@ attnumAttName(Relation rd, int attrno)
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(WARN, "Illegal attr no %d for relation %s",
|
||||
elog(ERROR, "Illegal attr no %d for relation %s",
|
||||
attrno, RelationGetRelationName(rd));
|
||||
}
|
||||
|
||||
@ -380,7 +380,7 @@ handleTargetColname(ParseState *pstate, char **resname,
|
||||
pstate->p_insert_columns = lnext(pstate->p_insert_columns);
|
||||
}
|
||||
else
|
||||
elog(WARN, "insert: more expressions than target columns");
|
||||
elog(ERROR, "insert: more expressions than target columns");
|
||||
}
|
||||
if (pstate->p_is_insert || pstate->p_is_update)
|
||||
checkTargetTypes(pstate, *resname, refname, colname);
|
||||
@ -410,13 +410,13 @@ checkTargetTypes(ParseState *pstate, char *target_colname,
|
||||
{
|
||||
rte = colnameRangeTableEntry(pstate, colname);
|
||||
if (rte == (RangeTblEntry *) NULL)
|
||||
elog(WARN, "attribute %s not found", colname);
|
||||
elog(ERROR, "attribute %s not found", colname);
|
||||
refname = rte->refname;
|
||||
}
|
||||
|
||||
/*
|
||||
if (pstate->p_is_insert && rte == pstate->p_target_rangetblentry)
|
||||
elog(WARN, "%s not available in this context", colname);
|
||||
elog(ERROR, "%s not available in this context", colname);
|
||||
*/
|
||||
rd = heap_open(rte->relid);
|
||||
|
||||
@ -427,13 +427,13 @@ checkTargetTypes(ParseState *pstate, char *target_colname,
|
||||
attrtype_target = attnumTypeId(pstate->p_target_relation, resdomno_target);
|
||||
|
||||
if (attrtype_id != attrtype_target)
|
||||
elog(WARN, "Type of %s does not match target column %s",
|
||||
elog(ERROR, "Type of %s does not match target column %s",
|
||||
colname, target_colname);
|
||||
|
||||
if ((attrtype_id == BPCHAROID || attrtype_id == VARCHAROID) &&
|
||||
rd->rd_att->attrs[resdomno_id - 1]->attlen !=
|
||||
pstate->p_target_relation->rd_att->attrs[resdomno_target - 1]->attlen)
|
||||
elog(WARN, "Length of %s does not match length of target column %s",
|
||||
elog(ERROR, "Length of %s does not match length of target column %s",
|
||||
colname, target_colname);
|
||||
|
||||
heap_close(rd);
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.4 1998/01/04 04:31:22 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_target.c,v 1.5 1998/01/05 03:32:31 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -105,7 +105,7 @@ transformTargetList(ParseState *pstate, List *targetlist)
|
||||
|
||||
if (exprType(expr) != UNKNOWNOID ||
|
||||
!IsA(expr, Const))
|
||||
elog(WARN, "yyparse: string constant expected");
|
||||
elog(ERROR, "yyparse: string constant expected");
|
||||
|
||||
val = (char *) textout((struct varlena *)
|
||||
((Const *) expr)->constvalue);
|
||||
@ -116,14 +116,14 @@ transformTargetList(ParseState *pstate, List *targetlist)
|
||||
|
||||
aind->uidx = transformExpr(pstate, aind->uidx, EXPR_COLUMN_FIRST);
|
||||
if (!IsA(aind->uidx, Const))
|
||||
elog(WARN,
|
||||
elog(ERROR,
|
||||
"Array Index for Append should be a constant");
|
||||
uindx[i] = ((Const *) aind->uidx)->constvalue;
|
||||
if (aind->lidx != NULL)
|
||||
{
|
||||
aind->lidx = transformExpr(pstate, aind->lidx, EXPR_COLUMN_FIRST);
|
||||
if (!IsA(aind->lidx, Const))
|
||||
elog(WARN,
|
||||
elog(ERROR,
|
||||
"Array Index for Append should be a constant");
|
||||
lindx[i] = ((Const *) aind->lidx)->constvalue;
|
||||
}
|
||||
@ -132,7 +132,7 @@ transformTargetList(ParseState *pstate, List *targetlist)
|
||||
lindx[i] = 1;
|
||||
}
|
||||
if (lindx[i] > uindx[i])
|
||||
elog(WARN, "yyparse: lower index cannot be greater than upper index");
|
||||
elog(ERROR, "yyparse: lower index cannot be greater than upper index");
|
||||
sprintf(str, "[%d:%d]", lindx[i], uindx[i]);
|
||||
str += strlen(str);
|
||||
i++;
|
||||
@ -143,7 +143,7 @@ transformTargetList(ParseState *pstate, List *targetlist)
|
||||
resdomno = attnameAttNum(rd, res->name);
|
||||
ndims = attnumAttNelems(rd, resdomno);
|
||||
if (i != ndims)
|
||||
elog(WARN, "yyparse: array dimensions do not match");
|
||||
elog(ERROR, "yyparse: array dimensions do not match");
|
||||
constval = makeNode(Value);
|
||||
constval->type = T_String;
|
||||
constval->val.str = save_str;
|
||||
@ -290,7 +290,7 @@ transformTargetList(ParseState *pstate, List *targetlist)
|
||||
}
|
||||
default:
|
||||
/* internal error */
|
||||
elog(WARN,
|
||||
elog(ERROR,
|
||||
"internal error: do not know how to transform targetlist");
|
||||
break;
|
||||
}
|
||||
@ -334,7 +334,7 @@ make_targetlist_expr(ParseState *pstate,
|
||||
Resdom *resnode;
|
||||
|
||||
if (expr == NULL)
|
||||
elog(WARN, "make_targetlist_expr: invalid use of NULL expression");
|
||||
elog(ERROR, "make_targetlist_expr: invalid use of NULL expression");
|
||||
|
||||
type_id = exprType(expr);
|
||||
if (type_id == InvalidOid)
|
||||
@ -417,7 +417,7 @@ make_targetlist_expr(ParseState *pstate,
|
||||
else if ((attrtype == FLOAT4OID) && (type_id == FLOAT8OID))
|
||||
lfirst(expr) = lispInteger(FLOAT4OID);
|
||||
else
|
||||
elog(WARN, "unequal type in tlist : %s \n", colname);
|
||||
elog(ERROR, "unequal type in tlist : %s \n", colname);
|
||||
}
|
||||
|
||||
Input_is_string = false;
|
||||
@ -449,7 +449,7 @@ make_targetlist_expr(ParseState *pstate,
|
||||
else
|
||||
{
|
||||
/* currently, we can't handle casting of expressions */
|
||||
elog(WARN, "parser: attribute '%s' is of type '%s' but expression is of type '%s'",
|
||||
elog(ERROR, "parser: attribute '%s' is of type '%s' but expression is of type '%s'",
|
||||
colname,
|
||||
typeidTypeName(attrtype),
|
||||
typeidTypeName(type_id));
|
||||
@ -564,7 +564,7 @@ makeTargetNames(ParseState *pstate, List *cols)
|
||||
attnameAttNum(pstate->p_target_relation, name);
|
||||
foreach(nxt, lnext(tl))
|
||||
if (!strcmp(name, ((Ident *) lfirst(nxt))->name))
|
||||
elog (WARN, "Attribute '%s' should be specified only once", name);
|
||||
elog(ERROR, "Attribute '%s' should be specified only once", name);
|
||||
}
|
||||
}
|
||||
|
||||
@ -596,7 +596,7 @@ expandAllTables(ParseState *pstate)
|
||||
|
||||
/* this should not happen */
|
||||
if (rtable == NULL)
|
||||
elog(WARN, "cannot expand: null p_rtable");
|
||||
elog(ERROR, "cannot expand: null p_rtable");
|
||||
|
||||
/*
|
||||
* go through the range table and make a list of range table entries
|
||||
|
@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_type.c,v 1.2 1997/11/26 01:11:32 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_type.c,v 1.3 1998/01/05 03:32:33 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -44,7 +44,7 @@ typeidTypeName(Oid id)
|
||||
if (!(tup = SearchSysCacheTuple(TYPOID, ObjectIdGetDatum(id),
|
||||
0, 0, 0)))
|
||||
{
|
||||
elog(WARN, "type id lookup of %ud failed", id);
|
||||
elog(ERROR, "type id lookup of %ud failed", id);
|
||||
return (NULL);
|
||||
}
|
||||
typetuple = (TypeTupleForm) GETSTRUCT(tup);
|
||||
@ -60,7 +60,7 @@ typeidType(Oid id)
|
||||
if (!(tup = SearchSysCacheTuple(TYPOID, ObjectIdGetDatum(id),
|
||||
0, 0, 0)))
|
||||
{
|
||||
elog(WARN, "type id lookup of %ud failed", id);
|
||||
elog(ERROR, "type id lookup of %ud failed", id);
|
||||
return (NULL);
|
||||
}
|
||||
return ((Type) tup);
|
||||
@ -74,12 +74,12 @@ typenameType(char *s)
|
||||
|
||||
if (s == NULL)
|
||||
{
|
||||
elog(WARN, "type(): Null type");
|
||||
elog(ERROR, "type(): Null type");
|
||||
}
|
||||
|
||||
if (!(tup = SearchSysCacheTuple(TYPNAME, PointerGetDatum(s), 0, 0, 0)))
|
||||
{
|
||||
elog(WARN, "type name lookup of %s failed", s);
|
||||
elog(ERROR, "type name lookup of %s failed", s);
|
||||
}
|
||||
return ((Type) tup);
|
||||
}
|
||||
@ -89,7 +89,7 @@ Oid
|
||||
typeTypeId(Type tp)
|
||||
{
|
||||
if (tp == NULL)
|
||||
elog(WARN, "typeTypeId() called with NULL type struct");
|
||||
elog(ERROR, "typeTypeId() called with NULL type struct");
|
||||
return (tp->t_oid);
|
||||
}
|
||||
|
||||
@ -159,7 +159,7 @@ typeidRetoutfunc(Oid type_id)
|
||||
ObjectIdGetDatum(type_id),
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(typeTuple))
|
||||
elog(WARN, "typeidRetoutfunc: Invalid type - oid = %u", type_id);
|
||||
elog(ERROR, "typeidRetoutfunc: Invalid type - oid = %u", type_id);
|
||||
|
||||
type = (TypeTupleForm) GETSTRUCT(typeTuple);
|
||||
outfunc = type->typoutput;
|
||||
@ -177,7 +177,7 @@ typeidTypeRelid(Oid type_id)
|
||||
ObjectIdGetDatum(type_id),
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(typeTuple))
|
||||
elog(WARN, "typeidTypeRelid: Invalid type - oid = %u", type_id);
|
||||
elog(ERROR, "typeidTypeRelid: Invalid type - oid = %u", type_id);
|
||||
|
||||
type = (TypeTupleForm) GETSTRUCT(typeTuple);
|
||||
infunc = type->typrelid;
|
||||
@ -204,7 +204,7 @@ typeidTypElem(Oid type_id)
|
||||
ObjectIdGetDatum(type_id),
|
||||
0, 0, 0)))
|
||||
{
|
||||
elog(WARN, "type id lookup of %u failed", type_id);
|
||||
elog(ERROR, "type id lookup of %u failed", type_id);
|
||||
}
|
||||
type = (TypeTupleForm) GETSTRUCT(typeTuple);
|
||||
|
||||
@ -225,7 +225,7 @@ GetArrayElementType(Oid typearray)
|
||||
0, 0, 0);
|
||||
|
||||
if (!HeapTupleIsValid(type_tuple))
|
||||
elog(WARN, "GetArrayElementType: Cache lookup failed for type %d",
|
||||
elog(ERROR, "GetArrayElementType: Cache lookup failed for type %d",
|
||||
typearray);
|
||||
|
||||
/* get the array type struct from the type tuple */
|
||||
@ -233,7 +233,7 @@ GetArrayElementType(Oid typearray)
|
||||
|
||||
if (type_struct_array->typelem == InvalidOid)
|
||||
{
|
||||
elog(WARN, "GetArrayElementType: type %s is not an array",
|
||||
elog(ERROR, "GetArrayElementType: type %s is not an array",
|
||||
(Name) &(type_struct_array->typname.data[0]));
|
||||
}
|
||||
|
||||
@ -252,7 +252,7 @@ typeidRetinfunc(Oid type_id)
|
||||
ObjectIdGetDatum(type_id),
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(typeTuple))
|
||||
elog(WARN, "typeidRetinfunc: Invalid type - oid = %u", type_id);
|
||||
elog(ERROR, "typeidRetinfunc: Invalid type - oid = %u", type_id);
|
||||
|
||||
type = (TypeTupleForm) GETSTRUCT(typeTuple);
|
||||
infunc = type->typinput;
|
||||
@ -273,7 +273,7 @@ FindDelimiter(char *typename)
|
||||
PointerGetDatum(typename),
|
||||
0, 0, 0)))
|
||||
{
|
||||
elog(WARN, "type name lookup of %s failed", typename);
|
||||
elog(ERROR, "type name lookup of %s failed", typename);
|
||||
}
|
||||
type = (TypeTupleForm) GETSTRUCT(typeTuple);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* A lexical scanner generated by flex */
|
||||
|
||||
/* Scanner skeleton version:
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.5 1997/12/09 03:11:00 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.6 1998/01/05 03:32:34 momjian Exp $
|
||||
*/
|
||||
|
||||
#define FLEX_SCANNER
|
||||
@ -539,7 +539,7 @@ char *yytext;
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.5 1997/12/09 03:11:00 scrappy Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/Attic/scan.c,v 1.6 1998/01/05 03:32:34 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -954,7 +954,7 @@ YY_RULE_SETUP
|
||||
errno = 0;
|
||||
yylval.ival = strtol((char *)literal,&endptr,2);
|
||||
if (*endptr != '\0' || errno == ERANGE)
|
||||
elog(WARN,"Bad binary integer input '%s'",literal);
|
||||
elog(ABORT,"Bad binary integer input '%s'",literal);
|
||||
return (ICONST);
|
||||
}
|
||||
YY_BREAK
|
||||
@ -965,7 +965,7 @@ YY_RULE_SETUP
|
||||
#line 206 "scan.l"
|
||||
{
|
||||
if ((llen+yyleng) > (MAX_PARSE_BUFFER - 1))
|
||||
elog(WARN,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
|
||||
elog(ABORT,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
|
||||
memcpy(literal+llen, yytext, yyleng+1);
|
||||
llen += yyleng;
|
||||
}
|
||||
@ -997,7 +997,7 @@ YY_RULE_SETUP
|
||||
errno = 0;
|
||||
yylval.ival = strtol((char *)literal,&endptr,16);
|
||||
if (*endptr != '\0' || errno == ERANGE)
|
||||
elog(WARN,"Bad hexadecimal integer input '%s'",literal);
|
||||
elog(ABORT,"Bad hexadecimal integer input '%s'",literal);
|
||||
return (ICONST);
|
||||
}
|
||||
YY_BREAK
|
||||
@ -1026,7 +1026,7 @@ YY_RULE_SETUP
|
||||
#line 243 "scan.l"
|
||||
{
|
||||
if ((llen+yyleng) > (MAX_PARSE_BUFFER - 1))
|
||||
elog(WARN,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
|
||||
elog(ABORT,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
|
||||
memcpy(literal+llen, yytext, yyleng+1);
|
||||
llen += yyleng;
|
||||
}
|
||||
@ -1036,7 +1036,7 @@ YY_RULE_SETUP
|
||||
#line 249 "scan.l"
|
||||
{
|
||||
if ((llen+yyleng-1) > (MAX_PARSE_BUFFER - 1))
|
||||
elog(WARN,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
|
||||
elog(ABORT,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
|
||||
memcpy(literal+llen, yytext, yyleng+1);
|
||||
*(literal+llen) = '\'';
|
||||
llen += yyleng;
|
||||
@ -1047,7 +1047,7 @@ YY_RULE_SETUP
|
||||
#line 257 "scan.l"
|
||||
{
|
||||
if ((llen+yyleng-1) > (MAX_PARSE_BUFFER - 1))
|
||||
elog(WARN,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
|
||||
elog(ABORT,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
|
||||
memcpy(literal+llen, yytext, yyleng+1);
|
||||
llen += yyleng;
|
||||
}
|
||||
@ -1081,7 +1081,7 @@ YY_RULE_SETUP
|
||||
#line 277 "scan.l"
|
||||
{
|
||||
if ((llen+yyleng) > (MAX_PARSE_BUFFER - 1))
|
||||
elog(WARN,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
|
||||
elog(ABORT,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
|
||||
memcpy(literal+llen, yytext, yyleng+1);
|
||||
llen += yyleng;
|
||||
}
|
||||
@ -1159,7 +1159,7 @@ YY_RULE_SETUP
|
||||
errno = 0;
|
||||
yylval.ival = strtol((char *)yytext,&endptr,10);
|
||||
if (*endptr != '\0' || errno == ERANGE)
|
||||
elog(WARN,"Bad integer input '%s'",yytext);
|
||||
elog(ABORT,"Bad integer input '%s'",yytext);
|
||||
return (ICONST);
|
||||
}
|
||||
YY_BREAK
|
||||
@ -1173,7 +1173,7 @@ YY_RULE_SETUP
|
||||
errno = 0;
|
||||
yylval.dval = strtod(((char *)yytext),&endptr);
|
||||
if (*endptr != '\0' || errno == ERANGE)
|
||||
elog(WARN,"Bad float8 input '%s'",yytext);
|
||||
elog(ABORT,"Bad float8 input '%s'",yytext);
|
||||
CheckFloat8Val(yylval.dval);
|
||||
return (FCONST);
|
||||
}
|
||||
@ -1187,7 +1187,7 @@ YY_RULE_SETUP
|
||||
errno = 0;
|
||||
yylval.ival = strtol((char *)yytext,&endptr,10);
|
||||
if (*endptr != '\0' || errno == ERANGE)
|
||||
elog(WARN,"Bad integer input '%s'",yytext);
|
||||
elog(ABORT,"Bad integer input '%s'",yytext);
|
||||
return (ICONST);
|
||||
}
|
||||
YY_BREAK
|
||||
@ -1200,7 +1200,7 @@ YY_RULE_SETUP
|
||||
errno = 0;
|
||||
yylval.dval = strtod((char *)yytext,&endptr);
|
||||
if (*endptr != '\0' || errno == ERANGE)
|
||||
elog(WARN,"Bad float input '%s'",yytext);
|
||||
elog(ABORT,"Bad float input '%s'",yytext);
|
||||
CheckFloat8Val(yylval.dval);
|
||||
return (FCONST);
|
||||
}
|
||||
@ -2133,7 +2133,7 @@ int main()
|
||||
|
||||
void yyerror(char message[])
|
||||
{
|
||||
elog(WARN, "parser: %s at or near \"%s\"", message, yytext);
|
||||
elog(ABORT, "parser: %s at or near \"%s\"", message, yytext);
|
||||
}
|
||||
|
||||
int yywrap()
|
||||
|
@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.32 1997/12/05 01:12:53 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.33 1998/01/05 03:32:35 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -199,13 +199,13 @@ other .
|
||||
errno = 0;
|
||||
yylval.ival = strtol((char *)literal,&endptr,2);
|
||||
if (*endptr != '\0' || errno == ERANGE)
|
||||
elog(WARN,"Bad binary integer input '%s'",literal);
|
||||
elog(ABORT,"Bad binary integer input '%s'",literal);
|
||||
return (ICONST);
|
||||
}
|
||||
<xh>{xhinside} |
|
||||
<xb>{xbinside} {
|
||||
if ((llen+yyleng) > (MAX_PARSE_BUFFER - 1))
|
||||
elog(WARN,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
|
||||
elog(ABORT,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
|
||||
memcpy(literal+llen, yytext, yyleng+1);
|
||||
llen += yyleng;
|
||||
}
|
||||
@ -225,7 +225,7 @@ other .
|
||||
errno = 0;
|
||||
yylval.ival = strtol((char *)literal,&endptr,16);
|
||||
if (*endptr != '\0' || errno == ERANGE)
|
||||
elog(WARN,"Bad hexadecimal integer input '%s'",literal);
|
||||
elog(ABORT,"Bad hexadecimal integer input '%s'",literal);
|
||||
return (ICONST);
|
||||
}
|
||||
|
||||
@ -242,13 +242,13 @@ other .
|
||||
<xq>{xqdouble} |
|
||||
<xq>{xqinside} {
|
||||
if ((llen+yyleng) > (MAX_PARSE_BUFFER - 1))
|
||||
elog(WARN,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
|
||||
elog(ABORT,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
|
||||
memcpy(literal+llen, yytext, yyleng+1);
|
||||
llen += yyleng;
|
||||
}
|
||||
<xq>{xqembedded} {
|
||||
if ((llen+yyleng-1) > (MAX_PARSE_BUFFER - 1))
|
||||
elog(WARN,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
|
||||
elog(ABORT,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
|
||||
memcpy(literal+llen, yytext, yyleng+1);
|
||||
*(literal+llen) = '\'';
|
||||
llen += yyleng;
|
||||
@ -256,7 +256,7 @@ other .
|
||||
|
||||
<xq>{xqliteral} {
|
||||
if ((llen+yyleng-1) > (MAX_PARSE_BUFFER - 1))
|
||||
elog(WARN,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
|
||||
elog(ABORT,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
|
||||
memcpy(literal+llen, yytext, yyleng+1);
|
||||
llen += yyleng;
|
||||
}
|
||||
@ -276,7 +276,7 @@ other .
|
||||
}
|
||||
<xd>{xdinside} {
|
||||
if ((llen+yyleng) > (MAX_PARSE_BUFFER - 1))
|
||||
elog(WARN,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
|
||||
elog(ABORT,"quoted string parse buffer of %d chars exceeded",MAX_PARSE_BUFFER);
|
||||
memcpy(literal+llen, yytext, yyleng+1);
|
||||
llen += yyleng;
|
||||
}
|
||||
@ -318,7 +318,7 @@ other .
|
||||
errno = 0;
|
||||
yylval.ival = strtol((char *)yytext,&endptr,10);
|
||||
if (*endptr != '\0' || errno == ERANGE)
|
||||
elog(WARN,"Bad integer input '%s'",yytext);
|
||||
elog(ABORT,"Bad integer input '%s'",yytext);
|
||||
return (ICONST);
|
||||
}
|
||||
{real}/{space}*-{number} {
|
||||
@ -328,7 +328,7 @@ other .
|
||||
errno = 0;
|
||||
yylval.dval = strtod(((char *)yytext),&endptr);
|
||||
if (*endptr != '\0' || errno == ERANGE)
|
||||
elog(WARN,"Bad float8 input '%s'",yytext);
|
||||
elog(ABORT,"Bad float8 input '%s'",yytext);
|
||||
CheckFloat8Val(yylval.dval);
|
||||
return (FCONST);
|
||||
}
|
||||
@ -338,7 +338,7 @@ other .
|
||||
errno = 0;
|
||||
yylval.ival = strtol((char *)yytext,&endptr,10);
|
||||
if (*endptr != '\0' || errno == ERANGE)
|
||||
elog(WARN,"Bad integer input '%s'",yytext);
|
||||
elog(ABORT,"Bad integer input '%s'",yytext);
|
||||
return (ICONST);
|
||||
}
|
||||
{real} {
|
||||
@ -347,7 +347,7 @@ other .
|
||||
errno = 0;
|
||||
yylval.dval = strtod((char *)yytext,&endptr);
|
||||
if (*endptr != '\0' || errno == ERANGE)
|
||||
elog(WARN,"Bad float input '%s'",yytext);
|
||||
elog(ABORT,"Bad float input '%s'",yytext);
|
||||
CheckFloat8Val(yylval.dval);
|
||||
return (FCONST);
|
||||
}
|
||||
@ -377,7 +377,7 @@ other .
|
||||
|
||||
void yyerror(char message[])
|
||||
{
|
||||
elog(WARN, "parser: %s at or near \"%s\"", message, yytext);
|
||||
elog(ABORT, "parser: %s at or near \"%s\"", message, yytext);
|
||||
}
|
||||
|
||||
int yywrap()
|
||||
|
Reference in New Issue
Block a user