blackbeam / rust-mysql-simple

Mysql client library implemented in rust.
Apache License 2.0
663 stars 144 forks source link

support statement query timeout #331

Open ysn2233 opened 2 years ago

ysn2233 commented 2 years ago

JDBC implementation: schedule a timer thread to send "KILL QUERY" command to mysql server when the statement executed over a timeout

rusher commented 7 months ago

You can either set a global query timeout for your connection using set @@max_statement_time=XX (be carefull, value for MariaDB are in seconds, and MySQL in milliseconds) if you are using MariaDB, you can set that per command, prefixing commands with SET STATEMENT max_statement_time=XX FOR <command>.