fmdb icon indicating copy to clipboard operation
fmdb copied to clipboard

Missing error handling

Open air237 opened this issue 9 years ago • 0 comments

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.

air237 avatar Jun 13 '17 12:06 air237