1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-24 00:23:06 +03:00

*** empty log message ***

This commit is contained in:
Michael Meskes
2000-09-21 11:56:08 +00:00
parent eab8ee9524
commit b4c8d47ab0
5 changed files with 22 additions and 8 deletions

View File

@@ -12,7 +12,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.61 2000/09/19 11:47:14 meskes Exp $
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.62 2000/09/21 11:56:07 meskes Exp $
*
*-------------------------------------------------------------------------
*/
@@ -260,6 +260,8 @@ elif [eE][lL][iI][fF]
endif [eE][nN][dD][iI][fF]
exec_sql {exec}{space_or_nl}*{sql}{space_or_nl}*
ipdigit ({digit}|{digit}{digit}|{digit}{digit}{digit})
ip {ipdigit}\.{ipdigit}\.{ipdigit}\.{ipdigit}
/* Take care of cpp continuation lines */
cppline {space}*#(.*\\{line_end})*.*
@@ -516,6 +518,10 @@ cppline {space}*#(.*\\{line_end})*.*
}
return ICONST;
}
<SQL>{ip} {
yylval.str = mm_strdup((char*)yytext);
return IP;
}
{decimal} {
yylval.str = mm_strdup((char*)yytext);
return FCONST;

View File

@@ -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; }