fix mysql bugs,
added lots of debug code :(
fix mysql bugs,
added lots of debug code :(