summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c983ba2)
raw | patch | inline | side by side (parent: c983ba2)
author | Sebastian Harl <sh@tokkee.org> | |
Sun, 9 Nov 2014 12:47:36 +0000 (13:47 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Sun, 9 Nov 2014 12:47:36 +0000 (13:47 +0100) |
src/core/store_lookup.c | patch | blob | history | |
t/unit/core/store_lookup_test.c | patch | blob | history |
index e2ec1b14936b3c6586bdd698bdd0c792519c61aa..eab37b4787bb2ba7e752ab6c06eb4b8bc019a7ea 100644 (file)
--- a/src/core/store_lookup.c
+++ b/src/core/store_lookup.c
if ((sdb_store_expr_eval(CMP_M(m)->left, obj, &v, filter))
|| (sdb_data_isnull(&v)))
- status = 0;
+ status = INT_MAX;
else {
char value[sdb_data_strlen(&v) + 1];
if (sdb_data_format(&v, value, sizeof(value), SDB_UNQUOTED) < 0)
if (free_regex)
regfree(®ex);
sdb_data_free_datum(&v);
+ if (status == INT_MAX)
+ return 0;
if (m->type == MATCHER_NREGEX)
return !status;
return status;
index 4d968a630f00a272b30c6edbfab4f6ad47a97517..18d811f0201edac5fd3a3ebc75d4f5951b981c65 100644 (file)
{ "attribute['k1'] =~ '^v1$'", NULL, 1 },
{ "attribute['k1'] =~ 'v'", NULL, 2 },
{ "attribute['k1'] =~ '1'", NULL, 1 },
- { "attribute['k1'] !~ 'v'", NULL, 1 },
+ { "attribute['k1'] !~ 'v'", NULL, 0 },
{ "attribute['k1'] = 'v2'", NULL, 1 },
{ "attribute['k1'] =~ 'v2'", NULL, 1 },
{ "attribute['x1'] =~ 'v'", NULL, 0 },
{ "attribute['x1'] =~ 'NULL'", NULL, 0 },
- { "attribute['x1'] !~ 'v'", NULL, 3 },
+ { "attribute['x1'] !~ 'v'", NULL, 0 },
{ "attribute['k1'] IS NULL", NULL, 1 },
{ "attribute['x1'] IS NULL", NULL, 3 },
{ "attribute['k1'] IS NOT NULL", NULL, 2 },
{ "attribute['k1'] != 'v1'", NULL, 1 },
{ "attribute['k1'] != 'v2'", NULL, 1 },
{ "ANY attribute != 'x' "
- "AND attribute['y'] !~ 'x'", NULL, 2 },
+ "AND attribute['k1'] !~ 'x'", NULL, 2 },
};
sdb_strbuf_t *errbuf = sdb_strbuf_create(64);