index 274ca027421d1540563c8d4dfdccab15c077384c..e112f4cc9fc35c47714d06042cb42b7cd1f6915d 100644 (file)
--- a/src/core/store_lookup.c
+++ b/src/core/store_lookup.c
* specified stored object and filter. Returns a value less than, equal to, or
* greater than zero if the value of the first expression compares less than,
* equal to, or greater than the value of the second expression. Returns
- * INT_MAX if any of the expressions could not be evaluated.
+ * INT_MAX if any of the expressions could not be evaluated or if any of them
+ * evaluated to NULL.
*/
static int
cmp_expr(sdb_store_expr_t *e1, sdb_store_expr_t *e2,
return INT_MAX;
}
- if (v1.type == v2.type)
+ if (sdb_data_isnull(&v1) || (sdb_data_isnull(&v2)))
+ status = INT_MAX;
+ else if (v1.type == v2.type)
status = sdb_data_cmp(&v1, &v2);
else
status = sdb_data_strcmp(&v1, &v2);