aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2009-04-29 21:36:39 +0000
committerBibiko <bibiko@eva.mpg.de>2009-04-29 21:36:39 +0000
commit16942ed14032430fb8595073be240ed952cb340d (patch)
tree30c6f65ad8b0155c035f3eb98822ed3f0ea47ae7
parent2c83174a13bc04a16b3f6221aac8859e1618a83e (diff)
downloadsequelpro-16942ed14032430fb8595073be240ed952cb340d.tar.gz
sequelpro-16942ed14032430fb8595073be240ed952cb340d.tar.bz2
sequelpro-16942ed14032430fb8595073be240ed952cb340d.zip
• MySQL Help
- fixed: escaped single quotes ' in the search string for HELP 'foo' (search selection)
-rw-r--r--Source/CustomQuery.m5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m
index 8d7dfd53..0a4681bf 100644
--- a/Source/CustomQuery.m
+++ b/Source/CustomQuery.m
@@ -1606,17 +1606,18 @@ traps enter key and
[theHelp setString:@""];
// search via: HELP 'searchString'
- theResult = [mySQLConnection queryString:[NSString stringWithFormat:@"HELP '%@'", searchString]];
+ theResult = [mySQLConnection queryString:[NSString stringWithFormat:@"HELP '%@'", [searchString stringByReplacingOccurrencesOfString:@"'" withString:@"\\'"]]];
if ( ![[mySQLConnection getLastErrorMessage] isEqualToString:@""])
{
// if an error or HELP is not supported fall back to online search
+ NSLog(@"Error in HELP statement for '%@'", searchString);
[self openMySQLonlineDocumentationWithString:searchString];
return SP_HELP_NOT_AVAILABLE;
}
// nothing found?
if(![theResult numOfRows]) {
// try to search via: HELP 'searchString%'
- theResult = [mySQLConnection queryString:[NSString stringWithFormat:@"HELP '%@%%'", searchString]];
+ theResult = [mySQLConnection queryString:[NSString stringWithFormat:@"HELP '%@%%'", [searchString stringByReplacingOccurrencesOfString:@"'" withString:@"\\'"]]];
// really nothing found?
if(![theResult numOfRows])
return @"";