Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tarantool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
tarantool
Commits
86d14a78
Commit
86d14a78
authored
10 years ago
by
Konstantin Osipov
Browse files
Options
Downloads
Patches
Plain Diff
Add a scenario of old truncate implementation to the test suite. (gh-438)
parent
730631f2
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/big/tree_pk_multipart.result
+34
-0
34 additions, 0 deletions
test/big/tree_pk_multipart.result
test/big/tree_pk_multipart.test.lua
+23
-0
23 additions, 0 deletions
test/big/tree_pk_multipart.test.lua
with
57 additions
and
0 deletions
test/big/tree_pk_multipart.result
+
34
−
0
View file @
86d14a78
...
...
@@ -481,6 +481,40 @@ space:replace{1, 1}
space:drop()
---
...
-- test deletion of data one by one
space = box.schema.space.create('test')
---
...
space:create_index('primary', { type = 'tree', parts = {1, 'str'}, unique = true })
---
...
space:create_index('second', { type = 'tree', parts = {2, 'str', 3, 'str'}, unique = true })
---
...
--# setopt delimiter ';'
for i = 1, 100 do
v = tostring(i)
space:insert{v, string.rep(v, 2) , string.rep(v, 3)}
end;
---
...
local pk = space.index[0]
while pk:len() > 0 do
local state, t
for state, t in pk:pairs() do
local key = {}
for _k2, parts in ipairs(pk.parts) do
table.insert(key, t[parts.fieldno])
end
space:delete(key)
end
end;
---
...
--# setopt delimiter ''
space:drop()
---
...
space = nil
---
...
This diff is collapsed.
Click to expand it.
test/big/tree_pk_multipart.test.lua
+
23
−
0
View file @
86d14a78
...
...
@@ -168,4 +168,27 @@ space:replace{1, 1}
space
:
drop
()
-- test deletion of data one by one
space
=
box
.
schema
.
space
.
create
(
'test'
)
space
:
create_index
(
'primary'
,
{
type
=
'tree'
,
parts
=
{
1
,
'str'
},
unique
=
true
})
space
:
create_index
(
'second'
,
{
type
=
'tree'
,
parts
=
{
2
,
'str'
,
3
,
'str'
},
unique
=
true
})
--# setopt delimiter ';'
for
i
=
1
,
100
do
v
=
tostring
(
i
)
space
:
insert
{
v
,
string.rep
(
v
,
2
)
,
string.rep
(
v
,
3
)}
end
;
local
pk
=
space
.
index
[
0
]
while
pk
:
len
()
>
0
do
local
state
,
t
for
state
,
t
in
pk
:
pairs
()
do
local
key
=
{}
for
_k2
,
parts
in
ipairs
(
pk
.
parts
)
do
table.insert
(
key
,
t
[
parts
.
fieldno
])
end
space
:
delete
(
key
)
end
end
;
--# setopt delimiter ''
space
:
drop
()
space
=
nil
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment