aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2009-12-02 01:56:21 +0000
committerrowanbeentje <rowan@beent.je>2009-12-02 01:56:21 +0000
commitaf16f1e3bb44a4a782dbe1bee18513ce7d4738c6 (patch)
treed219832403e19837591759b0fb8759921990dac0 /Source
parente80643e92666c6752940f791f3148fcfefe9bb4e (diff)
downloadsequelpro-af16f1e3bb44a4a782dbe1bee18513ce7d4738c6.tar.gz
sequelpro-af16f1e3bb44a4a782dbe1bee18513ce7d4738c6.tar.bz2
sequelpro-af16f1e3bb44a4a782dbe1bee18513ce7d4738c6.zip
- Improve import cancellation responsiveness, especially for lots of short data rows or slow connections
- Remove a debug NSLog on "Copy as SQL insert"
Diffstat (limited to 'Source')
-rw-r--r--Source/CMCopyTable.m1
-rw-r--r--Source/TableDump.m2
2 files changed, 2 insertions, 1 deletions
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)?@"<table>":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++) {