The Messenger of Allah ﷺ said, "No Muslim should stand for prayer while needing to relieve himself until he has eased himself."
حدثنا محمد بن المصفى الحمصي حدثنا بقية عن حبيب بن صالح عن يزيد بن شريح عن أبي حي المؤذن
عن رسول الله ﷺ أنه قال لا يقوم أحد من المسلمين وهو حاقن حتى يتخفف
No references are available.
[Hasan] Reported by Abu Dawud, Purification, Chapter "Should a man pray while holding back the urge to urinate?", no. 90. Tirmidhi graded it hasan, no. 357, as did Baghawi.