Applied patch from bug #2235

pull/12/head
Ludovic Marcotte 2013-07-18 10:52:37 -04:00
parent 19e542396b
commit 048bae2fc5
2 changed files with 14 additions and 22 deletions

View File

@ -27,10 +27,6 @@
#import "EOQualifier+GCS.h" #import "EOQualifier+GCS.h"
#if __GNU_LIBOBJC__ >= 20100911
# define sel_eq(__A__,__B__) sel_isEqual(__A__,__B__)
#endif
@implementation EOQualifier(GCS) @implementation EOQualifier(GCS)
- (void)_appendAndQualifier:(EOAndQualifier *)_q - (void)_appendAndQualifier:(EOAndQualifier *)_q
@ -92,21 +88,21 @@
val = [_q value]; val = [_q value];
if (val && [val isNotNull]) { if (val && [val isNotNull]) {
if (sel_eq(op, EOQualifierOperatorEqual)) if (sel_isEqual(op, EOQualifierOperatorEqual))
qOperator = @"="; qOperator = @"=";
else if (sel_eq(op, EOQualifierOperatorNotEqual)) else if (sel_isEqual(op, EOQualifierOperatorNotEqual))
qOperator = @"!="; qOperator = @"!=";
else if (sel_eq(op, EOQualifierOperatorLessThan)) else if (sel_isEqual(op, EOQualifierOperatorLessThan))
qOperator = @"<"; qOperator = @"<";
else if (sel_eq(op, EOQualifierOperatorGreaterThan)) else if (sel_isEqual(op, EOQualifierOperatorGreaterThan))
qOperator = @">"; qOperator = @">";
else if (sel_eq(op, EOQualifierOperatorLessThanOrEqualTo)) else if (sel_isEqual(op, EOQualifierOperatorLessThanOrEqualTo))
qOperator = @"<="; qOperator = @"<=";
else if (sel_eq(op, EOQualifierOperatorGreaterThanOrEqualTo)) else if (sel_isEqual(op, EOQualifierOperatorGreaterThanOrEqualTo))
qOperator = @">="; qOperator = @">=";
else if (sel_eq(op, EOQualifierOperatorLike)) else if (sel_isEqual(op, EOQualifierOperatorLike))
qOperator = @"LIKE"; qOperator = @"LIKE";
else if (sel_eq(op, EOQualifierOperatorCaseInsensitiveLike)) { else if (sel_isEqual(op, EOQualifierOperatorCaseInsensitiveLike)) {
isCI = YES; isCI = YES;
qOperator = @"LIKE"; qOperator = @"LIKE";
} }
@ -128,11 +124,11 @@
} }
} }
else { else {
if (sel_eq(op, EOQualifierOperatorEqual)) { if (sel_isEqual(op, EOQualifierOperatorEqual)) {
qOperator = @"IS"; qOperator = @"IS";
qValue = @"NULL"; qValue = @"NULL";
} }
else if (sel_eq(op, EOQualifierOperatorNotEqual)) { else if (sel_isEqual(op, EOQualifierOperatorNotEqual)) {
qOperator = @"IS NOT"; qOperator = @"IS NOT";
qValue = @"NULL"; qValue = @"NULL";
} }

View File

@ -44,10 +44,6 @@
#import "EOQualifier+GCS.h" #import "EOQualifier+GCS.h"
#import "GCSStringFormatter.h" #import "GCSStringFormatter.h"
#if __GNU_LIBOBJC__ >= 20100911
# define sel_eq(__A__,__B__) sel_isEqual(__A__,__B__)
#endif
typedef enum { typedef enum {
noTableRequired = 0, noTableRequired = 0,
quickTableRequired = 1, quickTableRequired = 1,
@ -395,20 +391,20 @@ static GCSStringFormatter *stringFormatter = nil;
if (i > 0) [sql appendString:@", "]; if (i > 0) [sql appendString:@", "];
if (sel_eq(sel, EOCompareAscending)) { if (sel_isEqual(sel, EOCompareAscending)) {
[sql appendString:column]; [sql appendString:column];
[sql appendString:@" ASC"]; [sql appendString:@" ASC"];
} }
else if (sel_eq(sel, EOCompareDescending)) { else if (sel_isEqual(sel, EOCompareDescending)) {
[sql appendString:column]; [sql appendString:column];
[sql appendString:@" DESC"]; [sql appendString:@" DESC"];
} }
else if (sel_eq(sel, EOCompareCaseInsensitiveAscending)) { else if (sel_isEqual(sel, EOCompareCaseInsensitiveAscending)) {
[sql appendString:@"UPPER("]; [sql appendString:@"UPPER("];
[sql appendString:column]; [sql appendString:column];
[sql appendString:@") ASC"]; [sql appendString:@") ASC"];
} }
else if (sel_eq(sel, EOCompareCaseInsensitiveDescending)) { else if (sel_isEqual(sel, EOCompareCaseInsensitiveDescending)) {
[sql appendString:@"UPPER("]; [sql appendString:@"UPPER("];
[sql appendString:column]; [sql appendString:column];
[sql appendString:@") DESC"]; [sql appendString:@") DESC"];