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?
''
and' '
are placeholders, I don't really want to use LIKE instead of = in all my queries... – Reaper