Skip to content

Commit 42c01d5

Browse files
committed
test: test cache get with space_name == nil [TO SQUASH]
1 parent 989e61f commit 42c01d5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/cache_test.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,3 +230,16 @@ function g.test_cache_space_updated_name()
230230
t.assert_type(id, 'number')
231231
t.assert_equals(id, 44)
232232
end
233+
234+
function g.test_cache_nil_space()
235+
local sharding_func_first = 'sharding_func_first'
236+
rawset(_G, sharding_func_first, function(key) return key + 1 end)
237+
rawset(_G, 'sharding_func_second', function(key) return key + 2 end)
238+
g.schema.spaces.space.sharding_func = sharding_func_first
239+
local ok, err = ddl.set_schema(g.schema)
240+
t.assert_equals(err, nil)
241+
t.assert_equals(ok, true)
242+
243+
local res = cache.internal.get()
244+
t.assert_equals(res, nil)
245+
end

0 commit comments

Comments
 (0)