All of a sudden needing to go to the bathroom?

TMI but I woke up in the middle of the night and all of a sudden I had to run to the bathroom cause I felt like I had to poop but it was just a fart. Then a couple minutes later I end up going is that normal to have sudden painful bowel movements?? Im also 28 wks