diff options
author | rowanbeentje <rowan@beent.je> | 2010-12-14 00:32:39 +0000 |
---|---|---|
committer | rowanbeentje <rowan@beent.je> | 2010-12-14 00:32:39 +0000 |
commit | 3033e428aba1418e7797fb987c1280c6db67c305 (patch) | |
tree | 6fda5b431a37db8c89f8016dbb2f28ccb87240ba /Source/SPTableData.m | |
parent | 76fb8cf52fd54df4a52be53a7f3b956c5b2f1fa3 (diff) | |
download | sequelpro-3033e428aba1418e7797fb987c1280c6db67c305.tar.gz sequelpro-3033e428aba1418e7797fb987c1280c6db67c305.tar.bz2 sequelpro-3033e428aba1418e7797fb987c1280c6db67c305.zip |
- Improve handling of table names containing backslashes
Diffstat (limited to 'Source/SPTableData.m')
-rw-r--r-- | Source/SPTableData.m | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Source/SPTableData.m b/Source/SPTableData.m index 404395b9..28717864 100644 --- a/Source/SPTableData.m +++ b/Source/SPTableData.m @@ -944,6 +944,7 @@ // Run the status query and retrieve as a dictionary. NSMutableString *escapedTableName = [NSMutableString stringWithString:[tableListInstance tableName]]; + [escapedTableName replaceOccurrencesOfString:@"\\" withString:@"\\\\" options:0 range:NSMakeRange(0, [escapedTableName length])]; [escapedTableName replaceOccurrencesOfString:@"'" withString:@"\\\'" options:0 range:NSMakeRange(0, [escapedTableName length])]; MCPResult *tableStatusResult = nil; @@ -964,6 +965,7 @@ tableStatusResult = [mySQLConnection queryString:[NSString stringWithFormat:@"SELECT * FROM information_schema.VIEWS AS r WHERE r.TABLE_NAME = '%@' AND r.TABLE_SCHEMA = '%@'", escapedTableName, escapedDatabaseName]]; } else if ([tableListInstance tableType] == SPTableTypeTable) { + [escapedTableName replaceOccurrencesOfRegex:@"\\\\(?=\\Z|[^\'])" withString:@"\\\\\\\\"]; tableStatusResult = [mySQLConnection queryString:[NSString stringWithFormat:@"SHOW TABLE STATUS LIKE '%@'", escapedTableName ]]; [tableStatusResult setReturnDataAsStrings:YES]; } |