|
|
@@ -233,44 +233,6 @@ int main (int argc, const char * argv[]) {
|
|
|
|
|
|
#endif
|
|
|
|
|
|
- // -------------------------------------------------------------------------------
|
|
|
- // executeBulkSQL tests.
|
|
|
-
|
|
|
- {
|
|
|
- NSString *sql = @"create table if not exists test1 (id integer primary key autoincrement, x text);"
|
|
|
- "create table if not exists test2 (id integer primary key autoincrement, y text);"
|
|
|
- "create table if not exists test3 (id integer primary key autoincrement, z text);"
|
|
|
- "insert into test1 (x) values ('XXX');"
|
|
|
- "insert into test2 (y) values ('YYY');"
|
|
|
- "insert into test3 (z) values ('ZZZ');";
|
|
|
-
|
|
|
- FMDBQuickCheck([db executeBulkSQL:sql]);
|
|
|
- }
|
|
|
-
|
|
|
- {
|
|
|
- NSString *sql = @"select count(*) as count from test1;"
|
|
|
- "select count(*) as count from test2;"
|
|
|
- "select count(*) as count from test3;";
|
|
|
-
|
|
|
- FMDBQuickCheck([db executeBulkSQL:sql block:^int(NSDictionary *dictionary) {
|
|
|
- NSInteger count = [dictionary[@"count"] integerValue];
|
|
|
- if (count == 0) {
|
|
|
- NSLog(@"executeBulkSQL: error: was expecting non-zero number of records; dictionary = %@", dictionary);
|
|
|
- } else {
|
|
|
- NSLog(@"executeBulkSQL: everything ok: dictionary = %@", dictionary);
|
|
|
- }
|
|
|
- return 0;
|
|
|
- }]);
|
|
|
- }
|
|
|
-
|
|
|
- {
|
|
|
- NSString *sql = @"drop table test1;"
|
|
|
- "drop table test2;"
|
|
|
- "drop table test3;";
|
|
|
-
|
|
|
- FMDBQuickCheck([db executeBulkSQL:sql]);
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
{
|
|
|
// -------------------------------------------------------------------------------
|
|
|
@@ -383,7 +345,7 @@ int main (int argc, const char * argv[]) {
|
|
|
|
|
|
// test the busy rety timeout schtuff.
|
|
|
|
|
|
- [db setBusyTimeout:5];
|
|
|
+ [db setMaxBusyRetryTimeInterval:5];
|
|
|
|
|
|
FMDatabase *newDb = [FMDatabase databaseWithPath:dbPath];
|
|
|
[newDb open];
|