This is similar to another project: https://gist.github.com/NoMan2000/39707fa5bb346d439c6a
This uses the code from the book "MySQL Stored Procedure Programming", except that in many places, the book does not provide the code in the source files, it only has it within the book. This is annoying, so I updated the code in places to have the code in the repo.