AIX patch from Darren King and Univel patch from Billy Allie, mostly

related to grammar and parser issues, with one postmaster fix.
This commit is contained in:
Bruce Momjian 1998-02-01 19:43:54 +00:00
parent 44030ef229
commit 6159ba3ab1
4 changed files with 16 additions and 21 deletions

View File

@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.99 1998/01/25 04:12:28 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.100 1998/02/01 19:43:34 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@ -125,8 +125,6 @@ Oid param_type(int t); /* used in parse_expr.c */
ExplainStmt, VariableSetStmt, VariableShowStmt, VariableResetStmt,
CreateUserStmt, AlterUserStmt, DropUserStmt
%type <rtstmt>
%type <str> opt_database, location
%type <pboolean> user_createdb_clause, user_createuser_clause
@ -261,7 +259,7 @@ Oid param_type(int t); /* used in parse_expr.c */
SECOND_P, SELECT, SET, SUBSTRING,
TABLE, TIME, TIMESTAMP, TO, TRAILING, TRANSACTION, TRIM,
UNION, UNIQUE, UPDATE, USING,
VALUES, VARCHAR, VARYING, VERBOSE, VERSION, VIEW,
VALUES, VARCHAR, VARYING, VIEW,
WHERE, WITH, WORK, YEAR_P, ZONE
/* Keywords (in SQL3 reserved words) */
@ -2222,7 +2220,7 @@ LockStmt: LOCK_P relation_name
c->typename->name = xlateSqlType("bool");
n->relname = $2;
n->whereClause = c;
n->whereClause = (Node *)c;
$$ = (Node *)n;
}
;
@ -3284,8 +3282,9 @@ a_expr: attr opt_indirection
makeA_Expr(OP, "<", $1, $4),
makeA_Expr(OP, ">", $1, $6));
}
| a_expr IN { saved_In_Expr = lcons($1,saved_In_Expr); } '(' in_expr ')' { saved_In_Expr = lnext(saved_In_Expr); }
| a_expr IN { saved_In_Expr = lcons($1,saved_In_Expr); } '(' in_expr ')'
{
saved_In_Expr = lnext(saved_In_Expr);
if (nodeTag($5) == T_SubLink)
{
SubLink *n = (SubLink *)$5;
@ -3297,8 +3296,9 @@ a_expr: attr opt_indirection
}
else $$ = $5;
}
| a_expr NOT IN { saved_In_Expr = lcons($1,saved_In_Expr); } '(' not_in_expr ')' { saved_In_Expr = lnext(saved_In_Expr); }
| a_expr NOT IN { saved_In_Expr = lcons($1,saved_In_Expr); } '(' not_in_expr ')'
{
saved_In_Expr = lnext(saved_In_Expr);
if (nodeTag($6) == T_SubLink)
{
SubLink *n = (SubLink *)$6;

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.12 1998/01/20 22:11:55 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.13 1998/02/01 19:43:37 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -242,25 +242,24 @@ transformExpr(ParseState *pstate, Node *expr, int precedence)
{
SubLink *sublink = (SubLink *) expr;
QueryTreeList *qtree;
Query *subselect;
List *llist;
qtree = parse_analyze(lcons(sublink->subselect,NIL), pstate);
Assert(qtree->len == 1);
sublink->subselect = (Node *) subselect = qtree->qtrees[0];
sublink->subselect = (Node *) qtree->qtrees[0];
foreach(llist, sublink->lefthand)
lfirst(llist) = transformExpr(pstate, lfirst(llist), precedence);
if (length(sublink->lefthand) !=
length(subselect->targetList))
length(sublink->subselect->targetList))
elog(ERROR,"Subselect has too many or too few fields.");
if (sublink->subLinkType != EXISTS_SUBLINK)
{
char *op = lfirst(sublink->oper);
List *left_expr = sublink->lefthand;
List *right_expr = subselect->targetList;
List *right_expr = sublink->subselect->targetList;
List *elist;
sublink->oper = NIL;

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.63 1998/01/26 01:41:35 scrappy Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.64 1998/02/01 19:43:46 momjian Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@ -492,7 +492,7 @@ pg_parse_and_plan(char *query_string, /* string to execute */
for (i = 0; i < querytree_list->len; i++)
{
print(querytree_list->qtrees[i]);
nodeDisplay(querytree_list->qtrees[i]);
printf("\n");
}
}
@ -1293,7 +1293,7 @@ PostgresMain(int argc, char *argv[])
if (IsUnderPostmaster == false)
{
puts("\nPOSTGRES backend interactive interface");
puts("$Revision: 1.63 $ $Date: 1998/01/26 01:41:35 $");
puts("$Revision: 1.64 $ $Date: 1998/02/01 19:43:46 $");
}
/* ----------------

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.39 1998/01/07 18:46:50 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/nabstime.c,v 1.40 1998/02/01 19:43:54 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -138,11 +138,9 @@ abstime2tm(AbsoluteTime time, int *tzp, struct tm * tm, char *tzn)
{
tx = gmtime((time_t *) &time);
};
#else
#endif
#ifdef DATEDEBUG
#ifdef HAVE_INT_TIMEZONE
#if defined(DATEDEBUG) && defined(HAVE_INT_TIMEZONE)
printf("datetime2tm- (localtime) %d.%02d.%02d %02d:%02d:%02d %s %s dst=%d\n",
tx->tm_year, tx->tm_mon, tx->tm_mday, tx->tm_hour, tx->tm_min, tx->tm_sec,
tzname[0], tzname[1], tx->tm_isdst);
@ -151,8 +149,6 @@ abstime2tm(AbsoluteTime time, int *tzp, struct tm * tm, char *tzn)
tx->tm_year, tx->tm_mon, tx->tm_mday, tx->tm_hour, tx->tm_min, tx->tm_sec,
tx->tm_zone, tx->tm_isdst);
#endif
#else
#endif
#ifdef USE_POSIX_TIME