From a3f0cd7a5c21c87f154956cb645cb41b1bb35821 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Thu, 20 Aug 2009 00:41:30 +0000 Subject: =?UTF-8?q?=20-=20Change=20MCPStreamingResult=20to=20use=20a=20saf?= =?UTF-8?q?er=20streaming=20mode=20by=20default=20-=20download=20all=20res?= =?UTF-8?q?ults=20as=20fast=20as=20possible=20from=20the=20server,=20to=20?= =?UTF-8?q?avoid=20blocking,=20but=20do=20so=20in=20a=20background=20threa?= =?UTF-8?q?d=20to=20allow=20results=20processing=20to=20start=20as=20soon?= =?UTF-8?q?=20as=20data=20is=20available.=20=20Many=20thanks=20to=20Hans-J?= =?UTF-8?q?=C3=B6rg=20Bibiko=20for=20assistance=20with=20this.=20=20-=20Ad?= =?UTF-8?q?d=20an=20option=20to=20the=20SQL=20export=20dialog=20to=20allow?= =?UTF-8?q?=20selection=20of=20the=20full-streaming=20method,=20with=20a?= =?UTF-8?q?=20warning=20that=20it=20may=20block=20table=20UPDATES/INSERTS.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MCPKit/MCPFoundationKit/MCPStreamingResult.h | 28 ++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'Frameworks/MCPKit/MCPFoundationKit/MCPStreamingResult.h') 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 -- cgit v1.2.3