Commit bb0bdfd1 authored by Marc G. Fournier's avatar Marc G. Fournier

Fixes:

I've enclosed two patches.  The first affects Solaris compilability.  The
bug stems from netdb.h (where MAXHOSTNAMELEN is defined on a stock
system).  If the user has installed the header files from BIND 4.9.x,
there will be no definition of MAXHOSTNAMELEN.  The patch will, if all
else fails, try to include <arpa/nameser.h> and set MAXHOSTNAMELEN to
MAXDNAME, which is 256 (just like MAXHOSTNAMELEN on a stock system).

The second patch adds aliases for "ISNULL" to "IS NULL" and likewise for
"NOTNULL" to "IS NOT NULL".  I have not removed the postgres specific
ISNULL and NOTNULL.  I noticed this on the TODO list, and figured it would
be easy to remove.

The full semantics are:
        [ expression IS NULL ]
        [ expression IS NOT NULL ]

--Jason


Submitted by: Jason Wright <jason@oozoo.vnet.net>
parent 6c684b18
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.4 1996/08/06 16:38:03 scrappy Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.5 1996/08/06 16:43:06 scrappy Exp $
* *
* HISTORY * HISTORY
* AUTHOR DATE MAJOR EVENT * AUTHOR DATE MAJOR EVENT
...@@ -173,7 +173,7 @@ static Node *makeA_Expr(int op, char *opname, Node *lexpr, Node *rexpr); ...@@ -173,7 +173,7 @@ static Node *makeA_Expr(int op, char *opname, Node *lexpr, Node *rexpr);
CURSOR, DATABASE, DECLARE, DELETE, DELIMITERS, DESC, DISTINCT, DO, CURSOR, DATABASE, DECLARE, DELETE, DELIMITERS, DESC, DISTINCT, DO,
DROP, END_TRANS, DROP, END_TRANS,
EXTEND, FETCH, FOR, FORWARD, FROM, FUNCTION, GRANT, GROUP, EXTEND, FETCH, FOR, FORWARD, FROM, FUNCTION, GRANT, GROUP,
HAVING, HEAVY, IN, INDEX, INHERITS, INSERT, INSTEAD, INTO, HAVING, HEAVY, IN, INDEX, INHERITS, INSERT, INSTEAD, INTO, IS,
ISNULL, LANGUAGE, LIGHT, LISTEN, LOAD, MERGE, MOVE, NEW, ISNULL, LANGUAGE, LIGHT, LISTEN, LOAD, MERGE, MOVE, NEW,
NONE, NOT, NOTHING, NOTIFY, NOTNULL, NONE, NOT, NOTHING, NOTIFY, NOTNULL,
ON, OPERATOR, OPTION, OR, ORDER, ON, OPERATOR, OPTION, OR, ORDER,
...@@ -201,6 +201,7 @@ static Node *makeA_Expr(int op, char *opname, Node *lexpr, Node *rexpr); ...@@ -201,6 +201,7 @@ static Node *makeA_Expr(int op, char *opname, Node *lexpr, Node *rexpr);
%nonassoc Op %nonassoc Op
%nonassoc NOTNULL %nonassoc NOTNULL
%nonassoc ISNULL %nonassoc ISNULL
%nonassoc IS
%left '+' '-' %left '+' '-'
%left '*' '/' %left '*' '/'
%left '|' /* this is the relation union op, not logical or */ %left '|' /* this is the relation union op, not logical or */
...@@ -1814,8 +1815,12 @@ a_expr: attr opt_indirection ...@@ -1814,8 +1815,12 @@ a_expr: attr opt_indirection
} }
| a_expr ISNULL | a_expr ISNULL
{ $$ = makeA_Expr(ISNULL, NULL, $1, NULL); } { $$ = makeA_Expr(ISNULL, NULL, $1, NULL); }
| a_expr IS PNULL
{ $$ = makeA_Expr(ISNULL, NULL, $1, NULL); }
| a_expr NOTNULL | a_expr NOTNULL
{ $$ = makeA_Expr(NOTNULL, NULL, $1, NULL); } { $$ = makeA_Expr(NOTNULL, NULL, $1, NULL); }
| a_expr IS NOT PNULL
{ $$ = makeA_Expr(NOTNULL, NULL, $1, NULL); }
| a_expr AND a_expr | a_expr AND a_expr
{ $$ = makeA_Expr(AND, NULL, $1, $3); } { $$ = makeA_Expr(AND, NULL, $1, $3); }
| a_expr OR a_expr | a_expr OR a_expr
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.1.1.1 1996/07/09 06:21:40 scrappy Exp $ * $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.2 1996/08/06 16:43:08 scrappy Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -87,6 +87,7 @@ static ScanKeyword ScanKeywords[] = { ...@@ -87,6 +87,7 @@ static ScanKeyword ScanKeywords[] = {
{ "insert", INSERT }, { "insert", INSERT },
{ "instead", INSTEAD }, { "instead", INSTEAD },
{ "into", INTO }, { "into", INTO },
{ "is", IS },
{ "isnull", ISNULL }, { "isnull", ISNULL },
{ "language", LANGUAGE }, { "language", LANGUAGE },
{ "light", LIGHT }, { "light", LIGHT },
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.3 1996/07/23 02:23:47 scrappy Exp $ * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.4 1996/08/06 16:43:24 scrappy Exp $
* *
* NOTES * NOTES
* *
...@@ -49,6 +49,10 @@ ...@@ -49,6 +49,10 @@
#define MAXINT INT_MAX #define MAXINT INT_MAX
#else #else
#include <netdb.h> /* for MAXHOSTNAMELEN on some */ #include <netdb.h> /* for MAXHOSTNAMELEN on some */
#ifndef MAXHOSTNAMELEN /* for MAXHOSTNAMELEN everywhere else */
#include <arpa/nameser.h>
#define MAXHOSTNAMELEN MAXDNAME
#endif
# if defined(PORTNAME_BSD44_derived) || \ # if defined(PORTNAME_BSD44_derived) || \
defined(PORTNAME_bsdi) || \ defined(PORTNAME_bsdi) || \
defined(PORTNAME_bsdi_2_1) defined(PORTNAME_bsdi_2_1)
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.4 1996/07/22 23:00:26 scrappy Exp $ * $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.5 1996/08/06 16:43:41 scrappy Exp $
* *
* NOTES * NOTES
* this is the "main" module of the postgres backend and * this is the "main" module of the postgres backend and
...@@ -29,6 +29,10 @@ ...@@ -29,6 +29,10 @@
#include <sys/param.h> /* for MAXHOSTNAMELEN on most */ #include <sys/param.h> /* for MAXHOSTNAMELEN on most */
#ifndef WIN32 #ifndef WIN32
#include <netdb.h> /* for MAXHOSTNAMELEN on some */ #include <netdb.h> /* for MAXHOSTNAMELEN on some */
#ifndef MAXHOSTNAMELEN /* for MAXHOSTNAMELEN everywhere else */
#include <arpa/nameser.h>
#define MAXHOSTNAMELEN MAXDNAME
#endif
#endif /* WIN32 */ #endif /* WIN32 */
#include <errno.h> #include <errno.h>
#ifdef PORTNAME_aix #ifdef PORTNAME_aix
...@@ -1223,7 +1227,7 @@ PostgresMain(int argc, char *argv[]) ...@@ -1223,7 +1227,7 @@ PostgresMain(int argc, char *argv[])
*/ */
if (IsUnderPostmaster == false) { if (IsUnderPostmaster == false) {
puts("\nPOSTGRES backend interactive interface"); puts("\nPOSTGRES backend interactive interface");
puts("$Revision: 1.4 $ $Date: 1996/07/22 23:00:26 $"); puts("$Revision: 1.5 $ $Date: 1996/08/06 16:43:41 $");
} }
/* ---------------- /* ----------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment