aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPArrayAdditions.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-10-16 16:46:41 +0000
committerBibiko <bibiko@eva.mpg.de>2009-10-16 16:46:41 +0000
commit967579ef1225a134c50a686ee7caa9a3b5e293f3 (patch)
tree11470982216c5f9579c26bfa07815b73a081e0f5 /Source/SPArrayAdditions.m
parent507d0089c6bb73a01129f1e356d1e88ca53afb55 (diff)
downloadsequelpro-967579ef1225a134c50a686ee7caa9a3b5e293f3.tar.gz
sequelpro-967579ef1225a134c50a686ee7caa9a3b5e293f3.tar.bz2
sequelpro-967579ef1225a134c50a686ee7caa9a3b5e293f3.zip
• fixed SPArrayAdditions method 'componentsJoinedByCommas' to use a mutable string to avoid crashes if array has a very large number of items (malloc error due to reassigning a NSString pointer)
• added to SPTableData method - (NSArray *) primaryKeyColumnNames - returns all column names which are set as PRIMARY KEYs - return nil if no PRIMARY KEY is set • improved the deletion of rows - if current table has only one PRIMARY KEY field delete all rows via DELETE FROM table WHERE pri_key IN (…) whereby the deletion query will be splitted into 256k chunks Note: line 1790ff It has to be implemented a workaround for tables with more than one PRIMARY KEY – maybe via DELETE FROM table WHERE ( (pri_key1='…' AND pri_key2='…') OR (… AND …) OR … ) splitted in 256k chunks as well
Diffstat (limited to 'Source/SPArrayAdditions.m')
-rw-r--r--Source/SPArrayAdditions.m10
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/SPArrayAdditions.m b/Source/SPArrayAdditions.m
index e19869fa..bbc732af 100644
--- a/Source/SPArrayAdditions.m
+++ b/Source/SPArrayAdditions.m
@@ -44,15 +44,15 @@
- (NSString *)componentsJoinedByCommas
{
- NSString *result = [NSString string];
+ NSMutableString *result = [NSMutableString string];
+ [result setString:@""];
+
for (NSString *component in self)
{
if ([result length])
- {
- result = [result stringByAppendingString:@","];
- }
+ [result appendString:@","];
- result = [result stringByAppendingString:component];
+ [result appendString:component];
}
return result;
}