Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
4b04b01a
Commit
4b04b01a
authored
26 years ago
by
Michael Meskes
Browse files
Options
Downloads
Patches
Plain Diff
*** empty log message ***
parent
b122e16a
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/interfaces/ecpg/ChangeLog
+4
-0
4 additions, 0 deletions
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/preproc/preproc.y
+24
-20
24 additions, 20 deletions
src/interfaces/ecpg/preproc/preproc.y
with
28 additions
and
20 deletions
src/interfaces/ecpg/ChangeLog
+
4
−
0
View file @
4b04b01a
...
@@ -586,5 +586,9 @@ Mon May 17 18:13:30 CEST 1999
...
@@ -586,5 +586,9 @@ Mon May 17 18:13:30 CEST 1999
Fri May 21 18:13:44 CEST 1999
Fri May 21 18:13:44 CEST 1999
- Synced preproc.y with gram.y.
- Synced preproc.y with gram.y.
Sun May 23 11:19:32 CEST 1999
- Add braces around each statement so that a simple if/else works.
- Set library version to 3.0.0
- Set library version to 3.0.0
- Set ecpg version to 2.6.0
- Set ecpg version to 2.6.0
This diff is collapsed.
Click to expand it.
src/interfaces/ecpg/preproc/preproc.y
+
24
−
20
View file @
4b04b01a
...
@@ -80,7 +80,7 @@ print_action(struct when *w)
...
@@ -80,7 +80,7 @@ print_action(struct when *w)
static void
static void
whenever_action(int mode)
whenever_action(int mode)
{
{
if (mode == 1 && when_nf.code != W_NOTHING)
if
(
(mode
&1)
==
1 && when_nf.code != W_NOTHING)
{
{
output_line_number();
output_line_number();
fprintf(yyout, "\nif (sqlca.sqlcode == ECPG_NOT_FOUND) ");
fprintf(yyout, "\nif (sqlca.sqlcode == ECPG_NOT_FOUND) ");
...
@@ -98,6 +98,8 @@ whenever_action(int mode)
...
@@ -98,6 +98,8 @@ whenever_action(int mode)
fprintf(yyout, "\nif (sqlca.sqlcode < 0) ");
fprintf(yyout, "\nif (sqlca.sqlcode < 0) ");
print_action(&when_error);
print_action(&when_error);
}
}
if ((mode&2) == 2)
fputc('}', yyout);
output_line_number();
output_line_number();
}
}
...
@@ -525,7 +527,7 @@ output_statement(char * stmt, int mode)
...
@@ -525,7 +527,7 @@ output_statement(char * stmt, int mode)
{
{
int i, j=strlen(stmt);
int i, j=strlen(stmt);
fprintf(yyout, "ECPGdo(__LINE__, %s, \"", connection ? connection : "NULL");
fprintf(yyout, "
{
ECPGdo(__LINE__, %s, \"", connection ? connection : "NULL");
/* do this char by char as we have to filter '\"' */
/* do this char by char as we have to filter '\"' */
for (i = 0;i < j; i++)
for (i = 0;i < j; i++)
...
@@ -538,6 +540,7 @@ output_statement(char * stmt, int mode)
...
@@ -538,6 +540,7 @@ output_statement(char * stmt, int mode)
fputs("ECPGt_EOIT, ", yyout);
fputs("ECPGt_EOIT, ", yyout);
dump_variables(argsresult, 1);
dump_variables(argsresult, 1);
fputs("ECPGt_EORT);", yyout);
fputs("ECPGt_EORT);", yyout);
mode |= 2;
whenever_action(mode);
whenever_action(mode);
free(stmt);
free(stmt);
if (connection != NULL)
if (connection != NULL)
...
@@ -854,7 +857,7 @@ prog: statements;
...
@@ -854,7 +857,7 @@ prog: statements;
statements: /* empty */
statements: /* empty */
| statements statement
| statements statement
statement: ecpgstart opt_at stmt ';'
{ connection = NULL; }
statement: ecpgstart opt_at stmt ';'
{ connection = NULL; }
| ecpgstart stmt ';'
| ecpgstart stmt ';'
| ECPGDeclaration
| ECPGDeclaration
| c_thing { fprintf(yyout, "%s", $1); free($1); }
| c_thing { fprintf(yyout, "%s", $1); free($1); }
...
@@ -903,8 +906,8 @@ stmt: AddAttrStmt { output_statement($1, 0); }
...
@@ -903,8 +906,8 @@ stmt: AddAttrStmt { output_statement($1, 0); }
}
}
| RuleStmt { output_statement($1, 0); }
| RuleStmt { output_statement($1, 0); }
| TransactionStmt {
| TransactionStmt {
fprintf(yyout, "ECPGtrans(__LINE__, %s, \"%s\");", connection ? connection : "NULL", $1);
fprintf(yyout, "
{
ECPGtrans(__LINE__, %s, \"%s\");", connection ? connection : "NULL", $1);
whenever_action(
0
);
whenever_action(
2
);
free($1);
free($1);
}
}
| ViewStmt { output_statement($1, 0); }
| ViewStmt { output_statement($1, 0); }
...
@@ -919,8 +922,8 @@ stmt: AddAttrStmt { output_statement($1, 0); }
...
@@ -919,8 +922,8 @@ stmt: AddAttrStmt { output_statement($1, 0); }
if (connection)
if (connection)
yyerror("no at option for connect statement.\n");
yyerror("no at option for connect statement.\n");
fprintf(yyout, "ECPGconnect(__LINE__, %s, %d);", $1, autocommit);
fprintf(yyout, "
{
ECPGconnect(__LINE__, %s, %d);", $1, autocommit);
whenever_action(
0
);
whenever_action(
2
);
free($1);
free($1);
}
}
| ECPGCursorStmt {
| ECPGCursorStmt {
...
@@ -930,8 +933,9 @@ stmt: AddAttrStmt { output_statement($1, 0); }
...
@@ -930,8 +933,9 @@ stmt: AddAttrStmt { output_statement($1, 0); }
if (connection)
if (connection)
yyerror("no at option for connect statement.\n");
yyerror("no at option for connect statement.\n");
fputc('{', yyout);
fputs($1, yyout);
fputs($1, yyout);
whenever_action(
0
);
whenever_action(
2
);
free($1);
free($1);
}
}
| ECPGDeclare {
| ECPGDeclare {
...
@@ -941,16 +945,16 @@ stmt: AddAttrStmt { output_statement($1, 0); }
...
@@ -941,16 +945,16 @@ stmt: AddAttrStmt { output_statement($1, 0); }
if (connection)
if (connection)
yyerror("no at option for disconnect statement.\n");
yyerror("no at option for disconnect statement.\n");
fprintf(yyout, "ECPGdisconnect(__LINE__, \"%s\");", $1);
fprintf(yyout, "
{
ECPGdisconnect(__LINE__, \"%s\");", $1);
whenever_action(
0
);
whenever_action(
2
);
free($1);
free($1);
}
}
| ECPGExecute {
| ECPGExecute {
output_statement($1, 0);
output_statement($1, 0);
}
}
| ECPGFree {
| ECPGFree {
fprintf(yyout, "ECPGdeallocate(__LINE__, %s, \"%s\");", connection ? connection : "NULL", $1);
fprintf(yyout, "
{
ECPGdeallocate(__LINE__, %s, \"%s\");", connection ? connection : "NULL", $1);
whenever_action(
0
);
whenever_action(
2
);
free($1);
free($1);
}
}
| ECPGOpen {
| ECPGOpen {
...
@@ -968,36 +972,36 @@ stmt: AddAttrStmt { output_statement($1, 0); }
...
@@ -968,36 +972,36 @@ stmt: AddAttrStmt { output_statement($1, 0); }
yyerror(errortext);
yyerror(errortext);
}
}
fprintf(yyout, "ECPGdo(__LINE__, %s, \"%s\",", ptr->connection ? ptr->connection : "NULL", ptr->command);
fprintf(yyout, "
{
ECPGdo(__LINE__, %s, \"%s\",", ptr->connection ? ptr->connection : "NULL", ptr->command);
/* dump variables to C file*/
/* dump variables to C file*/
dump_variables(ptr->argsinsert, 0);
dump_variables(ptr->argsinsert, 0);
dump_variables(argsinsert, 0);
dump_variables(argsinsert, 0);
fputs("ECPGt_EOIT, ", yyout);
fputs("ECPGt_EOIT, ", yyout);
dump_variables(ptr->argsresult, 0);
dump_variables(ptr->argsresult, 0);
fputs("ECPGt_EORT);", yyout);
fputs("ECPGt_EORT);", yyout);
whenever_action(
0
);
whenever_action(
2
);
free($1);
free($1);
}
}
| ECPGPrepare {
| ECPGPrepare {
if (connection)
if (connection)
yyerror("no at option for set connection statement.\n");
yyerror("no at option for set connection statement.\n");
fprintf(yyout, "ECPGprepare(__LINE__, %s);", $1);
fprintf(yyout, "
{
ECPGprepare(__LINE__, %s);", $1);
whenever_action(
0
);
whenever_action(
2
);
free($1);
free($1);
}
}
| ECPGRelease { /* output already done */ }
| ECPGRelease { /* output already done */ }
| ECPGSetAutocommit {
| ECPGSetAutocommit {
fprintf(yyout, "ECPGsetcommit(__LINE__, \"%s\", %s);", $1, connection ? connection : "NULL");
fprintf(yyout, "
{
ECPGsetcommit(__LINE__, \"%s\", %s);", $1, connection ? connection : "NULL");
whenever_action(
0
);
whenever_action(
2
);
free($1);
free($1);
}
}
| ECPGSetConnection {
| ECPGSetConnection {
if (connection)
if (connection)
yyerror("no at option for set connection statement.\n");
yyerror("no at option for set connection statement.\n");
fprintf(yyout, "ECPGsetconn(__LINE__, %s);", $1);
fprintf(yyout, "
{
ECPGsetconn(__LINE__, %s);", $1);
whenever_action(
0
);
whenever_action(
2
);
free($1);
free($1);
}
}
| ECPGTypedef {
| ECPGTypedef {
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment