create or replace test_lua_test(name text) RETURNS void AS $$
local cmd = 'select generate_series(1,150000)'
local plan = server.prepare(cmd)
local cur = plan:getcursor(nil, true)
while true do
local r = cur:fetch(1)
if r == nil then break end
end
cur:close()
$$ language pllua
in this case, when i call SPI_execute('select test_lua_test('hell0')... ) in server programer pointend, the memory is leak.
leak example:
create or replace test_lua_test(name text) RETURNS void AS $$ local cmd = 'select generate_series(1,150000)' local plan = server.prepare(cmd) local cur = plan:getcursor(nil, true) while true do local r = cur:fetch(1)
if r == nil then break end end cur:close() $$ language pllua
in this case, when i call
SPI_execute('select test_lua_test('hell0')... )
in server programer pointend, the memory is leak.