Skip to content
Snippets Groups Projects
Commit 3adf302c authored by Georgy Kirichenko's avatar Georgy Kirichenko Committed by Roman Tsisyk
Browse files

vinyl: add a test case for DDL while active cursor

Check that Tarantool doesn't crash when space remove
while cursor is open.

Fixes #2342
parent 831cc59d
No related branches found
No related tags found
No related merge requests found
......@@ -469,3 +469,70 @@ test_run:cmd("setopt delimiter ''");
s:drop()
---
...
-- gh-2342 cursors after death of index
create_iterator = require('utils').create_iterator
---
...
s = box.schema.space.create('test', { engine = 'vinyl' })
---
...
pk = s:create_index('primary', { parts = { 1, 'uint' } })
---
...
sk = s:create_index('sec', { parts = { 2, 'uint' } })
---
...
s:replace{1, 2, 3}
---
- [1, 2, 3]
...
s:replace{4, 5, 6}
---
- [4, 5, 6]
...
s:replace{7, 8, 9}
---
- [7, 8, 9]
...
itr = create_iterator(s, {})
---
...
f, ctx, state = s.index.sec:pairs({5}, { iterator='LE' })
---
...
itr.next()
---
- [1, 2, 3]
...
f(ctx, state)
---
- <iterator state>
- [4, 5, 6]
...
s:drop()
---
...
itr.next()
---
- null
...
f(ctx, state)
---
- null
...
f = nil
---
...
ctx = nil
---
...
state = nil
---
...
itr = nil
---
...
collectgarbage('collect')
---
- 0
...
......@@ -196,3 +196,25 @@ end ;
test_run:cmd("setopt delimiter ''");
s:drop()
-- gh-2342 cursors after death of index
create_iterator = require('utils').create_iterator
s = box.schema.space.create('test', { engine = 'vinyl' })
pk = s:create_index('primary', { parts = { 1, 'uint' } })
sk = s:create_index('sec', { parts = { 2, 'uint' } })
s:replace{1, 2, 3}
s:replace{4, 5, 6}
s:replace{7, 8, 9}
itr = create_iterator(s, {})
f, ctx, state = s.index.sec:pairs({5}, { iterator='LE' })
itr.next()
f(ctx, state)
s:drop()
itr.next()
f(ctx, state)
f = nil
ctx = nil
state = nil
itr = nil
collectgarbage('collect')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment