Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit25e950f

Browse files
author
Thomas G. Lockhart
committed
Change messages regarding "TimeRange" to say that time travel is no longer
available.Remove lots of #ifdef'd debugging print statements.
1 parentced2ee8 commit25e950f

File tree

1 file changed

+11
-64
lines changed

1 file changed

+11
-64
lines changed

‎src/backend/parser/gram.y

Lines changed: 11 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.63 1997/11/07 07:02:07 thomas Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.64 1997/11/10 15:22:36 thomas Exp $
1414
*
1515
* HISTORY
1616
* AUTHORDATEMAJOR EVENT
@@ -456,9 +456,6 @@ alter_clause: ADD opt_column columnDef
456456

457457
if (length($3) != 1)
458458
elog(WARN,"ALTER TABLE/ADD() allows one column only",NULL);
459-
#ifdef PARSEDEBUG
460-
printf( "list has %d elements\n", length($3));
461-
#endif
462459
$$ = lp;
463460
}
464461
| DROP opt_column ColId
@@ -743,15 +740,9 @@ ConstraintElem:
743740
ConstraintDef:CHECK constraint_elem
744741
{
745742
ConstraintDef *constr = palloc (sizeof(ConstraintDef));
746-
#ifdef PARSEDEBUG
747-
printf("in ConstraintDef\n");
748-
#endif
749743
constr->type = CONSTR_CHECK;
750744
constr->name = NULL;
751745
constr->def = FlattenStringList($2);
752-
#ifdef PARSEDEBUG
753-
printf("ConstraintDef: string is %s\n", (char *) constr->def);
754-
#endif
755746
$$ = constr;
756747
}
757748
| UNIQUE '(' columnList ')'
@@ -768,9 +759,6 @@ constraint_elem: AexprConst
768759
{$$ = lcons( makeString("NULL"), NIL); }
769760
| ColId
770761
{
771-
#ifdef PARSEDEBUG
772-
printf( "ColId is %s\n", $1);
773-
#endif
774762
$$ = lcons( makeString(fmtId($1)), NIL);
775763
}
776764
| '-' constraint_elem %prec UMINUS
@@ -1037,21 +1025,12 @@ def_rest: def_name definition
10371025
{
10381026
$$ = makeNode(DefineStmt);
10391027
$$->defname = $1;
1040-
#ifdef PARSEDEBUG
1041-
printf("def_rest: defname is %s\n", $1);
1042-
#endif
10431028
$$->definition = $2;
10441029
}
10451030
;
10461031

10471032
def_type: OPERATOR{ $$ = OPERATOR; }
1048-
| Type
1049-
{
1050-
#ifdef PARSEDEBUG
1051-
printf("def_type: decoding TYPE_P\n");
1052-
#endif
1053-
$$ = TYPE_P;
1054-
}
1033+
| Type{ $$ = TYPE_P; }
10551034
| AGGREGATE{ $$ = AGGREGATE; }
10561035
;
10571036

@@ -1071,29 +1050,18 @@ def_list: def_elem{ $$ = lcons($1, NIL); }
10711050

10721051
def_elem: def_name '=' def_arg
10731052
{
1074-
#ifdef PARSEDEBUG
1075-
printf("def_elem: decoding %s =\n", $1);
1076-
pprint($3);
1077-
#endif
10781053
$$ = makeNode(DefElem);
10791054
$$->defname = $1;
10801055
$$->arg = (Node *)$3;
10811056
}
10821057
| def_name
10831058
{
1084-
#ifdef PARSEDEBUG
1085-
printf("def_elem: decoding %s\n", $1);
1086-
#endif
10871059
$$ = makeNode(DefElem);
10881060
$$->defname = $1;
10891061
$$->arg = (Node *)NULL;
10901062
}
10911063
| DEFAULT '=' def_arg
10921064
{
1093-
#ifdef PARSEDEBUG
1094-
printf("def_elem: decoding DEFAULT =\n");
1095-
pprint($3);
1096-
#endif
10971065
$$ = makeNode(DefElem);
10981066
$$->defname = "default";
10991067
$$->arg = (Node *)$3;
@@ -2406,14 +2374,14 @@ time_range: '[' opt_range_start ',' opt_range_end ']'
24062374
$$ = makeNode(TimeRange);
24072375
$$->startDate = $2;
24082376
$$->endDate = $4;
2409-
elog (WARN, "parser: TimeRange isnot supported");
2377+
elog (WARN, "time travel isno longer available");
24102378
}
24112379
| '[' date ']'
24122380
{
24132381
$$ = makeNode(TimeRange);
24142382
$$->startDate = $2;
24152383
$$->endDate = NULL;
2416-
elog (WARN, "parser: TimeRange isnot supported");
2384+
elog (WARN, "time travel isno longer available");
24172385
}
24182386
;
24192387

