aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.h
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-08-20 00:41:30 +0000
committerrowanbeentje <rowan@beent.je>2009-08-20 00:41:30 +0000
commita3f0cd7a5c21c87f154956cb645cb41b1bb35821 (patch)
tree444ec8c61df6c41bf4ab7c67b68d1d6666ff244d /Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.h
parentb30cc9d877f2dab24901ac9cf5c6e1f1835fb454 (diff)
downloadsequelpro-a3f0cd7a5c21c87f154956cb645cb41b1bb35821.tar.gz
sequelpro-a3f0cd7a5c21c87f154956cb645cb41b1bb35821.tar.bz2
sequelpro-a3f0cd7a5c21c87f154956cb645cb41b1bb35821.zip
- Change MCPStreamingResult to use a safer streaming mode by default - download all results as fast as possible from the server, to avoid blocking, but do so in a background thread to allow results processing to start as soon as data is available. Many thanks to Hans-Jörg Bibiko for assistance with this.
- Add an option to the SQL export dialog to allow selection of the full-streaming method, with a warning that it may block table UPDATES/INSERTS.
Diffstat (limited to 'Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.h')
-rw-r--r--Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.h b/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.h
index 168f85d3..ae296192 100644
--- a/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.h
+++ b/Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.h
@@ -1,5 +1,5 @@
//
-// $Id$
+// $Id$
//
// MCPStreamingResult.h
// sequel-pro
@@ -28,14 +28,34 @@
@class MCPConnection;
+typedef struct SP_MYSQL_ROWS {
+ char *data;
+ unsigned long *dataLengths;
+ struct SP_MYSQL_ROWS *nextRow;
+} LOCAL_ROW_DATA;
+
@interface MCPStreamingResult : MCPResult
{
- MCPConnection *parentConnection;
+ MCPConnection *parentConnection;
- MYSQL_FIELD *fieldDefinitions;
+ MYSQL_FIELD *fieldDefinitions;
+ BOOL fullyStreaming;
+ BOOL dataDownloaded;
+ BOOL dataFreed;
+ LOCAL_ROW_DATA *localDataStore;
+ LOCAL_ROW_DATA *currentDataStoreEntry;
+ LOCAL_ROW_DATA *localDataStoreLastEntry;
+ unsigned long localDataRows;
+ unsigned long localDataAllocated;
+ unsigned long downloadedRowCount;
+ unsigned long processedRowCount;
+ unsigned long freedRowCount;
}
- (id)initWithMySQLPtr:(MYSQL *)mySQLPtr encoding:(NSStringEncoding)theEncoding timeZone:(NSTimeZone *)theTimeZone connection:(MCPConnection *)theConnection;
+- (id)initWithMySQLPtr:(MYSQL *)mySQLPtr encoding:(NSStringEncoding)theEncoding timeZone:(NSTimeZone *)theTimeZone connection:(MCPConnection *)theConnection withFullStreaming:(BOOL)useFullStreaming;
+
+// Results fetching
- (NSArray *)fetchNextRowAsArray;
-@end
+@end \ No newline at end of file