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

Commitb4c8d47

Browse files
author
Michael Meskes
committed
*** empty log message ***
1 parenteab8ee9 commitb4c8d47

File tree

5 files changed

+22
-8
lines changed

5 files changed

+22
-8
lines changed

‎src/interfaces/ecpg/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -940,5 +940,9 @@ Mit Sep 20 12:40:27 PDT 2000
940940
backend NOTICEs.
941941
- Added patch by Christof Petig <christof.petig@wtal.de> to cache
942942
type information.
943+
944+
Don Sep 21 13:54:13 PDT 2000
945+
946+
- Enabled parser to accept ip addresses instead of host names.
943947
- Set ecpg version to 2.8.0.
944948
- Set library version to 3.2.0.

‎src/interfaces/ecpg/lib/execute.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ static void
262262
ECPGtypeinfocache_push(structECPGtype_information_cache**cache,intoid,boolisarray,intlineno)
263263
{
264264
structECPGtype_information_cache*new_entry
265-
=ecpg_alloc(sizeof(structECPGtype_information_cache),lineno);
265+
=(structECPGtype_information_cache*)ecpg_alloc(sizeof(structECPGtype_information_cache),lineno);
266266
new_entry->oid=oid;
267267
new_entry->isarray=isarray;
268268
new_entry->next=*cache;
@@ -989,7 +989,7 @@ ECPGdo(int lineno, const char *connection_name, char *query,...)
989989
*
990990
* Copyright (c) 2000, Christof Petig <christof.petig@wtal.de>
991991
*
992-
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.9 2000/09/20 13:25:51 meskes Exp $
992+
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.10 2000/09/21 11:56:07 meskes Exp $
993993
*/
994994

995995
PGconn*ECPG_internal_get_connection(char*name);

‎src/interfaces/ecpg/preproc/pgc.l

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
*
1414
* IDENTIFICATION
15-
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.61 2000/09/19 11:47:14 meskes Exp $
15+
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.62 2000/09/21 11:56:07 meskes Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -260,6 +260,8 @@ elif[eE][lL][iI][fF]
260260
endif[eE][nN][dD][iI][fF]
261261

262262
exec_sql{exec}{space_or_nl}*{sql}{space_or_nl}*
263+
ipdigit({digit}|{digit}{digit}|{digit}{digit}{digit})
264+
ip{ipdigit}\.{ipdigit}\.{ipdigit}\.{ipdigit}
263265

264266
/* Take care of cpp continuation lines */
265267
cppline{space}*#(.*\\{line_end})*.*
@@ -516,6 +518,10 @@ cppline{space}*#(.*\\{line_end})*.*
516518
}
517519
return ICONST;
518520
}
521+
<SQL>{ip}{
522+
yylval.str =mm_strdup((char*)yytext);
523+
return IP;
524+
}
519525
{decimal}{
520526
yylval.str =mm_strdup((char*)yytext);
521527
return FCONST;

‎src/interfaces/ecpg/preproc/preproc.y

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ make_name(void)
239239
VALID,VERBOSE,VERSION
240240

241241
/* Special keywords, not in the query language - see the "lex" file*/
242-
%token<str>IDENTSCONSTOpCSTRINGCVARIABLECPP_LINE
242+
%token<str>IDENTSCONSTOpCSTRINGCVARIABLECPP_LINEIP
243243
%token<ival>ICONSTPARAM
244244
%token<dval>FCONST
245245

@@ -4029,9 +4029,11 @@ connection_target: database_name opt_server opt_port
40294029
mmerror(ET_ERROR, errortext);
40304030
}
40314031

4032-
if (strncmp($1,"unix", strlen("unix")) ==0 && strncmp($3 + strlen("//"),"localhost", strlen("localhost")) !=0)
4032+
if (strncmp($1,"unix", strlen("unix")) ==0 &&
4033+
strncmp($3 + strlen("//"), "localhost", strlen("localhost")) != 0 &&
4034+
strncmp($3 + strlen("//"), "127.0.0.1", strlen("127.0.0.1")) != 0)
40334035
{
4034-
sprintf(errortext,"unix domain sockets only work on 'localhost' but not on '%9.9s'", $3 +strlen("//"));
4036+
sprintf(errortext,"unix domain sockets only work on 'localhost' but not on '%9.9s'", $3 +strlen("//"));
40354037
mmerror(ET_ERROR, errortext);
40364038
}
40374039

@@ -4087,7 +4089,8 @@ opt_server: server { $$ = $1; }
40874089
|/* empty*/ {$$ = EMPTY; }
40884090

40894091
server_name:ColId {$$ =$1; }
4090-
|ColId'.'server_name {$$ = make3_str($1, make_str("."),$3); }
4092+
|ColId'.'server_name {$$ = make3_str($1, make_str("."),$3); }
4093+
|IP{$$ = make_name(); }
40914094

40924095
opt_port:':'Iconst {$$ = make2_str(make_str(":"),$2); }
40934096
|/* empty*/ {$$ = EMPTY; }

‎src/interfaces/ecpg/test/test2.pgc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ exec sql end declare section;
4242
ECPGdebug(1, dbgs);
4343

4444
strcpy(msg, "connect");
45-
exec sql connect to unix:postgresql://localhost:5432/mm;
45+
exec sql connect to unix:postgresql://127.0.0.1:5432/mm;
4646

4747
strcpy(msg, "create");
4848
exec sql create table meskes(name char(8), born integer, age smallint, married date, children integer);
@@ -124,5 +124,6 @@ exec sql end declare section;
124124
if (dbgs != NULL)
125125
fclose(dbgs);
126126

127+
127128
return (0);
128129
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp