X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=src%2Fcokebank_sqlite%2Fmain.c;h=e53910502fc7c2b78b1368a56977955c66ac2e98;hb=10fc79a2f4f72165cb1ce1ba78c84faa8d56f5db;hp=bcb673599f6c05dcb5be570fe4a03af3cf7c83b3;hpb=f4603391737979ef0ffd939d8d3379430091aa08;p=tpg%2Fopendispense2.git diff --git a/src/cokebank_sqlite/main.c b/src/cokebank_sqlite/main.c index bcb6735..e539105 100644 --- a/src/cokebank_sqlite/main.c +++ b/src/cokebank_sqlite/main.c @@ -15,6 +15,8 @@ #include "../cokebank.h" #include +#define DEBUG 1 + const char * const csBank_DatabaseSetup = "CREATE TABLE IF NOT EXISTS accounts (" " acct_id INTEGER PRIMARY KEY NOT NULL," @@ -553,7 +555,9 @@ sqlite3_stmt *Bank_int_QuerySingle(sqlite3 *Database, const char *Query) // Prepare query ret = Bank_int_MakeStatemnt(Database, Query); if( !ret ) { + #if DEBUG printf("Bank_int_QuerySingle: RETURN NULL ret=NULL\n"); + #endif return NULL; } @@ -561,7 +565,9 @@ sqlite3_stmt *Bank_int_QuerySingle(sqlite3 *Database, const char *Query) rv = sqlite3_step(ret); // - Empty result set if( rv == SQLITE_DONE ) { + #if DEBUG printf("Bank_int_QuerySingle: RETURN NULL (rv == SQLITE_DONE)\n"); + #endif return NULL; } // - Other error @@ -571,7 +577,9 @@ sqlite3_stmt *Bank_int_QuerySingle(sqlite3 *Database, const char *Query) return NULL; } + #if DEBUG printf("Bank_int_QuerySingle: RETURN %p\n", ret); + #endif return ret; }