RedisModule_ResetDataset should not clear the functions. (#11268)

As mentioned on docs, `RM_ResetDataset` Performs similar operation to FLUSHALL.
As FLUSHALL do not clean the function, `RM_ResetDataset` should not clean the functions
as well.

(cherry picked from commit d2ad01ab3e)
This commit is contained in:
Meir Shpilraien (Spielrein)
2022-12-12 17:36:34 +02:00
committed by Oran Agra
parent b1ede2120a
commit 6cf24fa437
2 changed files with 11 additions and 1 deletions
+10
View File
@@ -44,6 +44,16 @@ start_server {tags {"modules"}} {
assert_equal [r test.dbsize] 0
}
test {test RedisModule_ResetDataset do not reset functions} {
r function load {#!lua name=lib
redis.register_function('test', function() return 1 end)
}
assert_equal [r function list] {{library_name lib engine LUA functions {{name test description {} flags {}}}}}
r test.flushall
assert_equal [r function list] {{library_name lib engine LUA functions {{name test description {} flags {}}}}}
r function flush
}
test {test module keyexists} {
r set x foo
assert_equal 1 [r test.keyexists x]