diff options
| author | David Sommerseth <davids@redhat.com> | 2010-03-25 17:32:02 +0100 |
|---|---|---|
| committer | David Sommerseth <davids@redhat.com> | 2010-03-25 17:32:02 +0100 |
| commit | d4d92bd84f7576481d37dfb22307d66cd435cc30 (patch) | |
| tree | d3a745d3d5c076d76c3f179b166255891983e594 /server/parser | |
| parent | 45a6c21d69266ec6069eb2b6ef917fc909c68aa3 (diff) | |
| download | rteval-d4d92bd84f7576481d37dfb22307d66cd435cc30.tar.gz rteval-d4d92bd84f7576481d37dfb22307d66cd435cc30.tar.xz rteval-d4d92bd84f7576481d37dfb22307d66cd435cc30.zip | |
Honour the 'isnull' attribute in <value/> tags
Diffstat (limited to 'server/parser')
| -rw-r--r-- | server/parser/xmlparser.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/server/parser/xmlparser.c b/server/parser/xmlparser.c index e7e31b1..fb1330a 100644 --- a/server/parser/xmlparser.c +++ b/server/parser/xmlparser.c @@ -171,10 +171,10 @@ xmlDoc *parseToSQLdata(LogContext *log, xsltStylesheet *xslt, xmlDoc *indata_d, * This memory buffer must be free'd after usage. */ static inline char *sqldataValueHash(LogContext *log, xmlNode *sql_n) { - const char *hash = NULL; + const char *hash = NULL, *isnull = NULL; SHA1Context shactx; uint8_t shahash[SHA1_HASH_SIZE]; - char *ret = NULL, *ptr = NULL;; + char *ret = NULL, *ptr = NULL; int i; if( !sql_n || (xmlStrcmp(sql_n->name, (xmlChar *) "value") != 0) @@ -182,6 +182,11 @@ static inline char *sqldataValueHash(LogContext *log, xmlNode *sql_n) { return NULL; } + isnull = xmlGetAttrValue(sql_n->properties, "isnull"); + if( isnull && (strcmp(isnull, "1") == 0) ) { + return NULL; + } + hash = xmlGetAttrValue(sql_n->properties, "hash"); if( !hash ) { // If no hash attribute is found, just use the raw data |
