Permalink
Browse files

Fix a bug in insertMany

  • Loading branch information...
orlandov committed Nov 4, 2010
1 parent 090d71e commit 409251a053e4e24388ce15aa7dd2003cc4c9b2b7
Showing with 6 additions and 1 deletion.
  1. +5 −0 sqlite.js
  2. +1 −1 src/database.h
View
@@ -175,6 +175,11 @@ Database.prototype.insertMany = function (table, columns, rows, callback) {
var placeholdersFragment = [];
var i = columns.length;
+ if (!rows.length) {
+ callback();
+ return;
+ }
+
while (i--) {
placeholdersFragment.push('?');
}
View
@@ -36,7 +36,7 @@ class Database : public EventEmitter {
~Database() {
assert(db_ == NULL);
- printf("Destroying statement\n");
+ printf("Destroying database\n");
}
static Handle<Value> New(const Arguments& args);

0 comments on commit 409251a

Please sign in to comment.