Sayyidah Aishah Siddiqah (may Allah be pleased with her) states: The Prophet (peace and blessings be upon him) would not pray while he felt anything of the urge (that is, to urinate or relieve himself).
Tabarani recorded it in al-Mu'jam al-Awsat; its chain contains Abu Ma'shar al-Sindi, whom many people declared da'if (weak) and others declared thiqah (trustworthy). I say: Some hadiths on this subject have already passed, in which it is mentioned that the imam remembers that he is without ablution; likewise some narrations have passed in the chapter on purification.
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الصلاة / 2489