mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-22 15:04:04 +00:00
Ignore escaped LIKE wildcards in MySQL (#1735)
This commit is contained in:
parent
ed416548dc
commit
a629ddf89b
5 changed files with 89 additions and 15 deletions
|
@ -2627,6 +2627,17 @@ fn parse_rlike_and_regexp() {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_like_with_escape() {
|
||||
// verify backslash is not stripped for escaped wildcards
|
||||
mysql().verified_only_select(r#"SELECT 'a\%c' LIKE 'a\%c'"#);
|
||||
mysql().verified_only_select(r#"SELECT 'a\_c' LIKE 'a\_c'"#);
|
||||
mysql().verified_only_select(r#"SELECT '%\_\%' LIKE '%\_\%'"#);
|
||||
mysql().verified_only_select(r#"SELECT '\_\%' LIKE CONCAT('\_', '\%')"#);
|
||||
mysql().verified_only_select(r#"SELECT 'a%c' LIKE 'a$%c' ESCAPE '$'"#);
|
||||
mysql().verified_only_select(r#"SELECT 'a_c' LIKE 'a#_c' ESCAPE '#'"#);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_kill() {
|
||||
let stmt = mysql_and_generic().verified_stmt("KILL CONNECTION 5");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue