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
9460ff26
Commit
9460ff26
authored
7 years ago
by
Roman Tsisyk
Committed by
Roman Tsisyk
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
tuple: extract tuple_format_eq() from vy_stmt.c
Needed for #2754
parent
78be091b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/box/tuple_format.c
+14
-0
14 additions, 0 deletions
src/box/tuple_format.c
src/box/tuple_format.h
+8
-0
8 additions, 0 deletions
src/box/tuple_format.h
src/box/vy_stmt.c
+1
-5
1 addition, 5 deletions
src/box/vy_stmt.c
with
23 additions
and
5 deletions
src/box/tuple_format.c
+
14
−
0
View file @
9460ff26
...
...
@@ -211,6 +211,20 @@ tuple_format_new(struct tuple_format_vtab *vtab, struct key_def **keys,
return
format
;
}
bool
tuple_format_eq
(
const
struct
tuple_format
*
a
,
const
struct
tuple_format
*
b
)
{
if
(
a
->
field_map_size
!=
b
->
field_map_size
||
a
->
field_count
!=
b
->
field_count
)
return
false
;
for
(
uint32_t
i
=
0
;
i
<
a
->
field_count
;
++
i
)
{
if
(
a
->
fields
[
i
].
type
!=
b
->
fields
[
i
].
type
||
a
->
fields
[
i
].
offset_slot
!=
b
->
fields
[
i
].
offset_slot
)
return
false
;
}
return
true
;
}
struct
tuple_format
*
tuple_format_dup
(
const
struct
tuple_format
*
src
)
{
...
...
This diff is collapsed.
Click to expand it.
src/box/tuple_format.h
+
8
−
0
View file @
9460ff26
...
...
@@ -152,6 +152,14 @@ struct tuple_format *
tuple_format_new
(
struct
tuple_format_vtab
*
vtab
,
struct
key_def
**
keys
,
uint16_t
key_count
,
uint16_t
extra_size
);
/**
* Check that two tuple formats are identical.
* @param a format a
* @param b format b
*/
bool
tuple_format_eq
(
const
struct
tuple_format
*
a
,
const
struct
tuple_format
*
b
);
/**
* Register the duplicate of the specified format.
* @param src Original format.
...
...
This diff is collapsed.
Click to expand it.
src/box/vy_stmt.c
+
1
−
5
View file @
9460ff26
...
...
@@ -325,7 +325,6 @@ vy_stmt_replace_from_upsert(struct tuple_format *replace_format,
/* Copy statement data excluding UPSERT operations */
struct
tuple_format
*
format
=
tuple_format_by_id
(
upsert
->
format_id
);
(
void
)
format
;
/*
* UPSERT must have the n_upserts field in the extra
* memory.
...
...
@@ -335,10 +334,7 @@ vy_stmt_replace_from_upsert(struct tuple_format *replace_format,
* In other fields the REPLACE tuple format must equal to
* the UPSERT tuple format.
*/
assert
(
format
->
field_map_size
==
replace_format
->
field_map_size
);
assert
(
format
->
field_count
==
replace_format
->
field_count
);
assert
(
!
memcmp
(
format
->
fields
,
replace_format
->
fields
,
sizeof
(
struct
tuple_field_format
)
*
format
->
field_count
));
assert
(
tuple_format_eq
(
format
,
replace_format
));
struct
tuple
*
replace
=
vy_stmt_alloc
(
replace_format
,
bsize
);
if
(
replace
==
NULL
)
return
NULL
;
...
...
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