mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-09-20 19:27:53 +08:00
Consolidated calls to mdb_sql_reset
SQL engine was being reset in both dump_results functions. Rather than having several different functions responsible for resetting the engine depending on the circumstances, the reset now only occurs in run_query, the same function where the query is executed.
This commit is contained in:
@@ -205,14 +205,14 @@ run_query(FILE *out, MdbSQL *sql, char *mybuf, char *delimiter)
|
|||||||
else
|
else
|
||||||
printf("Index scanning %s using %s\n", table->name, table->scan_idx->name);
|
printf("Index scanning %s using %s\n", table->name, table->scan_idx->name);
|
||||||
}
|
}
|
||||||
if (noexec) {
|
/* If noexec != on, dump results */
|
||||||
mdb_sql_reset(sql);
|
if (!noexec) {
|
||||||
return;
|
if (pretty_print)
|
||||||
|
dump_results_pp(out, sql);
|
||||||
|
else
|
||||||
|
dump_results(out, sql, delimiter);
|
||||||
}
|
}
|
||||||
if (pretty_print)
|
mdb_sql_reset(sql);
|
||||||
dump_results_pp(out, sql);
|
|
||||||
else
|
|
||||||
dump_results(out, sql, delimiter);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -281,8 +281,6 @@ dump_results(FILE *out, MdbSQL *sql, char *delimiter)
|
|||||||
if (footers) {
|
if (footers) {
|
||||||
print_rows_retrieved(out, row_count);
|
print_rows_retrieved(out, row_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
mdb_sql_reset(sql);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -343,8 +341,6 @@ dump_results_pp(FILE *out, MdbSQL *sql)
|
|||||||
for (j=0;j<sql->num_columns;j++) {
|
for (j=0;j<sql->num_columns;j++) {
|
||||||
g_free(sql->bound_values[j]);
|
g_free(sql->bound_values[j]);
|
||||||
}
|
}
|
||||||
|
|
||||||
mdb_sql_reset(sql);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
Reference in New Issue
Block a user