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
19cc1842
Commit
19cc1842
authored
11 years ago
by
ocelot-inc
Browse files
Options
Downloads
Plain Diff
Merge branch 'stable' of
https://github.com/tarantool/tarantool
into stable
parents
16a777f4
333e4f3c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/box/tuple.cc
+12
-2
12 additions, 2 deletions
src/box/tuple.cc
src/box/tuple.h
+0
-11
0 additions, 11 deletions
src/box/tuple.h
test/box/lua.result
+4
-0
4 additions, 0 deletions
test/box/lua.result
test/box/lua.test
+3
-0
3 additions, 0 deletions
test/box/lua.test
with
19 additions
and
13 deletions
src/box/tuple.cc
+
12
−
2
View file @
19cc1842
...
...
@@ -374,14 +374,24 @@ tuple_update(struct tuple_format *format,
return
new_tuple
;
}
static
inline
void
tuple_verify_data
(
const
char
**
begin
,
const
char
*
end
,
uint32_t
field_count
)
{
while
(
*
begin
<
end
&&
field_count
--
>
0
)
{
size_t
len
=
load_varint32
(
begin
);
*
begin
+=
len
;
}
if
(
field_count
>
0
||
*
begin
!=
end
)
tnt_raise
(
IllegalParams
,
"during verifying tuple: incorrect tuple format"
);
}
struct
tuple
*
tuple_new
(
struct
tuple_format
*
format
,
uint32_t
field_count
,
const
char
**
data
,
const
char
*
end
)
{
size_t
tuple_len
=
end
-
*
data
;
if
(
tuple_len
!=
tuple_range_size
(
data
,
end
,
field_count
))
tnt_raise
(
IllegalParams
,
"tuple_new(): incorrect tuple format"
);
tuple_verify_data
(
data
,
end
,
field_count
);
struct
tuple
*
new_tuple
=
tuple_alloc
(
format
,
tuple_len
);
new_tuple
->
field_count
=
field_count
;
...
...
This diff is collapsed.
Click to expand it.
src/box/tuple.h
+
0
−
11
View file @
19cc1842
...
...
@@ -306,17 +306,6 @@ static inline size_t tuple_len(struct tuple *tuple)
sizeof
(
tuple
->
field_count
);
}
static
inline
size_t
tuple_range_size
(
const
char
**
begin
,
const
char
*
end
,
uint32_t
count
)
{
const
char
*
start
=
*
begin
;
while
(
*
begin
<
end
&&
count
--
>
0
)
{
size_t
len
=
load_varint32
(
begin
);
*
begin
+=
len
;
}
return
*
begin
-
start
;
}
void
tuple_free
(
struct
tuple
*
tuple
);
/**
...
...
This diff is collapsed.
Click to expand it.
test/box/lua.result
+
4
−
0
View file @
19cc1842
No preview for this file type
This diff is collapsed.
Click to expand it.
test/box/lua.test
+
3
−
0
View file @
19cc1842
...
...
@@ -63,6 +63,9 @@ exec sql "call f1()"
exec
admin
"lua function f1() return f1 end"
exec
sql
"call f1()"
# Test case for gh-140, crash with wrong box.process(..) call
exec
admin
"lua box.process(13, box.pack('iiippp', 0, 0, 99999, 99999, 'wrong', 'tuple'))"
exec
sql
"insert into t0 values (1, 'test box delete')"
exec
sql
"call box.delete('0', '
\1\0\0\0
')"
exec
sql
"call box.delete('0', '
\1\0\0\0
')"
...
...
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