Well, depending on what kind of magnesium supplement you are taking, it may or may not be diarrhea. While your stools may have turned into liquid, that doesn't necessarily mean that you have a bacterial infection, which is the primary reason you get diarrhea.
There is a Colon Cleansing product called OxyPowder that utilizes Magnesium Oxide as the main ingredient to cleanse the colon, and provide oxygen to your intestines. While it is very effective at cleansing the colon of toxins & fecal matter, it will turn your poop into liquid. This is basically the by-product of the oxidation process.
I hope this will clear up some of your worries. If you are still concerned about the use of magnesium, I would talk to your doctor about it.