diff options
author | Bibiko <bibiko@eva.mpg.de> | 2009-10-16 22:18:04 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2009-10-16 22:18:04 +0000 |
commit | c3eb7de88f2baf7774749f4311a84b75ef833eb7 (patch) | |
tree | a301a76611096d6718468b0d85fe6a4ae38e6d30 /Source/SPArrayAdditions.m | |
parent | 974049dd4fbe6b42c1a8349f72ea355cf6a38634 (diff) | |
download | sequelpro-c3eb7de88f2baf7774749f4311a84b75ef833eb7.tar.gz sequelpro-c3eb7de88f2baf7774749f4311a84b75ef833eb7.tar.bz2 sequelpro-c3eb7de88f2baf7774749f4311a84b75ef833eb7.zip |
• fixed NSString pointer reassignment in SPArrayAddition's method 'componentsJoinedAndBacktickQuoted'
• improved deletion of rows in tables which have no primary keys
- check for duplicated rows first; if no duplicates are found use all columns as 'primary keys' and delete the rows via … WHERE (a='…' AND b='…') OR (a='…' AND b='…') OR …
Diffstat (limited to 'Source/SPArrayAdditions.m')
-rw-r--r-- | Source/SPArrayAdditions.m | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/SPArrayAdditions.m b/Source/SPArrayAdditions.m index bbc732af..c16616a5 100644 --- a/Source/SPArrayAdditions.m +++ b/Source/SPArrayAdditions.m @@ -33,11 +33,15 @@ */ - (NSString *)componentsJoinedAndBacktickQuoted; { - NSString *result = [NSString string]; + NSMutableString *result = [NSMutableString string]; + [result setString:@""]; + for (NSString *component in self) { - if ([result length]) result = [result stringByAppendingString: @","]; - result = [result stringByAppendingString: [component backtickQuotedString] ]; + if ([result length]) + [result appendString: @","]; + + [result appendString:[component backtickQuotedString]]; } return result; } |