mysql create functions and shared functions