From 869de1ebb5dbd90c307dbbd600d26209e632bdee Mon Sep 17 00:00:00 2001 From: Ryan Clark Date: Mon, 9 Mar 2015 22:15:11 -0400 Subject: [PATCH] finalize prepared statement in zxystream --- lib/zxystream.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/zxystream.js b/lib/zxystream.js index 5816503..0c993f4 100644 --- a/lib/zxystream.js +++ b/lib/zxystream.js @@ -57,7 +57,11 @@ ZXYStream.prototype._read = function() { if (error) { stream.emit('error', error); } else { - stream.push(lines || null); + if (lines) stream.push(lines); + else { + stream.statement.finalize(); + stream.push(null); + } } } } @@ -68,4 +72,3 @@ function toLine(row) { var y = row.y = (1 << row.z) - 1 - row.y; return row.z + '/' + row.x + '/' + y + '\n'; } -