During some recent project issues I found myself asking this very question: Does MySQL short circuit WHERE clause statements?
After doing some research and finding that several other people and technical forums have posed this question, with several answers pertaining to be intelligent but that amount to "i don't know", I decided to perform some experiments.
Firstly, how to test whether a statement is being executed or not? Solution: make it throw an exception. I initially tried some select statements with parameters and division by zero, but MySQL apparently returns NULL instead of a divide-by-zero error. So I came up with the following statements:
SELECT * FROM tblp WHERE true OR (SELECT value FROM tblp); SELECT * FROM tblp SELECT false OR (SELECT value FROM tblp);
While this is syntactically a legal statement, it is not a logically correct one as the subquery will return multiple rows.
The first statement executes successfully and returns all rows in the table, equivalent to
select * from tblp where true
The second statement, however, throws an error
Subquery returns more than 1 row
This to me is pretty definitive evidence that MySQL does short circuit WHERE OR statements.