aboutsummaryrefslogtreecommitdiffstats
path: root/Source/TableContent.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2009-01-28 20:45:10 +0000
committerstuconnolly <stuart02@gmail.com>2009-01-28 20:45:10 +0000
commit248c24390544ce758346b80526858cd73a378848 (patch)
treedd27eb637a4c47d704d673956cc5e4f715cda3b3 /Source/TableContent.m
parent4a6b32c3ac774d21e6ce54f1d2e19b08ac5a4665 (diff)
downloadsequelpro-248c24390544ce758346b80526858cd73a378848.tar.gz
sequelpro-248c24390544ce758346b80526858cd73a378848.tar.bz2
sequelpro-248c24390544ce758346b80526858cd73a378848.zip
We are not quoting the filter argument when filter type is 'IN' meaning the SQL is failing.
Diffstat (limited to 'Source/TableContent.m')
-rw-r--r--Source/TableContent.m15
1 files changed, 7 insertions, 8 deletions
diff --git a/Source/TableContent.m b/Source/TableContent.m
index 962f6dde..0fd35a05 100644
--- a/Source/TableContent.m
+++ b/Source/TableContent.m
@@ -428,22 +428,21 @@
return;
}
- //query started
+ // Query started
[[NSNotificationCenter defaultCenter] postNotificationName:@"SMySQLQueryWillBePerformed" object:self];
BOOL doQuote = YES;
BOOL ignoreArgument = NO;
// Start building the query string
- queryString = [NSString stringWithFormat:@"SELECT %@ FROM `%@`",
- [self fieldListForQuery], selectedTable];
+ queryString = [NSString stringWithFormat:@"SELECT %@ FROM `%@`", [self fieldListForQuery], selectedTable];
// Add filter if appropriate
if (([argument length] > 0) || [[[compareField selectedItem] title] hasSuffix:@"NULL"]) {
- if ( ![compareType isEqualToString:@""] ) {
- if ( [compareType isEqualToString:@"string"] ) {
- //string comparision
- switch ( tag ) {
+ if (![compareType isEqualToString:@""]) {
+ if ([compareType isEqualToString:@"string"]) {
+ // String comparision
+ switch (tag) {
case 0:
compareOperator = @"LIKE";
break;
@@ -461,7 +460,7 @@
case 4:
compareOperator = @"IN";
doQuote = NO;
- [argument setString:[[@"(" stringByAppendingString:argument] stringByAppendingString:@")"]];
+ [argument setString:[[@"('" stringByAppendingString:argument] stringByAppendingString:@"')"]];
break;
case 5:
compareOperator = @"IS NULL";