You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by gi...@apache.org on 2026/02/07 06:34:34 UTC

(datafusion-sqlparser-rs) branch gh-readonly-queue/main/pr-2197-272c25ed83b97cce5a217f601e8b00e9117ce51f created (now 329a94cc)

This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a change to branch gh-readonly-queue/main/pr-2197-272c25ed83b97cce5a217f601e8b00e9117ce51f
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git


      at 329a94cc Fix panic on incomplete REGEXP/MATCH expressions in SQLite dialect (#2197)

This branch includes the following new commits:

     new 329a94cc Fix panic on incomplete REGEXP/MATCH expressions in SQLite dialect (#2197)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org


(datafusion-sqlparser-rs) 01/01: Fix panic on incomplete REGEXP/MATCH expressions in SQLite dialect (#2197)

Posted by gi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a commit to branch gh-readonly-queue/main/pr-2197-272c25ed83b97cce5a217f601e8b00e9117ce51f
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git

commit 329a94cc0119face45ac6d44f115e33c5abc33c7
Author: Luca Cappelletti <ca...@gmail.com>
AuthorDate: Sat Feb 7 07:34:10 2026 +0100

    Fix panic on incomplete REGEXP/MATCH expressions in SQLite dialect (#2197)
---
 src/dialect/sqlite.rs     | 5 ++++-
 tests/sqlparser_sqlite.rs | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/dialect/sqlite.rs b/src/dialect/sqlite.rs
index 765b3874..b44a1c5b 100644
--- a/src/dialect/sqlite.rs
+++ b/src/dialect/sqlite.rs
@@ -89,7 +89,10 @@ impl Dialect for SQLiteDialect {
         ] {
             if parser.parse_keyword(keyword) {
                 let left = Box::new(expr.clone());
-                let right = Box::new(parser.parse_expr().unwrap());
+                let right = Box::new(match parser.parse_expr() {
+                    Ok(expr) => expr,
+                    Err(e) => return Some(Err(e)),
+                });
                 return Some(Ok(Expr::BinaryOp { left, op, right }));
             }
         }
diff --git a/tests/sqlparser_sqlite.rs b/tests/sqlparser_sqlite.rs
index da311ac0..ffe94ab8 100644
--- a/tests/sqlparser_sqlite.rs
+++ b/tests/sqlparser_sqlite.rs
@@ -602,6 +602,10 @@ fn test_regexp_operator() {
         }
     );
     sqlite().verified_only_select(r#"SELECT count(*) FROM messages WHERE msg_text REGEXP '\d+'"#);
+
+    // Should return an error, not panic
+    assert!(sqlite().parse_sql_statements("SELECT 1 REGEXP").is_err());
+    assert!(sqlite().parse_sql_statements("SELECT 1 MATCH").is_err());
 }
 
 #[test]


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org