Skip to content

Instantly share code, notes, and snippets.

@brandonprry
Created April 7, 2015 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandonprry/ec85fb9e890a240b1579 to your computer and use it in GitHub Desktop.
Save brandonprry/ec85fb9e890a240b1579 to your computer and use it in GitHub Desktop.
mysql> select 1 from users where 'fdsa' rlike (select (case when (19>20) then 'a' else '|' end));
ERROR 1139 (42000): Got error 'empty (sub)expression' from regexp
mysql> select length((select name from users limit 0,1));
+--------------------------------------------+
| length((select name from users limit 0,1)) |
+--------------------------------------------+
| 5 |
+--------------------------------------------+
1 row in set (0.00 sec)
mysql> select 1 from users where 'fdsa' rlike (select (case when (length((select name from users limit 0,1))>20) then 'a' else '|' end));
Empty set (0.00 sec)
mysql>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment