Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 0a97c4a

Browse files
author
Michael Meskes
committed
Simplified parsing of connect rule.
1 parent 7e3a15b commit 0a97c4a

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

src/interfaces/ecpg/ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -969,5 +969,9 @@ Thu Oct 12 20:13:00 CEST 2000
969969
Mon Oct 16 21:33:17 CEST 2000
970970

971971
- Fixed handling of variables in connect rule.
972+
973+
Tue Oct 17 08:09:16 CEST 2000
974+
975+
- Simplified parsing ofr connect rule.
972976
- Set ecpg version to 2.8.0.
973977
- Set library version to 3.2.0.

src/interfaces/ecpg/preproc/preproc.y

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -465,12 +465,7 @@ stmt: AlterSchemaStmt { output_statement($1, 0, NULL, connection); }
465465
if (connection)
466466
mmerror(ET_ERROR, "no at option for connect statement.\n");
467467

468-
fputs("{ ECPGconnect(__LINE__,", yyout);
469-
470-
if ($1[1] == '?')
471-
fprintf(yyout, "%s, %s, %d);", argsinsert->variable->name, $1 + sizeof("\"?\","), autocommit);
472-
else
473-
fprintf(yyout, "%s, %d); ", $1, autocommit);
468+
fprintf(yyout, "{ ECPGconnect(__LINE__, %s, %d); ", $1, autocommit);
474469

475470
reset_variables();
476471

@@ -3975,6 +3970,8 @@ connection_target: database_name opt_server opt_port
39753970
{
39763971
if ($1[0] == '\"')
39773972
$$ = $1;
3973+
else if (strcmp($1, "?") == 0)
3974+
$$ = mm_strdup(argsinsert->variable->name);
39783975
else
39793976
$$ = make3_str(make_str("\""), $1, make_str("\""));
39803977
}

src/interfaces/ecpg/test/test_init.pgc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,11 @@ int j=1?1:2;
3434
/*int e=y->member; /* compile error */
3535
/*int c=10>>2; /* compile error */
3636
/*bool h=2||1; /* compile error */
37+
long long iax;
3738
exec sql end declare section;
3839

40+
iax = 40000000000LL;
41+
3942
/* not working */
4043
int f=fa();
4144

0 commit comments

Comments
 (0)