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

Commitbb0bdfd

Browse files
committed
Fixes:
I've enclosed two patches. The first affects Solaris compilability. Thebug stems from netdb.h (where MAXHOSTNAMELEN is defined on a stocksystem). If the user has installed the header files from BIND 4.9.x,there will be no definition of MAXHOSTNAMELEN. The patch will, if allelse fails, try to include <arpa/nameser.h> and set MAXHOSTNAMELEN toMAXDNAME, 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 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 ]--JasonSubmitted by: Jason Wright <jason@oozoo.vnet.net>
1 parent6c684b1 commitbb0bdfd

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
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.4 1996/08/06 16:38:03 scrappy Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 1.5 1996/08/06 16:43:06 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
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 */
@@ -1814,8 +1815,12 @@ a_expr: attr opt_indirection
18141815
}
18151816
| a_expr ISNULL
18161817
{ $$ = makeA_Expr(ISNULL, NULL, $1, NULL); }
1818+
| a_expr IS PNULL
1819+
{ $$ = makeA_Expr(ISNULL, NULL, $1, NULL); }
18171820
| a_expr NOTNULL
18181821
{ $$ = makeA_Expr(NOTNULL, NULL, $1, NULL); }
1822+
| a_expr IS NOT PNULL
1823+
{ $$ = makeA_Expr(NOTNULL, NULL, $1, NULL); }
18191824
| a_expr AND a_expr
18201825
{ $$ = makeA_Expr(AND, NULL, $1, $3); }
18211826
| 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 1996/07/09 06:21:40 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.2 1996/08/06 16:43:08 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},

‎src/backend/postmaster/postmaster.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*
1111
*
1212
* IDENTIFICATION
13-
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.3 1996/07/23 02:23:47 scrappy Exp $
13+
* $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.4 1996/08/06 16:43:24 scrappy Exp $
1414
*
1515
* NOTES
1616
*
@@ -49,6 +49,10 @@
4949
#defineMAXINT INT_MAX
5050
#else
5151
#include<netdb.h>/* for MAXHOSTNAMELEN on some */
52+
#ifndefMAXHOSTNAMELEN/* for MAXHOSTNAMELEN everywhere else */
53+
#include<arpa/nameser.h>
54+
#defineMAXHOSTNAMELENMAXDNAME
55+
#endif
5256
# if defined(PORTNAME_BSD44_derived)|| \
5357
defined(PORTNAME_bsdi)|| \
5458
defined(PORTNAME_bsdi_2_1)

‎src/backend/tcop/postgres.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.4 1996/07/22 23:00:26 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.5 1996/08/06 16:43:41 scrappy Exp $
1111
*
1212
* NOTES
1313
* this is the "main" module of the postgres backend and
@@ -29,6 +29,10 @@
2929
#include<sys/param.h>/* for MAXHOSTNAMELEN on most */
3030
#ifndefWIN32
3131
#include<netdb.h>/* for MAXHOSTNAMELEN on some */
32+
#ifndefMAXHOSTNAMELEN/* for MAXHOSTNAMELEN everywhere else */
33+
#include<arpa/nameser.h>
34+
#defineMAXHOSTNAMELENMAXDNAME
35+
#endif
3236
#endif/* WIN32 */
3337
#include<errno.h>
3438
#ifdefPORTNAME_aix
@@ -1223,7 +1227,7 @@ PostgresMain(int argc, char *argv[])
12231227
*/
12241228
if (IsUnderPostmaster== false) {
12251229
puts("\nPOSTGRES backend interactive interface");
1226-
puts("$Revision: 1.4 $ $Date: 1996/07/22 23:00:26 $");
1230+
puts("$Revision: 1.5 $ $Date: 1996/08/06 16:43:41 $");
12271231
}
12281232

12291233
/* ----------------

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp