diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2011-12-07 05:12:23 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2011-12-07 05:12:23 +0100 |
commit | 4866aba384e9da075e963d99fc642ec5e6c809ca (patch) | |
tree | 546670334d431862131b9f8b49c3222625c80792 | |
parent | 895b47c26ea681c0e09e7c9f468a2934cb6f452b (diff) | |
download | ts3db_postgres-4866aba384e9da075e963d99fc642ec5e6c809ca.tar.gz ts3db_postgres-4866aba384e9da075e963d99fc642ec5e6c809ca.tar.xz ts3db_postgres-4866aba384e9da075e963d99fc642ec5e6c809ca.zip |
NULL fields should not be returned as NULL
calling the callback with NULL as value will result in an assertion,
that a basic_string could not created from a NULL pointer
-rw-r--r-- | ts3db.c | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -232,14 +232,8 @@ unsigned int ts3dbplugin_open(unsigned int connection_nr, const char* query, log("new row done.", LOG_DEBUG); for (j = 0; j < col_count; j++) { - if (PQgetisnull(result, i, j) == 1) { - log("<NULL>", LOG_DEBUG); - new_value(j, NULL, context); - } - else { - log(PQgetvalue(result, i, j), LOG_DEBUG); - new_value(j, PQgetvalue(result, i, j), context); - } + log(PQgetvalue(result, i, j), LOG_DEBUG); + new_value(j, PQgetvalue(result, i, j), context); } } |