Closed ApourtArtt closed 3 years ago
I'm leaving it as a second comment :
CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`(
IN p_a1 INT,
IN p_a2 INT
)
BEGIN
SELECT p_a1 + p_a2;
END
and using it through
fn main() {
let db = Database::new().expect("Failed starting db");
let mut conn = db.pool.get_conn().expect("Failed getting conn");
let vec = vec!(
String::from("100"),
String::from("100"),
);
match conn.exec_map_opt(String::from("call p1(?, ?);"), vec, handle_row) {
Ok(v) => { println!("Success: {:?}", v); },
Err(e) => { println!("Error : {}", e); },
}
}
works perfectly, so this is a valid workaround, but I'd like to be able to use return since it would be easier in my case.
Hi. Thanks for pointing this out.
blackbeam/rust_mysql_common@408effe fixes the issue. You need to wait for the next release.
Hello,
I am using your crate on a project and successfully used it for all of my needs except one. I am not able to use a MySQL function that has more than one argument, if it does, I am receiving this error :
Here is my dummy MySQL function :
Executing it through
SELECT
works as intended on MySQL Workbench. But it does not with your crate, except if I remove p_arg2, in order to make it one arg only.Here is the code I am using :
Is there something I am not doing right ? I could not find any related issues, sorry if I missed them.
Edit : I am using
mysql = "^20.0.1"