diff options
author | rowanbeentje <rowan@beent.je> | 2010-03-16 02:04:50 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2010-03-16 02:04:50 +0000 |
commit | 332f6201ce607a6622fadfd3e6426e4571dc035f (patch) | |
tree | 4e86f4ac81a9b13487482a8ec95dd2dc273f71d3 /Source/TableDump.m | |
parent | 1bfe991970009b1e7011823a00e676271fc04055 (diff) | |
download | sequelpro-332f6201ce607a6622fadfd3e6426e4571dc035f.tar.gz sequelpro-332f6201ce607a6622fadfd3e6426e4571dc035f.tar.bz2 sequelpro-332f6201ce607a6622fadfd3e6426e4571dc035f.zip |
- Make a number of changes to attempt to improve disconnection/quit crashes: prevent multiple disconnects, add more checks, cancel current queries, and add a tiny delay to allow mysql cleanup.
- Alter MCPStreamingResult to no longer return a retained instance, setting up correct result disposal on autorelease but changing callers to retain as soon as they receive.
- Review and change a number of local variables shadowing/shielding other local or global variables.
Diffstat (limited to 'Source/TableDump.m')
-rw-r--r-- | Source/TableDump.m | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/TableDump.m b/Source/TableDump.m index 90b753a6..d50d2b85 100644 --- a/Source/TableDump.m +++ b/Source/TableDump.m @@ -1311,7 +1311,7 @@ NSMutableString *setString = [NSMutableString stringWithString:@""]; NSMutableString *whereString = [NSMutableString stringWithString:@"WHERE "]; - NSInteger i, j; + NSInteger i; NSInteger mapColumn; id cellData; NSInteger mappingArrayCount = [fieldMappingArray count]; @@ -1595,7 +1595,7 @@ rowCount = [[[[mySQLConnection queryString:[NSString stringWithFormat:@"SELECT COUNT(1) FROM %@", [tableName backtickQuotedString]]] fetchRowAsArray] objectAtIndex:0] integerValue]; // Set up a result set in streaming mode - streamingResult = [mySQLConnection streamingQueryString:[NSString stringWithFormat:@"SELECT * FROM %@", [tableName backtickQuotedString]] useLowMemoryBlockingStreaming:([sqlFullStreamingSwitch state] == NSOnState)]; + streamingResult = [[mySQLConnection streamingQueryString:[NSString stringWithFormat:@"SELECT * FROM %@", [tableName backtickQuotedString]] useLowMemoryBlockingStreaming:([sqlFullStreamingSwitch state] == NSOnState)] retain]; fieldNames = [streamingResult fetchFieldNames]; // Update the progress text and set the progress bar back to determinate @@ -1732,7 +1732,7 @@ [metaString setString:@"\n"]; [metaString appendString:@"DELIMITER ;;\n"]; - for (int t=0; t<[queryResult numOfRows]; t++) { + for (int s=0; s<[queryResult numOfRows]; s++) { NSDictionary *triggers = [[NSDictionary alloc] initWithDictionary:[queryResult fetchRowAsDictionary]]; //Definer is user@host but we need to escape it to `user`@`host` @@ -1809,7 +1809,7 @@ [metaString appendString:@"DELIMITER ;;\n"]; // Loop through the definitions, exporting if enabled - for (int t=0; t<[queryResult numOfRows]; t++) { + for (int s=0; s<[queryResult numOfRows]; s++) { NSDictionary *proceduresList = [[NSDictionary alloc] initWithDictionary:[queryResult fetchRowAsDictionary]]; NSString *procedureName = [NSString stringWithFormat:@"%@", [proceduresList objectForKey:@"Name"]]; @@ -2641,7 +2641,7 @@ // Perform a COUNT for progress purposes and make a streaming request for the data streamingResultCount = [[[[mySQLConnection queryString:[NSString stringWithFormat:@"SELECT COUNT(1) FROM %@", [tableName backtickQuotedString]]] fetchRowAsArray] objectAtIndex:0] integerValue]; - streamingResult = [mySQLConnection streamingQueryString:[NSString stringWithFormat:@"SELECT * FROM %@", [tableName backtickQuotedString]] useLowMemoryBlockingStreaming:useLowMemoryBlockingStreaming]; + streamingResult = [[mySQLConnection streamingQueryString:[NSString stringWithFormat:@"SELECT * FROM %@", [tableName backtickQuotedString]] useLowMemoryBlockingStreaming:useLowMemoryBlockingStreaming] retain]; // Note any errors during initial query if ( ![[mySQLConnection getLastErrorMessage] isEqualToString:@""] ) { |