Hello Alice,
I attached two SQL files to this bug.
The files represents two databases that I use in my system.
You can import both of them in your MariaDB server to test.
One database will be called "solaris_1_control" and the other "solaris_server"
In "solaris_1_control" there is a stored procedure called "logic_procedure_1",
it is very complex but basically do some sleeps and some updates on "solaris_1_control".
After some hours of running (not always) the SLEEP functions inside the procedure starts to return
much beforehand, approximately the wait time lasts 5 seconds (instead of some hours...).
Please let me know, I think that maybe this can be a bug with the interpretation of the argument or
with threads interruption...scratching my head
Could you please add the test case to demonstrate the problem?