Soldato
A child shouldn't be in pain after needing the toilet for a few tens of minutes. If they are then as already has been said, there's probably something medically wrong with them in which case the parent should have informed the school and they'd have a free pass anyway, or if they were in pain the teacher would act.
Lakeland's post describes it pretty well.
Also no, not a teacher.
So why did you ask if I was a qualified teacher?
Are you perhaps a qualified paediatrician?
Lakelands post shows him to be a good teacher with intelligence and wit who assesses each situation, instead of the the OP who simply dismisses a child's request to use the toilet. As it would appear would you.