Commit 9309eac1 authored by Michael Meskes's avatar Michael Meskes

*** empty log message ***

parent 0eb5ab82
......@@ -837,5 +837,11 @@ Wed Mar 1 10:49:03 CET 2000
- Synced preproc.y with gram.y.
- Added output of arrays.
Thu Mar 2 11:25:09 CET 2000
- Fixed some parsing problems. A variable can now be a reserved
SQL keyword.
- Made sure double quotes in statements are correctly quoted.
- Set library version to 3.1.0.
- Set ecpg version to 2.7.0.
......@@ -39,7 +39,7 @@ extern const char *get_dtype(enum ECPGdtype);
extern void lex_init(void);
extern char *make_str(const char *);
extern void output_line_number(void);
extern void output_statement(char *, int, char *);
extern void output_statement(char *, int, char *, char *, struct arguments *, struct arguments *);
extern void output_simple_statement(char *);
extern char *hashline_number(void);
extern int yyparse(void);
......
......@@ -13,7 +13,15 @@ output_line_number()
void
output_simple_statement(char *cmd)
{
fputs(cmd, yyout);
int i, j = strlen(cmd);;
/* do this char by char as we have to filter '\"' */
for (i = 0; i < j; i++) {
if (cmd[i] != '"')
fputc(cmd[i], yyout);
else
fputs("\\\"", yyout);
}
output_line_number();
free(cmd);
}
......@@ -86,19 +94,20 @@ hashline_number(void)
}
void
output_statement(char * stmt, int mode, char *descriptor)
output_statement(char * stmt, int mode, char *descriptor,
char *con, struct arguments *insert, struct arguments *result)
{
int i, j=strlen(stmt);
int i, j = strlen(stmt);
if (descriptor == NULL)
fprintf(yyout, "{ ECPGdo(__LINE__, %s, \"", connection ? connection : "NULL");
fprintf(yyout, "{ ECPGdo(__LINE__, %s, \"", con ? con : "NULL");
else
fprintf(yyout, "{ ECPGdo_descriptor(__LINE__, %s, \"%s\", \"",
connection ? connection : "NULL", descriptor);
con ? con : "NULL", descriptor);
/* do this char by char as we have to filter '\"' */
for (i = 0;i < j; i++) {
if (stmt[i] != '\"')
for (i = 0; i < j; i++) {
if (stmt[i] != '"')
fputc(stmt[i], yyout);
else
fputs("\\\"", yyout);
......@@ -109,9 +118,9 @@ output_statement(char * stmt, int mode, char *descriptor)
fputs("\", ", yyout);
/* dump variables to C file */
dump_variables(argsinsert, 1);
dump_variables(insert, 1);
fputs("ECPGt_EOIT, ", yyout);
dump_variables(argsresult, 1);
dump_variables(result, 1);
fputs("ECPGt_EORT);", yyout);
}
else
......@@ -120,7 +129,8 @@ output_statement(char * stmt, int mode, char *descriptor)
mode |= 2;
whenever_action(mode);
free(stmt);
free(descriptor);
if (descriptor != NULL)
free(descriptor);
if (connection != NULL)
free(connection);
}
......
This diff is collapsed.
......@@ -222,8 +222,6 @@ dump_variables(struct arguments * list, int mode)
/* Then the current element and its indicator */
ECPGdump_a_type(yyout, list->variable->name, list->variable->type,
/* (list->indicator->type->typ != ECPGt_NO_INDICATOR) ? list->indicator->name : NULL,
(list->indicator->type->typ != ECPGt_NO_INDICATOR) ? list->indicator->type : NULL, NULL, NULL);*/
list->indicator->name, list->indicator->type, NULL, NULL);
/* Then release the list element. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment