Skip to content

Instantly share code, notes, and snippets.

@alexey-milovidov
Created January 26, 2017 20:36
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 alexey-milovidov/756bab8a6c49994ac9556469201c5644 to your computer and use it in GitHub Desktop.
Save alexey-milovidov/756bab8a6c49994ac9556469201c5644 to your computer and use it in GitHub Desktop.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 113
Server version: 5.5.50-0ubuntu0.14.04.1 (Ubuntu)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> SELECT 'abc' LIKE 'a_c'
-> ;
+------------------+
| 'abc' LIKE 'a_c' |
+------------------+
| 1 |
+------------------+
1 row in set (0.01 sec)
mysql> SELECT 'abc' LIKE 'a_c';
+------------------+
| 'abc' LIKE 'a_c' |
+------------------+
| 1 |
+------------------+
1 row in set (0.00 sec)
mysql> SELECT 'abc' LIKE 'a\_c';
+-------------------+
| 'abc' LIKE 'a\_c' |
+-------------------+
| 0 |
+-------------------+
1 row in set (0.00 sec)
mysql> SELECT 'abc' LIKE 'a\\_c';
+--------------------+
| 'abc' LIKE 'a\\_c' |
+--------------------+
| 0 |
+--------------------+
1 row in set (0.00 sec)
mysql> SELECT 'abc' LIKE 'a\_c';
+-------------------+
| 'abc' LIKE 'a\_c' |
+-------------------+
| 0 |
+-------------------+
1 row in set (0.00 sec)
mysql> SELECT 'a\_c';
+------+
| a\_c |
+------+
| a\_c |
+------+
1 row in set (0.00 sec)
mysql> SELECT 'a\xc';
+-----+
| axc |
+-----+
| axc |
+-----+
1 row in set (0.00 sec)
mysql> SELECT 'a\yc';
+-----+
| ayc |
+-----+
| ayc |
+-----+
1 row in set (0.00 sec)
mysql> SELECT 'a\(c';
+-----+
| a(c |
+-----+
| a(c |
+-----+
1 row in set (0.00 sec)
mysql> SELECT 'abc' RLIKE 'a\(c';
ERROR 1139 (42000): Got error 'parentheses not balanced' from regexp
mysql> SELECT 'a(c' RLIKE 'a\(c';
ERROR 1139 (42000): Got error 'parentheses not balanced' from regexp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment