A couple of things.
Make sure you're running the latest update to the mysql version you're running, in case the bug you've apparently found has been fixed already. After making sure you're running the latest update, you should make up a reproduceable test case that you can make happen in a brand new MySQL instance. Then post a bug report to mysql and let them fix it.
I'm assuming that you've found a bug. If it's reproduceable that's the easiest ones to troubleshoot.