At least for me IS NULL and IS NOT NULL are the wrong way round in SQL, fixed it.

This commit is contained in:
leecher1337
2015-08-21 14:50:34 +02:00
committed by Brian Bruns
parent 83ee854263
commit 2355aec912

View File

@@ -175,13 +175,10 @@ mdb_test_sarg(MdbHandle *mdb, MdbColumn *col, MdbSargNode *node, MdbField *field
{ {
char tmpbuf[256]; char tmpbuf[256];
if (node->op == MDB_ISNULL) { if (node->op == MDB_ISNULL)
if (field->is_null) return 0; return field->is_null?1:0;
else return 1; else if (node->op == MDB_NOTNULL)
} else if (node->op == MDB_NOTNULL) { return field->is_null?0:1;
if (field->is_null) return 1;
else return 0;
}
switch (col->col_type) { switch (col->col_type) {
case MDB_BOOL: case MDB_BOOL:
return mdb_test_int(node, !field->is_null); return mdb_test_int(node, !field->is_null);