ccgus 14 年 前
コミット
40258d7c06
1 ファイル変更21 行追加7 行削除
  1. 21 7
      src/fmdb.m

+ 21 - 7
src/fmdb.m

@@ -902,11 +902,6 @@ int main (int argc, const char * argv[]) {
         
     }
     
-    NSLog(@"That was version %@ of sqlite", [FMDatabase sqliteLibVersion]);
-    
-    [pool release];
-    
-    
     FMDatabaseQueue *queue = [FMDatabaseQueue databaseQueueWithPath:dbPath];
     
     FMDBQuickCheck(queue);
@@ -947,6 +942,19 @@ int main (int argc, const char * argv[]) {
             // just mix things up a bit for demonstration purposes.
             if (nby % 2 == 1) {
                 [NSThread sleepForTimeInterval:.1];
+                
+                
+                [queue inTransaction:^(FMDatabase *db, BOOL *rollback) {
+                    NSLog(@"Starting query  %ld", nby);
+                    
+                    FMResultSet *rsl = [db executeQuery:@"select * from likefoo where foo like 'h%'"];
+                    while ([rsl next]) {
+                        ;// whatever.
+                    }
+                    
+                    NSLog(@"Ending query    %ld", nby);
+                }];
+                
             }
             
             if (nby % 3 == 1) {
@@ -954,11 +962,11 @@ int main (int argc, const char * argv[]) {
             }
             
             [queue inTransaction:^(FMDatabase *db, BOOL *rollback) {
-                NSLog(@"Starting %ld", nby);
+                NSLog(@"Starting update %ld", nby);
                 [db executeUpdate:@"insert into likefoo values ('1')"];
                 [db executeUpdate:@"insert into likefoo values ('2')"];
                 [db executeUpdate:@"insert into likefoo values ('3')"];
-                NSLog(@"Ending   %ld", nby);
+                NSLog(@"Ending update   %ld", nby);
             }];
         });
         
@@ -966,6 +974,12 @@ int main (int argc, const char * argv[]) {
     
     
     
+    NSLog(@"That was version %@ of sqlite", [FMDatabase sqliteLibVersion]);
+    
+    [pool release];
+    
+    
+    
     
     return 0;
 }