Ladies and Gents,
I'm using FMDB in an iOS application. I have some text in columns which exceeds 255 bytes. I use BASE and browse the database file, and I can query the length of the data in the columns... So I know my data is there and that it is longer than 255...
YET, when trying to pull out data from these columns, I always get a C string of exactly 255 bytes, and I have no clue whatsoever why.
Here's some piece of code (basically from - (NSString*)stringForColumnIndex:(int)columnIdx { of FMDB FMResultSet.m, and I can trap the error already there.
- (NSString*)stringForColumnIndex:(int)columnIdx {
if (sqlite3_column_type([_statement statement], columnIdx) == SQLITE_NULL || (columnIdx < 0)) {
return nil;
}
const char *c = (const char *)sqlite3_column_text([_statement statement], columnIdx);
int xx = strlen(c); //added by me, already here it is only 255 bytes
if (!c) {
// null row.
return nil;
}
return [NSString stringWithUTF8String:c];
}
What am I missing? I'm using the standard supplied libsqlite3.dylib, FMDB includes sqlite.h. I tried to google similar problems to no avail for hours now.