mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-10-10 05:52:13 +00:00
Add support for NULL escape char in pattern match searches (#1913)
Some checks are pending
license / Release Audit Tool (RAT) (push) Waiting to run
Rust / codestyle (push) Waiting to run
Rust / lint (push) Waiting to run
Rust / benchmark-lint (push) Waiting to run
Rust / compile (push) Waiting to run
Rust / docs (push) Waiting to run
Rust / compile-no-std (push) Waiting to run
Rust / test (beta) (push) Waiting to run
Rust / test (nightly) (push) Waiting to run
Rust / test (stable) (push) Waiting to run
Some checks are pending
license / Release Audit Tool (RAT) (push) Waiting to run
Rust / codestyle (push) Waiting to run
Rust / lint (push) Waiting to run
Rust / benchmark-lint (push) Waiting to run
Rust / compile (push) Waiting to run
Rust / docs (push) Waiting to run
Rust / compile-no-std (push) Waiting to run
Rust / test (beta) (push) Waiting to run
Rust / test (nightly) (push) Waiting to run
Rust / test (stable) (push) Waiting to run
This commit is contained in:
parent
942d747d89
commit
b0bcc46e22
3 changed files with 29 additions and 12 deletions
|
@ -809,7 +809,7 @@ pub enum Expr {
|
|||
any: bool,
|
||||
expr: Box<Expr>,
|
||||
pattern: Box<Expr>,
|
||||
escape_char: Option<String>,
|
||||
escape_char: Option<Value>,
|
||||
},
|
||||
/// `ILIKE` (case-insensitive `LIKE`)
|
||||
ILike {
|
||||
|
@ -819,14 +819,14 @@ pub enum Expr {
|
|||
any: bool,
|
||||
expr: Box<Expr>,
|
||||
pattern: Box<Expr>,
|
||||
escape_char: Option<String>,
|
||||
escape_char: Option<Value>,
|
||||
},
|
||||
/// SIMILAR TO regex
|
||||
SimilarTo {
|
||||
negated: bool,
|
||||
expr: Box<Expr>,
|
||||
pattern: Box<Expr>,
|
||||
escape_char: Option<String>,
|
||||
escape_char: Option<Value>,
|
||||
},
|
||||
/// MySQL: RLIKE regex or REGEXP regex
|
||||
RLike {
|
||||
|
@ -1488,7 +1488,7 @@ impl fmt::Display for Expr {
|
|||
} => match escape_char {
|
||||
Some(ch) => write!(
|
||||
f,
|
||||
"{} {}LIKE {}{} ESCAPE '{}'",
|
||||
"{} {}LIKE {}{} ESCAPE {}",
|
||||
expr,
|
||||
if *negated { "NOT " } else { "" },
|
||||
if *any { "ANY " } else { "" },
|
||||
|
@ -1513,7 +1513,7 @@ impl fmt::Display for Expr {
|
|||
} => match escape_char {
|
||||
Some(ch) => write!(
|
||||
f,
|
||||
"{} {}ILIKE {}{} ESCAPE '{}'",
|
||||
"{} {}ILIKE {}{} ESCAPE {}",
|
||||
expr,
|
||||
if *negated { "NOT " } else { "" },
|
||||
if *any { "ANY" } else { "" },
|
||||
|
@ -1568,7 +1568,7 @@ impl fmt::Display for Expr {
|
|||
} => match escape_char {
|
||||
Some(ch) => write!(
|
||||
f,
|
||||
"{} {}SIMILAR TO {} ESCAPE '{}'",
|
||||
"{} {}SIMILAR TO {} ESCAPE {}",
|
||||
expr,
|
||||
if *negated { "NOT " } else { "" },
|
||||
pattern,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue