summaryrefslogtreecommitdiff
path: root/src/backend/parser
diff options
context:
space:
mode:
authorMarc G. Fournier1996-08-06 16:43:41 +0000
committerMarc G. Fournier1996-08-06 16:43:41 +0000
commitbb0bdfd101933ab330093acb873a53d180460938 (patch)
treece56121d72f695921fa7da1700bf91c7803dacf0 /src/backend/parser
parent6c684b18474d1b0ac58365a1634b1f365d1080be (diff)
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>
Diffstat (limited to 'src/backend/parser')
-rw-r--r--src/backend/parser/gram.y9
-rw-r--r--src/backend/parser/keywords.c3
2 files changed, 9 insertions, 3 deletions
diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y
index 702766db3b..65ecfc376a 100644
--- a/src/backend/parser/gram.y
+++ b/src/backend/parser/gram.y
@@ -10,7 +10,7 @@
*
*
* 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
* AUTHOR DATE MAJOR EVENT
@@ -173,7 +173,7 @@ static Node *makeA_Expr(int op, char *opname, Node *lexpr, Node *rexpr);
CURSOR, DATABASE, DECLARE, DELETE, DELIMITERS, DESC, DISTINCT, DO,
DROP, END_TRANS,
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,
NONE, NOT, NOTHING, NOTIFY, NOTNULL,
ON, OPERATOR, OPTION, OR, ORDER,
@@ -201,6 +201,7 @@ static Node *makeA_Expr(int op, char *opname, Node *lexpr, Node *rexpr);
%nonassoc Op
%nonassoc NOTNULL
%nonassoc ISNULL
+%nonassoc IS
%left '+' '-'
%left '*' '/'
%left '|' /* this is the relation union op, not logical or */
@@ -1814,8 +1815,12 @@ a_expr: attr opt_indirection
}
| a_expr ISNULL
{ $$ = makeA_Expr(ISNULL, NULL, $1, NULL); }
+ | a_expr IS PNULL
+ { $$ = makeA_Expr(ISNULL, NULL, $1, NULL); }
| a_expr NOTNULL
{ $$ = makeA_Expr(NOTNULL, NULL, $1, NULL); }
+ | a_expr IS NOT PNULL
+ { $$ = makeA_Expr(NOTNULL, NULL, $1, NULL); }
| a_expr AND a_expr
{ $$ = makeA_Expr(AND, NULL, $1, $3); }
| a_expr OR a_expr
diff --git a/src/backend/parser/keywords.c b/src/backend/parser/keywords.c
index b6cd549bf9..80a1832575 100644
--- a/src/backend/parser/keywords.c
+++ b/src/backend/parser/keywords.c
@@ -7,7 +7,7 @@
*
*
* 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[] = {
{ "insert", INSERT },
{ "instead", INSTEAD },
{ "into", INTO },
+ { "is", IS },
{ "isnull", ISNULL },
{ "language", LANGUAGE },
{ "light", LIGHT },