mirror of
https://github.com/fluencelabs/redis
synced 2025-04-03 16:21:03 +00:00
test-redis.tcl dataset digest function Hash support
This commit is contained in:
parent
ad6de43c80
commit
12f72a714c
@ -152,7 +152,6 @@ proc createComplexDataset {r ops} {
|
|||||||
} {
|
} {
|
||||||
$r zadd $k $d $v
|
$r zadd $k $d $v
|
||||||
} {
|
} {
|
||||||
puts "hset $k $f $v"
|
|
||||||
$r hset $k $f $v
|
$r hset $k $f $v
|
||||||
}
|
}
|
||||||
set t [$r type $k]
|
set t [$r type $k]
|
||||||
@ -179,7 +178,7 @@ proc createComplexDataset {r ops} {
|
|||||||
}
|
}
|
||||||
{hash} {
|
{hash} {
|
||||||
randpath {$r hset $k $f $v} \
|
randpath {$r hset $k $f $v} \
|
||||||
{puts "$r hdel $k $f"; $r hdel $k $f}
|
{$r hdel $k $f}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -211,6 +210,12 @@ proc datasetDigest r {
|
|||||||
} else {
|
} else {
|
||||||
set aux [::sha1::sha1 -hex [$r zrange $k 0 -1]]
|
set aux [::sha1::sha1 -hex [$r zrange $k 0 -1]]
|
||||||
}
|
}
|
||||||
|
} {hash} {
|
||||||
|
if {[$r hlen $k] == 0} {
|
||||||
|
set aux {}
|
||||||
|
} else {
|
||||||
|
set aux [::sha1::sha1 -hex [lsort [$r hgetall $k]]]
|
||||||
|
}
|
||||||
} default {
|
} default {
|
||||||
error "Type not supported: $t"
|
error "Type not supported: $t"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user