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

Commitb5c7fe5

Browse files
committed
The second patch adds aliases for "ISNULL" to "IS NULL" and likewise for
"NOTNULL" to "IS NOT NULL". I have not removed the postgres specificISNULL and NOTNULL. I noticed this on the TODO list, and figured it wouldbe easy to remove.The full semantics are: [ expression IS NULL ] [ expression IS NOT NULL ]Submitted by: Jason Wright <jason@oozoo.vnet.net>
1 parent2cc3c09 commitb5c7fe5

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

‎src/backend/parser/gram.y

Lines changed: 7 additions & 2 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.2.2.1 1996/08/24 20:54:06 scrappy Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.2.2.2 1996/10/11 03:28:08 scrappy Exp $
1414
*
1515
* HISTORY
1616
* AUTHORDATEMAJOR EVENT
@@ -173,7 +173,7 @@ static Node *makeA_Expr(int op, char *opname, Node *lexpr, Node *rexpr);
173173
CURSOR, DATABASE, DECLARE, DELETE, DELIMITERS, DESC, DISTINCT, DO,
174174
DROP, END_TRANS,
175175
EXTEND, FETCH, FOR, FORWARD, FROM, FUNCTION, GRANT, GROUP,
176-
HAVING, HEAVY, IN, INDEX, INHERITS, INSERT, INSTEAD, INTO,
176+
HAVING, HEAVY, IN, INDEX, INHERITS, INSERT, INSTEAD, INTO,IS,
177177
ISNULL, LANGUAGE, LIGHT, LISTEN, LOAD, MERGE, MOVE, NEW,
178178
NONE, NOT, NOTHING, NOTIFY, NOTNULL,
179179
OIDS, ON, OPERATOR, OPTION, OR, ORDER,
@@ -201,6 +201,7 @@ static Node *makeA_Expr(int op, char *opname, Node *lexpr, Node *rexpr);
201201
%nonassoc Op
202202
%nonassoc NOTNULL
203203
%nonassoc ISNULL
204+
%nonassoc IS
204205
%left '+' '-'
205206
%left '*' '/'
206207
%left'|'/* this is the relation union op, not logical or */
@@ -1810,8 +1811,12 @@ a_expr: attr opt_indirection
18101811
}
18111812
| a_expr ISNULL
18121813
{ $$ = makeA_Expr(ISNULL, NULL, $1, NULL); }
1814+
| a_expr IS PNULL
1815+
{ $$ = makeA_Expr(ISNULL, NULL, $1, NULL); }
18131816
| a_expr NOTNULL
18141817
{ $$ = makeA_Expr(NOTNULL, NULL, $1, NULL); }
1818+
| a_expr IS NOT PNULL
1819+
{ $$ = makeA_Expr(NOTNULL, NULL, $1, NULL); }
18151820
| a_expr AND a_expr
18161821
{ $$ = makeA_Expr(AND, NULL, $1, $3); }
18171822
| a_expr OR a_expr

‎src/backend/parser/keywords.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.1.1.1.2.1 1996/08/24 20:54:11 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.1.1.1.2.2 1996/10/11 03:28:14 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -87,6 +87,7 @@ static ScanKeyword ScanKeywords[] = {
8787
{"insert",INSERT},
8888
{"instead",INSTEAD},
8989
{"into",INTO},
90+
{"is",IS},
9091
{"isnull",ISNULL },
9192
{"language",LANGUAGE},
9293
{"light",LIGHT},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp