static int committed = true;
static void
-register_error(int code, char *fmt,...)
+register_error(long code, char *fmt,...)
{
va_list args;
long offset, ind_offset;
enum ECPGttype ind_type;
+ memset((char *) &sqlca, 0, sizeof (sqlca));
va_start(ap, query);
- sqlca.sqlcode = 0;
copiedquery = strdup(query);
type = va_arg(ap, enum ECPGttype);
default:
break;
}
+ sqlca.sqlwarn[0] = sqlca.sqlwarn[1] = 'W';
}
}
}
default:
break;
}
+ sqlca.sqlwarn[0] = sqlca.sqlwarn[1] = 'W';
var->len = varcharsize;
}
%type <str> group_clause groupby_list groupby having_clause from_clause
%type <str> from_list from_val join_expr join_outer join_spec join_list
%type <str> join_using where_clause relation_expr row_op sub_type
-%type <str> opt_column_list insert_rest InsertStmt
+%type <str> opt_column_list insert_rest InsertStmt OptimizableStmt
%type <str> columnList DeleteStmt LockStmt UpdateStmt CursorStmt
-%type <str> NotifyStmt columnElem copy_dirn OptimizableStmt
+%type <str> NotifyStmt columnElem copy_dirn
%type <str> copy_delimiter ListenStmt CopyStmt copy_file_name opt_binary
%type <str> opt_with_copy FetchStmt opt_direction fetch_how_many opt_portal_name
%type <str> ClosePortalStmt DestroyStmt VacuumStmt opt_verbose
%type <action> action
%type <index> opt_array_bounds nest_array_bounds
+
%%
prog: statements;
| RemoveStmt { output_statement($1, 0); }
| RenameStmt { output_statement($1, 0); }
| RevokeStmt { output_statement($1, 0); }
- | OptimizableStmt { /* output already written */ }
+ | OptimizableStmt {
+ if (strncmp($1, "/* declare" , sizeof("/* declare")-1) == 0)
+ {
+ fputs($1, yyout);
+ output_line_number();
+ free($1);
+ }
+ else
+ output_statement($1, 1);
+ }
| RuleStmt { output_statement($1, 0); }
| TransactionStmt {
fprintf(yyout, "ECPGtrans(__LINE__, \"%s\");", $1);
| OptStmtMulti OptimizableStmt
{ $$ = cat2_str($1, $2); }
| OptimizableStmt ';'
- { $$ = $1; }
+ { $$ = cat2_str($1, make1_str(";")); }
;
event_object: relation_name '.' attr_name
* *
*****************************************************************************/
-OptimizableStmt: SelectStmt { output_statement($1, 1); }
- | CursorStmt
- {
- fputs($1, yyout);
- output_line_number();
- free($1);
- }
- | UpdateStmt { output_statement($1, 0); }
- | InsertStmt { output_statement($1, 0); }
- | NotifyStmt { output_statement($1, 0); }
- | DeleteStmt { output_statement($1, 0); }
+OptimizableStmt: SelectStmt
+ | CursorStmt
+ | UpdateStmt
+ | InsertStmt
+ | NotifyStmt
+ | DeleteStmt
;
cur = this;
}
- $$ = cat5_str(make1_str("/* declare cursor\""), $2, make1_str("\"statement has been moved to location of open cursor \""), strdup($2), make1_str("\"statement. */"));
+ $$ = make5_str(make1_str("/* declare cursor \""), $2, make1_str("\" statement has been moved to location of open cursor \""), strdup($2), make1_str("\" statement. */"));
}
;
add_variable(&argsinsert, find_variable($1), ($2 == NULL) ? &no_indicator : find_variable($2));
}
-civariableonly : cvariable name {
+civariableonly : cvariable {
add_variable(&argsinsert, find_variable($1), &no_indicator);
}