aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPXMLExporter.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-12-14 00:32:39 +0000
committerrowanbeentje <rowan@beent.je>2010-12-14 00:32:39 +0000
commit3033e428aba1418e7797fb987c1280c6db67c305 (patch)
tree6fda5b431a37db8c89f8016dbb2f28ccb87240ba /Source/SPXMLExporter.m
parent76fb8cf52fd54df4a52be53a7f3b956c5b2f1fa3 (diff)
downloadsequelpro-3033e428aba1418e7797fb987c1280c6db67c305.tar.gz
sequelpro-3033e428aba1418e7797fb987c1280c6db67c305.tar.bz2
sequelpro-3033e428aba1418e7797fb987c1280c6db67c305.zip
- Improve handling of table names containing backslashes
Diffstat (limited to 'Source/SPXMLExporter.m')
-rw-r--r--Source/SPXMLExporter.m4
1 files changed, 3 insertions, 1 deletions
diff --git a/Source/SPXMLExporter.m b/Source/SPXMLExporter.m
index 962d5a53..57977be0 100644
--- a/Source/SPXMLExporter.m
+++ b/Source/SPXMLExporter.m
@@ -113,7 +113,9 @@
if (([self xmlFormat] == SPXMLExportMySQLFormat) && [self xmlOutputIncludeStructure]) {
structureResult = [connection queryString:[NSString stringWithFormat:@"SHOW COLUMNS FROM %@", [[self xmlTableName] backtickQuotedString]]];
- statusResult = [connection queryString:[NSString stringWithFormat:@"SHOW TABLE STATUS LIKE %@", [[self xmlTableName] tickQuotedString]]];
+ NSMutableString *escapedTableName = [NSMutableString stringWithString:[[self xmlTableName] tickQuotedString]];
+ [escapedTableName replaceOccurrencesOfString:@"\\" withString:@"\\\\\\\\" options:0 range:NSMakeRange(0, [escapedTableName length])];
+ statusResult = [connection queryString:[NSString stringWithFormat:@"SHOW TABLE STATUS LIKE %@", escapedTableName]];
if ([structureResult numOfRows] && [statusResult numOfRows]) {