Skip to content
This repository
Browse code

Ensure null values are not quoted

  • Loading branch information...
commit 4f6f40444d8f532bd75af9459cb8b5aec43659fe 1 parent da11ecc
Brian White authored

Showing 1 changed file with 6 additions and 3 deletions. Show diff stats Hide diff stats

  1. 9  lib/Client.js
9  lib/Client.js
@@ -237,9 +237,12 @@ Client.prototype.prepare = function(query) {
237 237
           else
238 238
             str = values[tokens[j]] + '';
239 239
           ret += parts[j];
240  
-          ret += "'";
241  
-          ret += addon.escape(str);
242  
-          ret += "'";
  240
+          if (values[tokens[j]] !== null) {
  241
+            ret += "'";
  242
+            ret += addon.escape(str);
  243
+            ret += "'";
  244
+          } else
  245
+            ret += 'NULL';
243 246
         }
244 247
         if (j < parts.length)
245 248
           ret += parts[j];

0 notes on commit 4f6f404

Please sign in to comment.
Something went wrong with that request. Please try again.