Imporant bug leading to data corruption fixed (NOT affecting stable distribution), Tcl client lib MSET/MSETNX implementation fixed, Added new tests for MSET and MSETNX in test-redis.tcl

This commit is contained in:
antirez
2009-10-20 11:39:20 +02:00
parent 8165a5f2a3
commit f69f2cbafe
3 changed files with 26 additions and 7 deletions

View File

@@ -27,7 +27,7 @@ foreach redis_bulk_cmd {
# Flag commands requiring last argument as a bulk write operation
foreach redis_multibulk_cmd {
mset
mset msetnx
} {
set ::redis::multibulkarg($redis_multibulk_cmd) {}
}
@@ -53,12 +53,13 @@ proc ::redis::__dispatch__ {id method args} {
append cmd [lindex $args end]
::redis::redis_writenl $fd $cmd
} elseif {[info exists ::redis::multibulkarg($method)]} {
set cmd "*[expr {[llength $args]}+1]\r\n"
set cmd "*[expr {[llength $args]+1}]\r\n"
append cmd "$[string length $method]\r\n$method\r\n"
foreach a $args {
append cmd "$[string length $a]\r\n$a\r\n"
}
::redis::redis_write $fd $cmd
flush $fd
} else {
set cmd "$method "
append cmd [join $args]