Updated stored proc to work with MySQL bench