aboutsummaryrefslogtreecommitdiffstats
path: root/Source/CustomQuery.m
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CustomQuery.m')
-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 @"";