Skip to content

Commit

Permalink
fix -nobefore option
Browse files Browse the repository at this point in the history
  • Loading branch information
gsauthof committed Jul 11, 2013
1 parent 8a680a2 commit 3335964
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1600,6 +1600,9 @@ static int pp_sql_before(const sqlexd *d, Statement *stmt, unsigned callback_nr)
if (stmt->type == FETCH && options.binary[OPT_SQL])
return 0;

// only initialize - no pretty-printing
if (!options.binary[OPT_BEFORE])
return 0;

if (state.callbacks[callback_nr].before_fn) {
int ret = state.callbacks[callback_nr]
Expand Down Expand Up @@ -1717,9 +1720,8 @@ void sqlcxt (void **v, unsigned int * i,

if (options.binary[OPT_FRAME])
tprintf("Calling oracle sqlcxt() ...\n");
if (options.binary[OPT_BEFORE])
for (unsigned i = 0; i < state.callbacks_registered; ++i)
pp_sql_before(d, &stmt, i);
for (unsigned i = 0; i < state.callbacks_registered; ++i)
pp_sql_before(d, &stmt, i);
}

STATS_BEGIN(options.binary[OPT_STATS]);
Expand Down

0 comments on commit 3335964

Please sign in to comment.