Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

uv_after_work_cb backward compatibility per https://github.com/joyent…

…/node/wiki/Api-changes-between-v0.8-and-v0.10

test case for multiple query results
  • Loading branch information...
commit 3dd3c6638967533e4d71181095e04f59f4049936 1 parent 39d7041
@jkeys089 jkeys089 authored
Showing with 22 additions and 2 deletions.
  1. +1 −1  binding.cc
  2. +1 −1  query.cc
  3. +20 −0 tests.js
View
2  binding.cc
@@ -88,7 +88,7 @@ v8::Handle<v8::Value> node_db::Binding::Connect(const v8::Arguments& args) {
uv_work_t* req = new uv_work_t();
req->data = request;
- uv_queue_work(uv_default_loop(), req, uvConnect, uvConnectFinished);
+ uv_queue_work(uv_default_loop(), req, uvConnect, (uv_after_work_cb)uvConnectFinished);
#if NODE_VERSION_AT_LEAST(0, 7, 9)
uv_ref((uv_handle_t *)&g_async);
View
2  query.cc
@@ -649,7 +649,7 @@ v8::Handle<v8::Value> node_db::Query::Execute(const v8::Arguments& args) {
uv_work_t* req = new uv_work_t();
req->data = request;
- uv_queue_work(uv_default_loop(), req, uvExecute, uvExecuteFinished);
+ uv_queue_work(uv_default_loop(), req, uvExecute, (uv_after_work_cb)uvExecuteFinished);
#if NODE_VERSION_AT_LEAST(0, 7, 9)
uv_ref((uv_handle_t *)&g_async);
View
20 tests.js
@@ -47,6 +47,26 @@ exports.get = function(createDbClient, quoteName) {
test.equal(quoteName + "table" + quoteName + ".*", client.name("table.*"));
test.done();
+ },
+ "multiple results": function(test) {
+ var client = this.client;
+ test.expect(1);
+
+ client.query(
+ 'CREATE PROCEDURE multiple_result () ' +
+ 'BEGIN ' +
+ ' SELECT 0; ' +
+ ' SELECT 1; ' +
+ 'END'
+ ).execute(function () {
+ client.query('call multiple_result()').execute(function (error1, rows, cols) {
+ client.query('call multiple_result()').execute(function (error2, rows, cols) {
+ test.equal(null, error2);
+ client.query('DROP PROCEDURE IF EXISTS multiple_result').execute();
+ test.done();
+ });
+ });
+ });
}
});
Please sign in to comment.
Something went wrong with that request. Please try again.