Skip to content

Commit

Permalink
Better NULL value handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
mscdex committed May 2, 2010
1 parent 1a8c498 commit f092f9c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion node-poormansmysql.js
Expand Up @@ -4,6 +4,7 @@ var inherits = require('sys').inherits;
var EventEmitter = require('events').EventEmitter;

function MysqlConnection(newconfig) {
EventEmitter.call(this);
var default_config = {
user: null,
password: null,
Expand Down Expand Up @@ -166,7 +167,10 @@ function MysqlConnection(newconfig) {
curRow = {};
else if (elem == "field") {
curField = attrs[0][3];
curRow[curField] = null;
if (attrs.length > 1 && attrs[1][0] == "nil" && attrs[1][3] == "true")
curRow[curField] = null;
else
curRow[curField] = "";
}
});
cb.onEndElementNS(function(elem, prefix, uri) {
Expand Down

0 comments on commit f092f9c

Please sign in to comment.