fmdb
fmdb copied to clipboard
Missing error handling
I received nil and the lastErrorCode is 0 by calling the -(FMResultSet *)executeQuery:(NSString *)sql withArgumentsInArray:(NSArray*)arrayArgs orDictionary:(NSDictionary *)dictionaryArgs orVAList:(va_list)args; function from FMDatabase.m.
This is an inconsistent state.
The root cause could be this part:
if (idx != queryCount) {
NSLog(@"Error: the bind count is not correct for the # of variables (executeQuery)");
sqlite3_finalize(pStmt);
_isExecutingStatement = NO;
return nil;
}
Just an NSLog but no error returns. There should be a not 0 errorCode.