aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPSQLExporter.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2011-05-14 17:26:18 +0000
committerstuconnolly <stuart02@gmail.com>2011-05-14 17:26:18 +0000
commit2dbae24c7735ead0524bd9847af6ea99d8654ec6 (patch)
tree87dbed4317214da2aa9e2aed493fd7b798b3e2bc /Source/SPSQLExporter.m
parent160728cd29519794b47b3a09b139ce9d604883f0 (diff)
downloadsequelpro-2dbae24c7735ead0524bd9847af6ea99d8654ec6.tar.gz
sequelpro-2dbae24c7735ead0524bd9847af6ea99d8654ec6.tar.bz2
sequelpro-2dbae24c7735ead0524bd9847af6ea99d8654ec6.zip
Bring outline view branch up to date with trunk (r3279:r3306).
Diffstat (limited to 'Source/SPSQLExporter.m')
-rw-r--r--Source/SPSQLExporter.m23
1 files changed, 12 insertions, 11 deletions
diff --git a/Source/SPSQLExporter.m b/Source/SPSQLExporter.m
index 3dfed305..4c7903fc 100644
--- a/Source/SPSQLExporter.m
+++ b/Source/SPSQLExporter.m
@@ -302,15 +302,16 @@
rowCount = [NSArrayObjectAtIndex(rowArray, 0) integerValue];
- // Set up a result set in streaming mode
- streamingResult = [[connection streamingQueryString:[NSString stringWithFormat:@"SELECT * FROM %@", [tableName backtickQuotedString]] useLowMemoryBlockingStreaming:([self exportUsingLowMemoryBlockingStreaming])] retain];
-
- NSArray *fieldNames = [streamingResult fetchFieldNames];
-
- // Inform the delegate that we are about to start writing data for the current table
- [delegate performSelectorOnMainThread:@selector(sqlExportProcessWillBeginWritingData:) withObject:self waitUntilDone:NO];
-
if (rowCount) {
+
+ // Set up a result set in streaming mode
+ streamingResult = [[connection streamingQueryString:[NSString stringWithFormat:@"SELECT * FROM %@", [tableName backtickQuotedString]] useLowMemoryBlockingStreaming:([self exportUsingLowMemoryBlockingStreaming])] retain];
+
+ NSArray *fieldNames = [streamingResult fetchFieldNames];
+
+ // Inform the delegate that we are about to start writing data for the current table
+ [delegate performSelectorOnMainThread:@selector(sqlExportProcessWillBeginWritingData:) withObject:self waitUntilDone:NO];
+
queryLength = 0;
// Lock the table for writing and disable keys if supported
@@ -474,6 +475,9 @@
// Drain the autorelease pool
[sqlExportPool release];
+
+ // Release the result set
+ [streamingResult release];
}
if ([connection queryErrored]) {
@@ -484,9 +488,6 @@
dataUsingEncoding:NSUTF8StringEncoding]];
}
}
-
- // Release the result set
- [streamingResult release];
}
queryResult = [connection queryString:[NSString stringWithFormat:@"/*!50003 SHOW TRIGGERS WHERE `Table` = %@ */;", [tableName tickQuotedString]]];