chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.db-test.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
routesearch: check for failure of routesearch and report XCPU specially
[ypp-sc-tools.db-test.git]
/
yarrg
/
rssql.c
diff --git
a/yarrg/rssql.c
b/yarrg/rssql.c
index bfe60d6c8798be39920fa4cb50c88a336f2831de..23b3bd04af68ff56033d754a1dca60349797fe08 100644
(file)
--- a/
yarrg/rssql.c
+++ b/
yarrg/rssql.c
@@
-7,6
+7,7
@@
sqlite3_stmt *ss_ipair;
int islandtablesz;
DEBUG_DEFINE_DEBUGF(sql);
int islandtablesz;
DEBUG_DEFINE_DEBUGF(sql);
+DEBUG_DEFINE_SOME_DEBUGF(sql,debug2f);
static int busy_handler(void *u, int previous) {
debugf("[[DB BUSY %d]]",previous);
static int busy_handler(void *u, int previous) {
debugf("[[DB BUSY %d]]",previous);
@@
-14,10
+15,10
@@
static int busy_handler(void *u, int previous) {
return 1;
}
return 1;
}
-void setup_sql(
void
) {
+void setup_sql(
const char *database
) {
sqlite3_stmt *sst;
sqlite3_stmt *sst;
- SQL_MUST( sqlite3_open(
"OCEAN-Midnight.db"
, &db) );
+ SQL_MUST( sqlite3_open(
database
, &db) );
SQL_MUST( sqlite3_busy_handler(db, busy_handler, 0) );
sst= sql_prepare("BEGIN","(begin)");
SQL_MUST( sqlite3_busy_handler(db, busy_handler, 0) );
sst= sql_prepare("BEGIN","(begin)");
@@
-44,7
+45,7
@@
void sql_fatal(const char *stmt_what, int sqr, const char *act_what) {
void sql_bind(sqlite3_stmt *ss, int index, int value,
const char *ss_what, const char *val_what) {
void sql_bind(sqlite3_stmt *ss, int index, int value,
const char *ss_what, const char *val_what) {
- debugf("SQL BIND %s #%d = %d = %s\n", ss_what, index, value, val_what);
+ debug
2
f("SQL BIND %s #%d = %d = %s\n", ss_what, index, value, val_what);
int sqr= sqlite3_bind_int(ss, index, value);
if (sqr) sql_fatal(ss_what, sqr,
masprintf("bind #%d (%s)", index, val_what));
int sqr= sqlite3_bind_int(ss, index, value);
if (sqr) sql_fatal(ss_what, sqr,
masprintf("bind #%d (%s)", index, val_what));
@@
-84,10
+85,10
@@
int sql_step(sqlite3_stmt *ssh, const char *ssh_string,
sqr= sqlite3_step((ssh));
switch (sqr) {
case SQLITE_DONE:
sqr= sqlite3_step((ssh));
switch (sqr) {
case SQLITE_DONE:
- debugf("SQL %s DONE\n",ssh_string);
+ debug
2
f("SQL %s DONE\n",ssh_string);
return 0;
case SQLITE_ROW:
return 0;
case SQLITE_ROW:
- if (DEBUGP(sql)) {
+ if (DEBUGP(sql
2
)) {
int i;
fprintf(debug,"SQL %s R",ssh_string);
for (i=0; i<sqlite3_column_count(ssh); i++) {
int i;
fprintf(debug,"SQL %s R",ssh_string);
for (i=0; i<sqlite3_column_count(ssh); i++) {