oops: the test is equality with 'epoch'

This commit is contained in:
Eric House 2013-09-25 07:33:41 -07:00
parent 31fa2ea442
commit 63067dc374

View file

@ -927,7 +927,7 @@ DBMgr::CountStoredMessages( const char* const connName, int hid )
StrWPF test; StrWPF test;
test.printf( "connname = '%s'", connName ); test.printf( "connname = '%s'", connName );
#ifdef HAVE_STIME #ifdef HAVE_STIME
test.printf( " AND stime IS NULL" ); test.printf( " AND stime = 'epoch'" );
#endif #endif
if ( hid != -1 ) { if ( hid != -1 ) {
test.printf( " AND hid = %d", hid ); test.printf( " AND hid = %d", hid );
@ -948,7 +948,7 @@ DBMgr::CountStoredMessages( DevIDRelay relayID )
StrWPF test; StrWPF test;
test.printf( "devid = %d", relayID ); test.printf( "devid = %d", relayID );
#ifdef HAVE_STIME #ifdef HAVE_STIME
test.printf( "AND stime IS NULL" ); test.printf( "AND stime = 'epoch'" );
#endif #endif
return getCountWhere( MSGS_TABLE, test ); return getCountWhere( MSGS_TABLE, test );
@ -1069,7 +1069,7 @@ DBMgr::storedMessagesImpl( string test, vector<DBMgr::MsgInfo>& msgs,
query.printf( "SELECT id, msg64, msg, msglen, token, connname FROM " query.printf( "SELECT id, msg64, msg, msglen, token, connname FROM "
MSGS_TABLE " WHERE %s " MSGS_TABLE " WHERE %s "
#ifdef HAVE_STIME #ifdef HAVE_STIME
" AND stime IS NULL " " AND stime = 'epoch' "
#endif #endif
" AND (connname IN (SELECT connname FROM " GAMES_TABLE " AND (connname IN (SELECT connname FROM " GAMES_TABLE
" WHERE NOT " GAMES_TABLE ".dead)", test.c_str() ); " WHERE NOT " GAMES_TABLE ".dead)", test.c_str() );