diff options
author | Albert Choy <albert.choy@osii.com> | 2015-04-15 16:45:50 -0500 |
---|---|---|
committer | Albert Choy <albert.choy@osii.com> | 2015-04-15 16:45:50 -0500 |
commit | 9bc632d250c0606573448a3717916bfa00e641cc (patch) | |
tree | 961a871cbd02cc53c46ad225c7fd7239a1b487ef | |
parent | 380fd1b57e1be2d25d3750e2b029b6c05b60189f (diff) | |
download | ejdb-9bc632d250c0606573448a3717916bfa00e641cc.tar.gz ejdb-9bc632d250c0606573448a3717916bfa00e641cc.tar.bz2 ejdb-9bc632d250c0606573448a3717916bfa00e641cc.zip |
#129
Symbols must match case sensitive
-rw-r--r-- | src/bson/bson.h | 2 | ||||
-rw-r--r-- | src/ejdb/ejdb.c | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/bson/bson.h b/src/bson/bson.h index de5aab7..a741336 100644 --- a/src/bson/bson.h +++ b/src/bson/bson.h @@ -32,7 +32,7 @@ #include "tcutil.h" #define BSON_IS_NUM_TYPE(atype) (atype == BSON_INT || atype == BSON_LONG || atype == BSON_DOUBLE) -#define BSON_IS_STRING_TYPE(atype) (atype == BSON_STRING || atype == BSON_SYMBOL) +#define BSON_IS_STRING_TYPE(atype) ((atype) == BSON_STRING || (atype) == BSON_SYMBOL) EJDB_EXTERN_C_START diff --git a/src/ejdb/ejdb.c b/src/ejdb/ejdb.c index a3d363a..d568a57 100644 --- a/src/ejdb/ejdb.c +++ b/src/ejdb/ejdb.c @@ -1825,7 +1825,7 @@ static bool _qrybsvalmatch(const EJQF *qf, bson_iterator *it, bool expandarrays, switch (qf->tcop) { case TDBQCSTREQ: { _FETCHSTRFVAL(); - if ((qf->flags & EJCONDICASE) && (BSON_IS_STRING_TYPE(bt))) { + if ((qf->flags & EJCONDICASE) && (bt == BSON_STRING)) { cbufstrlen = tcicaseformat(fval, fvalsz - 1, sbuf, JBSTRINOPBUFFERSZ, &cbuf); if (cbufstrlen < 0) { _ejdbsetecode(qf->jb, cbufstrlen, __FILE__, __LINE__, __func__); @@ -1843,7 +1843,7 @@ static bool _qrybsvalmatch(const EJQF *qf, bson_iterator *it, bool expandarrays, } case TDBQCSTRINC: { _FETCHSTRFVAL(); - if ((qf->flags & EJCONDICASE) && (BSON_IS_STRING_TYPE(bt))) { + if ((qf->flags & EJCONDICASE) && (bt == BSON_STRING)) { cbufstrlen = tcicaseformat(fval, fvalsz - 1, sbuf, JBSTRINOPBUFFERSZ, &cbuf); if (cbufstrlen < 0) { _ejdbsetecode(qf->jb, cbufstrlen, __FILE__, __LINE__, __func__); @@ -1861,7 +1861,7 @@ static bool _qrybsvalmatch(const EJQF *qf, bson_iterator *it, bool expandarrays, } case TDBQCSTRBW: { _FETCHSTRFVAL(); - if ((qf->flags & EJCONDICASE) && (BSON_IS_STRING_TYPE(bt))) { + if ((qf->flags & EJCONDICASE) && (bt == BSON_STRING)) { cbufstrlen = tcicaseformat(fval, fvalsz - 1, sbuf, JBSTRINOPBUFFERSZ, &cbuf); if (cbufstrlen < 0) { _ejdbsetecode(qf->jb, cbufstrlen, __FILE__, __LINE__, __func__); @@ -1879,7 +1879,7 @@ static bool _qrybsvalmatch(const EJQF *qf, bson_iterator *it, bool expandarrays, } case TDBQCSTREW: { _FETCHSTRFVAL(); - if ((qf->flags & EJCONDICASE) && (BSON_IS_STRING_TYPE(bt))) { + if ((qf->flags & EJCONDICASE) && (bt == BSON_STRING)) { cbufstrlen = tcicaseformat(fval, fvalsz - 1, sbuf, JBSTRINOPBUFFERSZ, &cbuf); if (cbufstrlen < 0) { _ejdbsetecode(qf->jb, cbufstrlen, __FILE__, __LINE__, __func__); @@ -1899,7 +1899,7 @@ static bool _qrybsvalmatch(const EJQF *qf, bson_iterator *it, bool expandarrays, TCLIST *tokens = qf->exprlist; assert(tokens); _FETCHSTRFVAL(); - if ((qf->flags & EJCONDICASE) && (BSON_IS_STRING_TYPE(bt))) { + if ((qf->flags & EJCONDICASE) && (bt == BSON_STRING)) { cbufstrlen = tcicaseformat(fval, fvalsz - 1, sbuf, JBSTRINOPBUFFERSZ, &cbuf); if (cbufstrlen < 0) { _ejdbsetecode(qf->jb, cbufstrlen, __FILE__, __LINE__, __func__); @@ -1919,7 +1919,7 @@ static bool _qrybsvalmatch(const EJQF *qf, bson_iterator *it, bool expandarrays, TCLIST *tokens = qf->exprlist; assert(tokens); _FETCHSTRFVAL(); - if ((qf->flags & EJCONDICASE) && (BSON_IS_STRING_TYPE(bt))) { + if ((qf->flags & EJCONDICASE) && (bt == BSON_STRING)) { cbufstrlen = tcicaseformat(fval, fvalsz - 1, sbuf, JBSTRINOPBUFFERSZ, &cbuf); if (cbufstrlen < 0) { _ejdbsetecode(qf->jb, cbufstrlen, __FILE__, __LINE__, __func__); @@ -1939,7 +1939,7 @@ static bool _qrybsvalmatch(const EJQF *qf, bson_iterator *it, bool expandarrays, TCLIST *tokens = qf->exprlist; assert(tokens); _FETCHSTRFVAL(); - if ((qf->flags & EJCONDICASE) && (BSON_IS_STRING_TYPE(bt))) { + if ((qf->flags & EJCONDICASE) && (bt == BSON_STRING)) { cbufstrlen = tcicaseformat(fval, fvalsz - 1, sbuf, JBSTRINOPBUFFERSZ, &cbuf); if (cbufstrlen < 0) { _ejdbsetecode(qf->jb, cbufstrlen, __FILE__, __LINE__, __func__); @@ -1987,7 +1987,7 @@ static bool _qrybsvalmatch(const EJQF *qf, bson_iterator *it, bool expandarrays, TCLIST *tokens = qf->exprlist; assert(tokens); _FETCHSTRFVAL(); - if ((qf->flags & EJCONDICASE) && (BSON_IS_STRING_TYPE(bt))) { + if ((qf->flags & EJCONDICASE) && (bt == BSON_STRING)) { cbufstrlen = tcicaseformat(fval, fvalsz - 1, sbuf, JBSTRINOPBUFFERSZ, &cbuf); if (cbufstrlen < 0) { _ejdbsetecode(qf->jb, cbufstrlen, __FILE__, __LINE__, __func__); |