You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed several bugs in 0.12.1 with detect_buffers logic inside a multi/exec block. These bugs can be reproduced with the following code:
varredis=require('redis');functioncheckCallback(name){returnfunction(err,res){if(err){console.log(name,"::",err.stack);process.exit(1);}if(res){console.log(name,"::",res);}};}varclient=redis.createClient({detect_buffers: true});client.hmset("FOO",{"alpha":1,"beta":2},checkCallback("Hmset"));client.hgetall("FOO",checkCallback("Correct: normal hgetall"));// Wrong: mangles data into [ { '1': ',', a: ',', p: 'h', b: 'e', t: 'a', ',': '2' } ]client.multi().hgetall("FOO").exec(checkCallback("Bad: hgetall in multi"));// Wrong: returns both values as strings, even though 'beta' wanted a bufferclient.multi().hget("FOO","alpha").hget(newBuffer("FOO"),"beta").exec(checkCallback("Bad: incorrect types for hget in multi"));// Crashes due to attempting to do a .toString('binary') on a numberclient.multi().hgetall(newBuffer("FOO")).exec(checkCallback("Bad: binary hgetall in multi"));
I'll attach a pull request to fix these bugs in a short bit. Thanks for the library!
Also: this is a duplicate of bug #263, but that issue hasn't been touched since mid-2013, so I elected to start fresh. Also, the PR I'll attach doesn't touch the parser, so it shouldn't conflict with hiredis.
The text was updated successfully, but these errors were encountered:
I noticed several bugs in 0.12.1 with detect_buffers logic inside a multi/exec block. These bugs can be reproduced with the following code:
I'll attach a pull request to fix these bugs in a short bit. Thanks for the library!
Also: this is a duplicate of bug #263, but that issue hasn't been touched since mid-2013, so I elected to start fresh. Also, the PR I'll attach doesn't touch the parser, so it shouldn't conflict with hiredis.
The text was updated successfully, but these errors were encountered: