You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
Fix for null MULTI response when WATCH condition fails.
This commit is contained in:
@@ -420,6 +420,7 @@ In order of first contribution, they are:
|
|||||||
* [Orion Henry](http://github.com/orionz)
|
* [Orion Henry](http://github.com/orionz)
|
||||||
* [Hank Sims](http://github.com/hanksims)
|
* [Hank Sims](http://github.com/hanksims)
|
||||||
* [Aivo Paas](http://github.com/aivopaas)
|
* [Aivo Paas](http://github.com/aivopaas)
|
||||||
|
* [Paul Carey](https://github.com/paulcarey)
|
||||||
|
|
||||||
Thanks.
|
Thanks.
|
||||||
|
|
||||||
|
@@ -1,6 +1,10 @@
|
|||||||
Changelog
|
Changelog
|
||||||
=========
|
=========
|
||||||
|
|
||||||
|
## v0.3.8 - November 10, 2010
|
||||||
|
|
||||||
|
Fix for null MULTI response when WATCH condition fails.
|
||||||
|
|
||||||
## v0.3.7 - November 9, 2010
|
## v0.3.7 - November 9, 2010
|
||||||
|
|
||||||
Add "drain" and "idle" events.
|
Add "drain" and "idle" events.
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
{ "name" : "redis",
|
{ "name" : "redis",
|
||||||
"version" : "0.3.7",
|
"version" : "0.3.8",
|
||||||
"description" : "Redis client library",
|
"description" : "Redis client library",
|
||||||
"author": "Matt Ranney <mjr@ranney.com>",
|
"author": "Matt Ranney <mjr@ranney.com>",
|
||||||
"contributors": [
|
"contributors": [
|
||||||
@@ -8,7 +8,8 @@
|
|||||||
"TJ Holowaychuk",
|
"TJ Holowaychuk",
|
||||||
"Orion Henry",
|
"Orion Henry",
|
||||||
"Hank Sims",
|
"Hank Sims",
|
||||||
"Aivo Paas"
|
"Aivo Paas",
|
||||||
|
"Paul Carey"
|
||||||
],
|
],
|
||||||
"main": "./index.js",
|
"main": "./index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
43
test.js
43
test.js
@@ -6,7 +6,10 @@ var redis = require("./index"),
|
|||||||
assert = require("assert"),
|
assert = require("assert"),
|
||||||
util,
|
util,
|
||||||
test_db_num = 15, // this DB will be flushed and used for testing
|
test_db_num = 15, // this DB will be flushed and used for testing
|
||||||
tests = {};
|
tests = {},
|
||||||
|
connected = false,
|
||||||
|
ended = false,
|
||||||
|
server_info;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
util = require("util");
|
util = require("util");
|
||||||
@@ -207,13 +210,18 @@ tests.MULTI_6 = function () {
|
|||||||
tests.WATCH_MULTI = function () {
|
tests.WATCH_MULTI = function () {
|
||||||
var name = 'WATCH_MULTI';
|
var name = 'WATCH_MULTI';
|
||||||
|
|
||||||
client.watch(name);
|
if (server_info.versions[0] >= 2 && server_info.versions[1] >= 1) {
|
||||||
var multi = client.multi();
|
client.watch(name);
|
||||||
multi.incr(name);
|
var multi = client.multi();
|
||||||
client.incr(name);
|
multi.incr(name);
|
||||||
multi.exec(function (err, replies) {
|
client.incr(name);
|
||||||
next(name);
|
multi.exec(function (err, replies) {
|
||||||
});
|
next(name);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.log("Skipping " + name + " because server version isn't new enough.");
|
||||||
|
next(name);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
tests.HSET = function () {
|
tests.HSET = function () {
|
||||||
@@ -991,11 +999,24 @@ function run_next_test() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var connected = false;
|
|
||||||
var ended = false;
|
|
||||||
client.on("connect", function () {
|
client.on("connect", function () {
|
||||||
|
// Fetch and stash info results in case anybody needs info on the server we are using.
|
||||||
|
client.info(function (err, reply) {
|
||||||
|
var obj = {};
|
||||||
|
reply.toString().split('\n').forEach(function (line) {
|
||||||
|
var parts = line.split(':');
|
||||||
|
if (parts[1]) {
|
||||||
|
obj[parts[0]] = parts[1];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
obj.versions = [];
|
||||||
|
obj.redis_version.split('.').forEach(function (num) {
|
||||||
|
obj.versions.push(+num);
|
||||||
|
});
|
||||||
|
server_info = obj;
|
||||||
|
});
|
||||||
|
|
||||||
connected = true;
|
connected = true;
|
||||||
console.log();
|
|
||||||
run_next_test();
|
run_next_test();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user