summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2011-12-07 05:12:23 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2011-12-07 05:12:23 +0100
commit4866aba384e9da075e963d99fc642ec5e6c809ca (patch)
tree546670334d431862131b9f8b49c3222625c80792
parent895b47c26ea681c0e09e7c9f468a2934cb6f452b (diff)
downloadts3db_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.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/ts3db.c b/ts3db.c
index 33bc9b0..69085f4 100644
--- a/ts3db.c
+++ b/ts3db.c
@@ -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);
}
}