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
82b340e6
Commit
82b340e6
authored
12 years ago
by
Konstantin Osipov
Browse files
Options
Downloads
Plain Diff
Merge branch 'bug1009992'
parents
e0aba82b
b93bde39
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
connector/c/tnt/tnt_reply.c
+8
-8
8 additions, 8 deletions
connector/c/tnt/tnt_reply.c
mod/box/box.m
+1
-2
1 addition, 2 deletions
mod/box/box.m
test/box/protocol.c
+24
-9
24 additions, 9 deletions
test/box/protocol.c
test/box/protocol.result
+1
-0
1 addition, 0 deletions
test/box/protocol.result
with
34 additions
and
19 deletions
connector/c/tnt/tnt_reply.c
+
8
−
8
View file @
82b340e6
...
...
@@ -86,14 +86,6 @@ int tnt_reply_from(struct tnt_reply *r, tnt_reply_t rcv, void *ptr) {
if
(
r
->
op
==
TNT_OP_PING
)
return
0
;
/* checking validity of operation */
if
(
r
->
op
!=
TNT_OP_INSERT
&&
r
->
op
!=
TNT_OP_UPDATE
&&
r
->
op
!=
TNT_OP_DELETE
&&
r
->
op
!=
TNT_OP_SELECT
&&
r
->
op
!=
TNT_OP_CALL
)
return
-
1
;
/* reading code */
if
(
rcv
(
ptr
,
(
char
*
)
&
r
->
code
,
sizeof
(
r
->
code
))
==
-
1
)
return
-
1
;
...
...
@@ -111,6 +103,14 @@ int tnt_reply_from(struct tnt_reply *r, tnt_reply_t rcv, void *ptr) {
return
0
;
}
/* checking validity of the operation */
if
(
r
->
op
!=
TNT_OP_INSERT
&&
r
->
op
!=
TNT_OP_UPDATE
&&
r
->
op
!=
TNT_OP_DELETE
&&
r
->
op
!=
TNT_OP_SELECT
&&
r
->
op
!=
TNT_OP_CALL
)
return
-
1
;
/* code only (BOX_QUIET flag) */
if
(
size
==
0
)
return
0
;
...
...
This diff is collapsed.
Click to expand it.
mod/box/box.m
+
1
−
2
View file @
82b340e6
...
...
@@ -77,10 +77,9 @@ box_process_rw(struct txn *txn, Port *port,
{
ev
_
tstamp
start
=
ev
_
now
()
,
stop
;
stat
_
collect
(
stat
_
base
,
op
,
1
)
;
@
try
{
Request
*
request
=
[[
Request
build
:
op
]
init
:
data
]
;
stat
_
collect
(
stat
_
base
,
op
,
1
)
;
[
request
execute
:
txn
:
port
]
;
txn
_
commit
(
txn
)
;
}
...
...
This diff is collapsed.
Click to expand it.
test/box/protocol.c
+
24
−
9
View file @
82b340e6
...
...
@@ -21,10 +21,8 @@ void test_ping()
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x0
,
0x1
,
0x0
,
0x0
,
0x0
,
0x4
,
0x1
,
0x0
,
0x0
,
0x0
};
tnt_io_send_raw
(
TNT_SNET_CAST
(
t
),
(
char
*
)
message
,
sizeof
(
message
),
1
);
t
->
wrcnt
++
;
struct
tnt_iter
i
;
tnt_iter_reply
(
&
i
,
t
);
tnt_next
(
&
i
);
...
...
@@ -37,23 +35,20 @@ void test_ping()
* https://bugs.launchpad.net/tarantool/+bug/702397 "If SELECT
* request specifies tuple count 0, no error"
*/
void
test_bug702397
()
{
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
,
0xff
,
0xff
,
0xff
,
0xff
,
0x0
,
0x0
,
0x0
,
0x0
};
tnt_io_send_raw
(
TNT_SNET_CAST
(
t
),
(
char
*
)
message
,
sizeof
(
message
),
1
);
t
->
wrcnt
++
;
struct
tnt_iter
i
;
tnt_iter_reply
(
&
i
,
t
);
tnt_next
(
&
i
);
struct
tnt_reply
*
r
=
TNT_IREPLY_PTR
(
&
i
);
printf
(
"return_code: %s, %s
\n
"
,
tnt_errcode_str
(
r
->
code
>>
8
),
r
->
error
);
tnt_errcode_str
(
TNT_REPLY_ERR
(
r
)
),
r
->
error
);
tnt_iter_free
(
&
i
);
}
...
...
@@ -61,7 +56,6 @@ void test_bug702397()
* 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
[]
=
{
...
...
@@ -71,16 +65,36 @@ void test_bug702399()
0xff
,
0xff
,
0xff
,
0xff
,
0x1
,
0x0
,
0x0
,
0x0
,
0x1
,
0x0
,
0x0
,
0x0
,
0x4
,
0x1
,
0x0
,
0x0
,
0x0
};
tnt_io_send_raw
(
TNT_SNET_CAST
(
t
),
(
char
*
)
message
,
sizeof
(
message
),
1
);
t
->
wrcnt
++
;
struct
tnt_iter
i
;
tnt_iter_reply
(
&
i
,
t
);
tnt_next
(
&
i
);
struct
tnt_reply
*
r
=
TNT_IREPLY_PTR
(
&
i
);
printf
(
"return_code: %s, %s
\n
"
,
tnt_errcode_str
(
TNT_REPLY_ERR
(
r
)),
r
->
error
);
tnt_iter_free
(
&
i
);
}
/** A test case for Bug#1009992
* https://bugs.launchpad.net/tarantool/+bug/1009992
* ER_ILLEGAL_PARAMS is returned on bad operation id
*/
void
test_bug1009992
()
{
struct
tnt_header
h
=
{
.
type
=
12345678
,
/* bad operation */
.
len
=
0
,
.
reqid
=
0
};
tnt_io_send_raw
(
TNT_SNET_CAST
(
t
),
(
char
*
)
&
h
,
sizeof
(
h
),
1
);
t
->
wrcnt
++
;
struct
tnt_iter
i
;
tnt_iter_reply
(
&
i
,
t
);
tnt_next
(
&
i
);
struct
tnt_reply
*
r
=
TNT_IREPLY_PTR
(
&
i
);
printf
(
"return_code: %s, %s
\n
"
,
tnt_errcode_str
(
r
->
code
>>
8
),
r
->
error
);
tnt_errcode_str
(
TNT_REPLY_ERR
(
r
)
),
r
->
error
);
tnt_iter_free
(
&
i
);
}
...
...
@@ -99,6 +113,7 @@ int main()
test_ping
();
test_bug702397
();
test_bug702399
();
test_bug1009992
();
tnt_stream_free
(
t
);
return
0
;
...
...
This diff is collapsed.
Click to expand it.
test/box/protocol.result
+
1
−
0
View file @
82b340e6
return_code: 0
return_code: ER_ILLEGAL_PARAMS, Illegal parameters, tuple count must be positive
return_code: ER_NO_SUCH_INDEX, No index #1 is defined in space 0
return_code: ER_ILLEGAL_PARAMS, Illegal parameters, unsupported command code, check the error log
delete from t0 where k0 = 1
Delete OK, 1 row affected
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