X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=yarrg%2Frssql.c;h=898ac3b268350b4824021ba987002622600c88e3;hb=0145dc7f4fcaf62090a77fb2d69d5d7807c8d48d;hp=463ef8b560c76dff97b047b22db55f5e4b7d73ca;hpb=22f2c2e0c21461f4a5e78b9735bf6395cb7a367f;p=ypp-sc-tools.db-live.git diff --git a/yarrg/rssql.c b/yarrg/rssql.c index 463ef8b..898ac3b 100644 --- a/yarrg/rssql.c +++ b/yarrg/rssql.c @@ -4,6 +4,8 @@ sqlite3 *db; sqlite3_stmt *ss_ipair; +int islandtablesz; + DEBUG_DEFINE_DEBUGF(sql); static int busy_handler(void *u, int previous) { @@ -12,7 +14,7 @@ static int busy_handler(void *u, int previous) { return 1; } -void setup(void) { +void setup_sql(void) { sqlite3_stmt *sst; SQL_MUST( sqlite3_open("OCEAN-Midnight.db", &db) ); @@ -22,7 +24,8 @@ void setup(void) { assert( !SQL_STEP(sst) ); sqlite3_finalize(sst); - setup_value(); + islandtablesz= 1 + sql_single_int("SELECT max(islandid) FROM islands"); + debugf("SQL islandtablesz=%d\n",islandtablesz); } int sql_single_int(const char *stmt) {