Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
4b04b01a
Commit
4b04b01a
authored
May 25, 1999
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
b122e16a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
20 deletions
+28
-20
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+4
-0
src/interfaces/ecpg/preproc/preproc.y
src/interfaces/ecpg/preproc/preproc.y
+24
-20
No files found.
src/interfaces/ecpg/ChangeLog
View file @
4b04b01a
...
...
@@ -586,5 +586,9 @@ Mon May 17 18:13:30 CEST 1999
Fri May 21 18:13:44 CEST 1999
- 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 ecpg version to 2.6.0
src/interfaces/ecpg/preproc/preproc.y
View file @
4b04b01a
...
...
@@ -80,7 +80,7 @@ print_action(struct when *w)
static void
whenever_action(int mode)
{
if (
mode ==
1 && when_nf.code != W_NOTHING)
if (
(mode&1) ==
1 && when_nf.code != W_NOTHING)
{
output_line_number();
fprintf(yyout, "\nif (sqlca.sqlcode == ECPG_NOT_FOUND) ");
...
...
@@ -98,6 +98,8 @@ whenever_action(int mode)
fprintf(yyout, "\nif (sqlca.sqlcode < 0) ");
print_action(&when_error);
}
if ((mode&2) == 2)
fputc('}', yyout);
output_line_number();
}
...
...
@@ -525,7 +527,7 @@ output_statement(char * stmt, int mode)
{
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 '\"' */
for (i = 0;i < j; i++)
...
...
@@ -538,6 +540,7 @@ output_statement(char * stmt, int mode)
fputs("ECPGt_EOIT, ", yyout);
dump_variables(argsresult, 1);
fputs("ECPGt_EORT);", yyout);
mode |= 2;
whenever_action(mode);
free(stmt);
if (connection != NULL)
...
...
@@ -854,7 +857,7 @@ prog: statements;
statements: /* empty */
| statements statement
statement: ecpgstart opt_at stmt ';'
{ connection = NULL; }
statement: ecpgstart opt_at stmt ';'
{ connection = NULL; }
| ecpgstart stmt ';'
| ECPGDeclaration
| c_thing { fprintf(yyout, "%s", $1); free($1); }
...
...
@@ -903,8 +906,8 @@ stmt: AddAttrStmt { output_statement($1, 0); }
}
| RuleStmt { output_statement($1, 0); }
| TransactionStmt {
fprintf(yyout, "ECPGtrans(__LINE__, %s, \"%s\");", connection ? connection : "NULL", $1);
whenever_action(
0
);
fprintf(yyout, "
{
ECPGtrans(__LINE__, %s, \"%s\");", connection ? connection : "NULL", $1);
whenever_action(
2
);
free($1);
}
| ViewStmt { output_statement($1, 0); }
...
...
@@ -919,8 +922,8 @@ stmt: AddAttrStmt { output_statement($1, 0); }
if (connection)
yyerror("no at option for connect statement.\n");
fprintf(yyout, "ECPGconnect(__LINE__, %s, %d);", $1, autocommit);
whenever_action(
0
);
fprintf(yyout, "
{
ECPGconnect(__LINE__, %s, %d);", $1, autocommit);
whenever_action(
2
);
free($1);
}
| ECPGCursorStmt {
...
...
@@ -930,8 +933,9 @@ stmt: AddAttrStmt { output_statement($1, 0); }
if (connection)
yyerror("no at option for connect statement.\n");
fputc('{', yyout);
fputs($1, yyout);
whenever_action(
0
);
whenever_action(
2
);
free($1);
}
| ECPGDeclare {
...
...
@@ -941,16 +945,16 @@ stmt: AddAttrStmt { output_statement($1, 0); }
if (connection)
yyerror("no at option for disconnect statement.\n");
fprintf(yyout, "ECPGdisconnect(__LINE__, \"%s\");", $1);
whenever_action(
0
);
fprintf(yyout, "
{
ECPGdisconnect(__LINE__, \"%s\");", $1);
whenever_action(
2
);
free($1);
}
| ECPGExecute {
output_statement($1, 0);
}
| ECPGFree {
fprintf(yyout, "ECPGdeallocate(__LINE__, %s, \"%s\");", connection ? connection : "NULL", $1);
whenever_action(
0
);
fprintf(yyout, "
{
ECPGdeallocate(__LINE__, %s, \"%s\");", connection ? connection : "NULL", $1);
whenever_action(
2
);
free($1);
}
| ECPGOpen {
...
...
@@ -968,36 +972,36 @@ stmt: AddAttrStmt { output_statement($1, 0); }
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(ptr->argsinsert, 0);
dump_variables(argsinsert, 0);
fputs("ECPGt_EOIT, ", yyout);
dump_variables(ptr->argsresult, 0);
fputs("ECPGt_EORT);", yyout);
whenever_action(
0
);
whenever_action(
2
);
free($1);
}
| ECPGPrepare {
if (connection)
yyerror("no at option for set connection statement.\n");
fprintf(yyout, "ECPGprepare(__LINE__, %s);", $1);
whenever_action(
0
);
fprintf(yyout, "
{
ECPGprepare(__LINE__, %s);", $1);
whenever_action(
2
);
free($1);
}
| ECPGRelease { /* output already done */ }
| ECPGSetAutocommit {
fprintf(yyout, "ECPGsetcommit(__LINE__, \"%s\", %s);", $1, connection ? connection : "NULL");
whenever_action(
0
);
fprintf(yyout, "
{
ECPGsetcommit(__LINE__, \"%s\", %s);", $1, connection ? connection : "NULL");
whenever_action(
2
);
free($1);
}
| ECPGSetConnection {
if (connection)
yyerror("no at option for set connection statement.\n");
fprintf(yyout, "ECPGsetconn(__LINE__, %s);", $1);
whenever_action(
0
);
fprintf(yyout, "
{
ECPGsetconn(__LINE__, %s);", $1);
whenever_action(
2
);
free($1);
}
| ECPGTypedef {
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment