diff --git a/CHANGES_AND_TODO_LIST.txt b/CHANGES_AND_TODO_LIST.txt index f6fc857b..d53c0b14 100644 --- a/CHANGES_AND_TODO_LIST.txt +++ b/CHANGES_AND_TODO_LIST.txt @@ -3,6 +3,12 @@ Zip, nada, zilch. Got any ideas? If you would like to contribute some code- awesome! I just ask that you make it conform to the coding conventions already set in here, and to add a couple of tests for your new code to fmdb.m. And of course, the code should be of general use to more than just a couple of folks. Send your patches to gus@flyingmeat.com. + +2012.03.22: + Deprecated resultDict and replaced it with resultDictionary on FMResultSet. Slight change in behavior as well- resultDictionary will return case sensitive keys. + Fixed a problem with getTableSchema: not working with table names that start with a number. + + 2012.02.10: Changed up FMDatabasePool so that you can't "pop" it from a pool anymore. I just consider this too risky- use the block based functions instead. Also provided a good reason in main.m for why you should use FMDatabaseQueue instead. Search for "ONLY_USE_THE_POOL_IF_YOU_ARE_DOING_READS". diff --git a/src/FMDatabaseAdditions.m b/src/FMDatabaseAdditions.m index 43383536..784af483 100644 --- a/src/FMDatabaseAdditions.m +++ b/src/FMDatabaseAdditions.m @@ -89,7 +89,7 @@ - (FMResultSet*)getSchema { - (FMResultSet*)getTableSchema:(NSString*)tableName { //result colums: cid[INTEGER], name,type [STRING], notnull[INTEGER], dflt_value[],pk[INTEGER] - FMResultSet *rs = [self executeQuery:[NSString stringWithFormat: @"PRAGMA table_info(%@)", tableName]]; + FMResultSet *rs = [self executeQuery:[NSString stringWithFormat: @"PRAGMA table_info('%@')", tableName]]; return rs; } diff --git a/src/fmdb.m b/src/fmdb.m index 5812c96d..1543a9c6 100644 --- a/src/fmdb.m +++ b/src/fmdb.m @@ -150,6 +150,15 @@ int main (int argc, const char * argv[]) { } + // check funky table names + getTableSchema + [db executeUpdate:@"create table '234 fds' (foo text)"]; + FMDBQuickCheck(![db hadError]); + rs = [db getTableSchema:@"234 fds"]; + FMDBQuickCheck([rs next]); + [rs close]; + + + // ---------------------------------------------------------------------------------------- // blob support. [db executeUpdate:@"create table blobTable (a text, b blob)"];