Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
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
picodata
Commits
7ebe1d66
Commit
7ebe1d66
authored
3 years ago
by
Igor Kuznetsov
Browse files
Options
Downloads
Patches
Plain Diff
refactoring: fix clippy warn
parent
1206a4d6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1414
sbroad import
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/executor/result.rs
+2
-2
2 additions, 2 deletions
src/executor/result.rs
src/executor/result/tests.rs
+1
-1
1 addition, 1 deletion
src/executor/result/tests.rs
src/ir/expression.rs
+1
-1
1 addition, 1 deletion
src/ir/expression.rs
src/lua_bridge.rs
+3
-3
3 additions, 3 deletions
src/lua_bridge.rs
with
7 additions
and
7 deletions
src/executor/result.rs
+
2
−
2
View file @
7ebe1d66
...
...
@@ -32,14 +32,14 @@ impl Serialize for Value {
impl
Eq
for
Value
{}
#[derive(LuaRead,
Debug,
PartialEq,
Eq)]
pub
struct
BoxExecute
Resul
t
{
pub
struct
BoxExecute
Forma
t
{
pub
metadata
:
Vec
<
Column
>
,
pub
rows
:
Vec
<
Vec
<
Value
>>
,
}
/// Custom Implementation `ser::Serialize`, because if using standard `#derive[Serialize]` then each `BoxExecuteResult`
/// record is serialized to a list. That is not the result we expect.
impl
Serialize
for
BoxExecute
Resul
t
{
impl
Serialize
for
BoxExecute
Forma
t
{
fn
serialize
<
S
>
(
&
self
,
serializer
:
S
)
->
Result
<
S
::
Ok
,
S
::
Error
>
where
S
:
Serializer
,
...
...
This diff is collapsed.
Click to expand it.
src/executor/result/tests.rs
+
1
−
1
View file @
7ebe1d66
...
...
@@ -6,7 +6,7 @@ use super::*;
#[test]
fn
box_execute_result_serialize
()
{
let
r
=
BoxExecute
Resul
t
{
let
r
=
BoxExecute
Forma
t
{
metadata
:
vec!
[
Column
{
name
:
"id"
.into
(),
...
...
This diff is collapsed.
Click to expand it.
src/ir/expression.rs
+
1
−
1
View file @
7ebe1d66
...
...
@@ -328,7 +328,7 @@ impl Plan {
false
}
}
else
{
result
.push
(
r_id
);
result
.push
(
r_id
);
true
}
})
...
...
This diff is collapsed.
Click to expand it.
src/lua_bridge.rs
+
3
−
3
View file @
7ebe1d66
use
crate
::
executor
::
result
::
BoxExecute
Resul
t
;
use
crate
::
executor
::
result
::
BoxExecute
Forma
t
;
use
tarantool
::
ffi
::
tarantool
::
luaT_state
;
use
tarantool
::
hlua
::{
Lua
,
LuaError
,
LuaFunction
};
use
tarantool
::
log
::{
say
,
SayLevel
};
...
...
@@ -14,7 +14,7 @@ pub fn get_cluster_schema() -> Result<String, LuaError> {
}
/// Function execute sql query on selected node
pub
fn
exec_query
(
bucket_id
:
u64
,
query
:
&
str
)
->
Result
<
BoxExecute
Resul
t
,
LuaError
>
{
pub
fn
exec_query
(
bucket_id
:
u64
,
query
:
&
str
)
->
Result
<
BoxExecute
Forma
t
,
LuaError
>
{
let
lua
=
unsafe
{
Lua
::
from_existing_state
(
luaT_state
(),
false
)
};
lua
.exec
(
...
...
@@ -40,7 +40,7 @@ pub fn exec_query(bucket_id: u64, query: &str) -> Result<BoxExecuteResult, LuaEr
)
?
;
let
exec_sql
:
LuaFunction
<
_
>
=
lua
.get
(
"execute_sql"
)
.unwrap
();
let
res
:
BoxExecute
Resul
t
=
exec_sql
.call_with_args
((
bucket_id
,
query
))
?
;
let
res
:
BoxExecute
Forma
t
=
exec_sql
.call_with_args
((
bucket_id
,
query
))
?
;
say
(
SayLevel
::
Error
,
...
...
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