You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 11, 2021. It is now read-only.
@@ -156,19 +173,18 @@ impl<'s> CommandV2<'s> for Exec<'s> {
156
173
now:false,
157
174
no_header:false,
158
175
to_execute:None,
159
-
args:Vec::new(),
160
176
};
161
177
whileletSome(arg) = args_iter.next(){
162
178
letmut arg_string = String::from(*arg);
163
179
arg_string.make_ascii_uppercase();
164
180
match arg_string.as_str(){
165
181
"COMMAND" => match exec.to_execute{
166
-
Some(ToExecute::Statement(_)) => {
182
+
Some(ToExecute::Statement{ .. }) => {
167
183
returnErr(
168
184
RediSQLError::both_statement_and_query(),
169
185
);
170
186
}
171
-
Some(ToExecute::Command(_)) => {
187
+
Some(ToExecute::Command{ .. }) => {
172
188
returnErr(RediSQLError::with_code(
173
189
13,
174
190
"Impossible to know which query should be executed".to_string(),
@@ -186,17 +202,19 @@ impl<'s> CommandV2<'s> for Exec<'s> {
186
202
))
187
203
}
188
204
};
189
-
exec.to_execute =
190
-
Some(ToExecute::Command(query));
205
+
exec.to_execute = Some(ToExecute::Command{
206
+
query,
207
+
args:Vec::new(),
208
+
});
191
209
}
192
210
},
193
211
"STATEMENT" => match exec.to_execute{
194
-
Some(ToExecute::Command(_)) => {
212
+
Some(ToExecute::Command{ .. }) => {
195
213
returnErr(
196
214
RediSQLError::both_statement_and_query(),
197
215
);
198
216
}
199
-
Some(ToExecute::Statement(_)) => {
217
+
Some(ToExecute::Statement{ .. }) => {
200
218
returnErr(RediSQLError::with_code(
201
219
14,
202
220
"Impossible to know which statement should be executed".to_string(),
@@ -216,7 +234,10 @@ impl<'s> CommandV2<'s> for Exec<'s> {
216
234
}
217
235
};
218
236
exec.to_execute =
219
-
Some(ToExecute::Statement(stmt));
237
+
Some(ToExecute::Statement{
238
+
stmt,
239
+
args:Vec::new(),
240
+
});
220
241
}
221
242
},
222
243
"READ_ONLY" => exec.read_only = true,
@@ -236,10 +257,23 @@ impl<'s> CommandV2<'s> for Exec<'s> {
236
257
}
237
258
"NO_HEADER" => exec.no_header = true,
238
259
"ARGS" => {
260
+
let args = match exec.to_execute{
261
+
None => {
262
+
returnErr(RediSQLError::with_code(24,"You didn't provide neither `COMMAND` nor `STATEMENT` fields".to_string(),"Command incomplete, no `COMMAND` nor `STATEMENT` fields".to_string()));
0 commit comments