@@ -3057,9 +3025,6 @@ extract_list: datetime FROM a_expr
30573025
A_Const *n = makeNode(A_Const);
30583026
n->val.type = T_String;
30593027
n->val.val.str = $1;
3060-
#ifdef PARSEDEBUG
3061-
printf( "string is %s\n", $1);
3062-
#endif
30633028
$$ = lappend(lcons((Node *)n,NIL), $3);
30643029
}
30653030
| /* EMPTY */
@@ -3581,6 +3546,7 @@ static Node *makeA_Expr(int oper, char *opname, Node *lexpr, Node *rexpr)
35813546
return (Node *)a;
35823547
}
35833548

3549+
35843550
static Node *makeIndexable(char *opname, Node *lexpr, Node *rexpr)
35853551
{
35863552
Node *result = NULL;
@@ -3748,7 +3714,7 @@ static Node *makeIndexable(char *opname, Node *lexpr, Node *rexpr)
37483714
if (result == NULL)
37493715
result = makeA_Expr(OP, opname, lexpr, rexpr);
37503716
return result;
3751-
}
3717+
} /* makeIndexable() */
37523718

37533719

37543720
/* xlateSqlType()
@@ -3774,6 +3740,7 @@ xlateSqlType(char *name)
37743740
return name;
37753741
} /* xlateSqlName() */
37763742

3743+
37773744
void parser_init(Oid *typev, int nargs)
37783745
{
37793746
QueryIsRule = FALSE;
@@ -3783,6 +3750,7 @@ void parser_init(Oid *typev, int nargs)
37833750
param_type_init(typev, nargs);
37843751
}
37853752

3753+
37863754
/* FlattenStringList()
37873755
* Traverse list of string nodes and convert to a single string.
37883756
* Used for reconstructing string form of complex expressions.
@@ -3799,17 +3767,11 @@ FlattenStringList(List *list)
37993767
int nlist, len = 0;
38003768

38013769
nlist = length(list);
3802-
#ifdef PARSEDEBUG
3803-
printf( "list has %d elements\n", nlist);
3804-
#endif
38053770
l = list;
38063771
while(l != NIL) {
38073772
v = (Value *)lfirst(l);
38083773
sp = v->val.str;
38093774
l = lnext(l);
3810-
#ifdef PARSEDEBUG
3811-
printf( "sp is x%8p; length of %s is %d\n", sp, sp, strlen(sp));
3812-
#endif
38133775
len += strlen(sp);
38143776
};
38153777
len += nlist;
@@ -3822,9 +3784,6 @@ printf( "sp is x%8p; length of %s is %d\n", sp, sp, strlen(sp));
38223784
v = (Value *)lfirst(l);
38233785
sp = v->val.str;
38243786
l = lnext(l);
3825-
#ifdef PARSEDEBUG
3826-
printf( "length of %s is %d\n", sp, strlen(sp));
3827-
#endif
38283787
strcat(s,sp);
38293788
if (l != NIL) strcat(s," ");
38303789
};
@@ -3837,46 +3796,33 @@ printf( "flattened string is \"%s\"\n", s);
38373796
return(s);
38383797
} /* FlattenStringList() */
38393798

3799+
38403800
/* makeConstantList()
38413801
* Convert constant value node into string node.
38423802
*/
38433803
static List *
38443804
makeConstantList( A_Const *n)
38453805
{
38463806
char *defval = NULL;
3847-
#ifdef PARSEDEBUG
3848-
printf( "in AexprConst\n");
3849-
#endif
38503807
if (nodeTag(n) != T_A_Const) {
38513808
elog(WARN,"Cannot handle non-constant parameter",NULL);
38523809

38533810
} else if (n->val.type == T_Float) {
3854-
#ifdef PARSEDEBUG
3855-
printf( "AexprConst float is %f\n", n->val.val.dval);
3856-
#endif
38573811
defval = (char*) palloc(20+1);
38583812
sprintf( defval, "%g", n->val.val.dval);
38593813

38603814
} else if (n->val.type == T_Integer) {
3861-
#ifdef PARSEDEBUG
3862-
printf( "AexprConst integer is %ld\n", n->val.val.ival);
3863-
#endif
38643815
defval = (char*) palloc(20+1);
38653816
sprintf( defval, "%ld", n->val.val.ival);
38663817

38673818
} else if (n->val.type == T_String) {
3868-
3869-
#ifdef PARSEDEBUG
3870-
printf( "AexprConst string is \"%s\"\n", n->val.val.str);
3871-
#endif
3872-
38733819
defval = (char*) palloc(strlen( ((A_Const *) n)->val.val.str) + 3);
38743820
strcpy( defval, "'");
38753821
strcat( defval, ((A_Const *) n)->val.val.str);
38763822
strcat( defval, "'");
38773823

38783824
} else {
3879-
elog(WARN,"Internal error: cannot encode node",NULL);
3825+
elog(WARN,"Internal error in makeConstantList(): cannot encode node",NULL);
38803826
};
38813827

38823828
#ifdef PARSEDEBUG
@@ -3886,6 +3832,7 @@ printf( "AexprConst argument is \"%s\"\n", defval);
38863832
return( lcons( makeString(defval), NIL));
38873833
} /* makeConstantList() */
38883834

3835+
38893836
/* fmtId()
38903837
* Check input string for non-lowercase/non-numeric characters.
38913838
* Returns either input string or input surrounded by double quotes.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp