Just took me 2 hours to troubleshoot an issue on my backend.
Cause was that of empty string being equal to space:
SELECT ' ' = '';
-> 1
SELECT STRCMP(' ', '');
-> 0 /* means equal */
Interestingly enough,
SELECT '' REGEXP '[ ]';
-> 0
SELECT '' REGEXP ' ';
-> 0
SELECT ' ' REGEXP ' ';
-> 1
Can I prevent this? Is it a setting?
See Question&Answers more detail:os