From af16f1e3bb44a4a782dbe1bee18513ce7d4738c6 Mon Sep 17 00:00:00 2001 From: rowanbeentje Date: Wed, 2 Dec 2009 01:56:21 +0000 Subject: - Improve import cancellation responsiveness, especially for lots of short data rows or slow connections - Remove a debug NSLog on "Copy as SQL insert" --- Source/CMCopyTable.m | 1 - Source/TableDump.m | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/CMCopyTable.m b/Source/CMCopyTable.m index 1848e2d9..159bcaf6 100644 --- a/Source/CMCopyTable.m +++ b/Source/CMCopyTable.m @@ -212,7 +212,6 @@ int MENU_EDIT_COPY_AS_SQL = 2002; else [types addObject:[NSNumber numberWithInt:1]]; // string (fallback coevally) } -NSLog([types description]); [result appendString:[NSString stringWithFormat:@"INSERT INTO %@ (%@)\nVALUES\n", [(selectedTable == nil)?@"":selectedTable backtickQuotedString], [tbHeader componentsJoinedAndBacktickQuoted]]]; diff --git a/Source/TableDump.m b/Source/TableDump.m index 50bba928..f1c2f678 100644 --- a/Source/TableDump.m +++ b/Source/TableDump.m @@ -689,6 +689,7 @@ // Extract and process any complete SQL queries that can be found in the strings parsed so far while (query = [sqlParser trimAndReturnStringToCharacter:';' trimmingInclusively:YES returningInclusively:NO]) { + if (progressCancelled) break; fileProcessedLength += [query lengthOfBytesUsingEncoding:sqlEncoding] + 1; // Skip blank or whitespace-only queries to avoid errors @@ -997,6 +998,7 @@ while ([parsedRows count] >= csvRowsPerQuery || (!csvRowArray && allDataRead && [parsedRows count])) { + if (progressCancelled) break; query = [[NSMutableString alloc] initWithString:insertBaseString]; csvRowsThisQuery = 0; for (i = 0; i < csvRowsPerQuery && i < [parsedRows count]; i++) { -- cgit v1.2.3