diff options
| author | Michael Meskes <meskes@postgresql.org> | 2000-09-21 11:56:08 +0000 |
|---|---|---|
| committer | Michael Meskes <meskes@postgresql.org> | 2000-09-21 11:56:08 +0000 |
| commit | b4c8d47ab0c3c570e31c29696f74a204a33df647 (patch) | |
| tree | 69cec3091fef44b7910e695d27f4b586e5e51999 /src/interfaces/ecpg/preproc/preproc.y | |
| parent | eab8ee9524eb935dcf9339e829ac2c990ef50a5f (diff) | |
| download | postgresql-b4c8d47ab0c3c570e31c29696f74a204a33df647.tar.gz | |
*** empty log message ***
Diffstat (limited to 'src/interfaces/ecpg/preproc/preproc.y')
| -rw-r--r-- | src/interfaces/ecpg/preproc/preproc.y | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y index e32b524f79..888e5f139b 100644 --- a/src/interfaces/ecpg/preproc/preproc.y +++ b/src/interfaces/ecpg/preproc/preproc.y @@ -239,7 +239,7 @@ make_name(void) VALID, VERBOSE, VERSION /* Special keywords, not in the query language - see the "lex" file */ -%token <str> IDENT SCONST Op CSTRING CVARIABLE CPP_LINE +%token <str> IDENT SCONST Op CSTRING CVARIABLE CPP_LINE IP %token <ival> ICONST PARAM %token <dval> FCONST @@ -4029,9 +4029,11 @@ connection_target: database_name opt_server opt_port mmerror(ET_ERROR, errortext); } - if (strncmp($1, "unix", strlen("unix")) == 0 && strncmp($3 + strlen("//"), "localhost", strlen("localhost")) != 0) + if (strncmp($1, "unix", strlen("unix")) == 0 && + strncmp($3 + strlen("//"), "localhost", strlen("localhost")) != 0 && + strncmp($3 + strlen("//"), "127.0.0.1", strlen("127.0.0.1")) != 0) { - sprintf(errortext, "unix domain sockets only work on 'localhost' but not on '%9.9s'", $3 +strlen("//")); + sprintf(errortext, "unix domain sockets only work on 'localhost' but not on '%9.9s'", $3 + strlen("//")); mmerror(ET_ERROR, errortext); } @@ -4087,7 +4089,8 @@ opt_server: server { $$ = $1; } | /* empty */ { $$ = EMPTY; } server_name: ColId { $$ = $1; } - | ColId '.' server_name { $$ = make3_str($1, make_str("."), $3); } + | ColId '.' server_name { $$ = make3_str($1, make_str("."), $3); } + | IP { $$ = make_name(); } opt_port: ':' Iconst { $$ = make2_str(make_str(":"), $2); } | /* empty */ { $$ = EMPTY; } |
