Commit 941cdc27 authored by Oran Agra's avatar Oran Agra
Browse files

Merge branch 'unstable' into 7.2 to prepare for 7.2.0 GA

parents 1a589818 f4549d1c
...@@ -182,4 +182,33 @@ start_server {tags {"incr"}} { ...@@ -182,4 +182,33 @@ start_server {tags {"incr"}} {
r incrbyfloat foo [expr double(-1)/41] r incrbyfloat foo [expr double(-1)/41]
r get foo r get foo
} {0} } {0}
foreach cmd {"incr" "decr" "incrby" "decrby"} {
test "$cmd operation should update encoding from raw to int" {
set res {}
set expected {1 12}
if {[string match {*incr*} $cmd]} {
lappend expected 13
} else {
lappend expected 11
}
r set foo 1
assert_encoding "int" foo
lappend res [r get foo]
r append foo 2
assert_encoding "raw" foo
lappend res [r get foo]
if {[string match {*by*} $cmd]} {
r $cmd foo 1
} else {
r $cmd foo
}
assert_encoding "int" foo
lappend res [r get foo]
assert_equal $res $expected
}
}
} }
...@@ -656,4 +656,19 @@ if {[string match {*jemalloc*} [s mem_allocator]]} { ...@@ -656,4 +656,19 @@ if {[string match {*jemalloc*} [s mem_allocator]]} {
} }
} }
} }
test {APPEND modifies the encoding from int to raw} {
r del foo
r set foo 1
assert_encoding "int" foo
r append foo 2
set res {}
lappend res [r get foo]
assert_encoding "raw" foo
r set bar 12
assert_encoding "int" bar
lappend res [r get bar]
} {12 12}
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment