Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
12f72a71
Commit
12f72a71
authored
Mar 18, 2010
by
antirez
Browse files
test-redis.tcl dataset digest function Hash support
parent
ad6de43c
Changes
1
Hide whitespace changes
Inline
Side-by-side
test-redis.tcl
View file @
12f72a71
...
@@ -152,7 +152,6 @@ proc createComplexDataset {r ops} {
...
@@ -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} {
...
@@ -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 {
...
@@ -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
"
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment