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
2d9b148e
Commit
2d9b148e
authored
13 years ago
by
Konstantin Osipov
Browse files
Options
Downloads
Plain Diff
Merge branch Bug#702399 into master-stable.
Conflicts: include/iproto.h test/box/protocol.c test/box/protocol.result
parents
cab962b6
34fd4a71
Loading
Loading
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
include/errcode.h
+2
-1
2 additions, 1 deletion
include/errcode.h
mod/silverbox/box.c
+2
-2
2 additions, 2 deletions
mod/silverbox/box.c
test/box/protocol.c
+29
-5
29 additions, 5 deletions
test/box/protocol.c
test/box/protocol.result
+1
-0
1 addition, 0 deletions
test/box/protocol.result
with
34 additions
and
8 deletions
include/errcode.h
+
2
−
1
View file @
2d9b148e
...
...
@@ -73,7 +73,8 @@ struct errcode_record {
/* 54 */
_(ERR_CODE_UNUSED54, 0, "Unused54") \
/* 55 */
_(ERR_CODE_NODE_FOUND, 2, "Node is found") \
/* 56 */
_(ERR_CODE_INDEX_VIOLATION, 2, "Some index violation occur") \
/* 57 */
_(ERR_CODE_NO_SUCH_NAMESPACE, 2, "There is no such namespace")
/* 57 */
_(ERR_CODE_NO_SUCH_NAMESPACE, 2, "There is no such namespace") \
_(ERR_CODE_NO_SUCH_INDEX, 2, "No index with the given id is defined")
ENUM0
(
tnt_error_codes_enum
,
ERROR_CODES
);
extern
struct
errcode_record
tnt_error_codes
[];
...
...
This diff is collapsed.
Click to expand it.
mod/silverbox/box.c
+
2
−
2
View file @
2d9b148e
...
...
@@ -812,10 +812,10 @@ box_dispach(struct box_txn *txn, enum box_mode mode, u16 op, struct tbuf *data)
u32
limit
=
read_u32
(
data
);
if
(
i
>
MAX_IDX
)
box_raise
(
ERR_CODE_
ILLEGAL_PARAMS
,
"index too big"
);
box_raise
(
ERR_CODE_
NO_SUCH_INDEX
,
"index too big"
);
txn
->
index
=
&
namespace
[
txn
->
n
].
index
[
i
];
if
(
txn
->
index
->
key_cardinality
==
0
)
box_raise
(
ERR_CODE_
ILLEGAL_PARAMS
,
"index is invalid"
);
box_raise
(
ERR_CODE_
NO_SUCH_INDEX
,
"index is invalid"
);
stat_collect
(
stat_base
,
op
,
1
);
return
process_select
(
txn
,
limit
,
offset
,
data
);
...
...
This diff is collapsed.
Click to expand it.
test/box/protocol.c
+
29
−
5
View file @
2d9b148e
...
...
@@ -18,13 +18,13 @@ void test_ping()
}
/** A test case for Bug#702397
* https://bugs.launchpad.net/tarantool/+bug/702397 "If SELECT
* request specifies tuple count 0, no error"
*/
void
test_bug702397
()
{
/*
* A test case for Bug#702397
* https://bugs.launchpad.net/tarantool/+bug/702397
* "If SELECT request specifies tuple count 0, no error"
*/
const
char
message
[]
=
{
0x11
,
0x0
,
0x0
,
0x0
,
0x14
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
...
...
@@ -36,6 +36,29 @@ void test_bug702397()
tnt_errcode_desc
(
tnt_res
.
errcode
>>
8
));
}
/** A test case for Bug#702399
* https://bugs.launchpad.net/tarantool/+bug/702399
* ERR_CODE_ILLEGAL_PARAMS is returned when there is no such key
*/
void
test_bug702399
()
{
const
char
message
[]
=
{
0x11
,
0x0
,
0x0
,
0x0
,
0x1d
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x1
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0xff
,
0xff
,
0xff
,
0xff
,
0x1
,
0x0
,
0x0
,
0x0
,
0x1
,
0x0
,
0x0
,
0x0
,
0x4
,
0x1
,
0x0
,
0x0
,
0x0
};
struct
tnt_result
tnt_res
;
int
res
=
tnt_execute_raw
(
conn
,
message
,
sizeof
message
,
&
tnt_res
);
printf
(
"return_code: %s, %s
\n
"
,
tnt_errcode_str
(
tnt_res
.
errcode
>>
8
),
tnt_errcode_desc
(
tnt_res
.
errcode
>>
8
));
}
int
main
()
{
conn
=
tnt_connect
(
"localhost"
,
33013
);
...
...
@@ -44,6 +67,7 @@ int main()
test_ping
();
test_bug702397
();
test_bug702399
();
tnt_disconnect
(
conn
);
return
0
;
...
...
This diff is collapsed.
Click to expand it.
test/box/protocol.result
+
1
−
0
View file @
2d9b148e
return_code: 0
return_code: ERR_CODE_ILLEGAL_PARAMS, "Illegal parameters"
return_code: ERR_CODE_NO_SUCH_INDEX, "No index with the given id is defined"
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