ECPGtypeinfocache_push(struct ECPGtype_information_cache **cache, int oid, bool isarray, int lineno)
{
struct ECPGtype_information_cache *new_entry
- = ecpg_alloc(sizeof(struct ECPGtype_information_cache), lineno);
+ = (struct ECPGtype_information_cache *) ecpg_alloc(sizeof(struct ECPGtype_information_cache), lineno);
new_entry->oid = oid;
new_entry->isarray = isarray;
new_entry->next = *cache;
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})*.*
}
return ICONST;
}
+<SQL>{ip} {
+ yylval.str = mm_strdup((char*)yytext);
+ return IP;
+ }
{decimal} {
yylval.str = mm_strdup((char*)yytext);
return FCONST;
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
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);
}
| /* 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; }
ECPGdebug(1, dbgs);
strcpy(msg, "connect");
- exec sql connect to unix:postgresql://localhost:5432/mm;
+ exec sql connect to unix:postgresql://127.0.0.1:5432/mm;
strcpy(msg, "create");
exec sql create table meskes(name char(8), born integer, age smallint, married date, children integer);
if (dbgs != NULL)
fclose(dbgs);
+
return (0);
}