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

alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion-sqlparser-rs.git


The following commit(s) were added to refs/heads/main by this push:
     new a9a9d58c Fix typo in `Dialect::supports_eq_alias_assigment` (#1478)
a9a9d58c is described below

commit a9a9d58c389a77f4ea3fc4ee2395b34739b64c62
Author: Andrew Lamb <[email protected]>
AuthorDate: Wed Nov 6 10:47:01 2024 -0500

    Fix typo in `Dialect::supports_eq_alias_assigment` (#1478)
---
 src/dialect/mod.rs        | 2 +-
 src/dialect/mssql.rs      | 2 +-
 src/parser/mod.rs         | 2 +-
 tests/sqlparser_common.rs | 4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/dialect/mod.rs b/src/dialect/mod.rs
index 28e7ac7d..7e43439a 100644
--- a/src/dialect/mod.rs
+++ b/src/dialect/mod.rs
@@ -582,7 +582,7 @@ pub trait Dialect: Debug + Any {
     ///  SELECT col_alias = col FROM tbl;
     ///  SELECT col_alias AS col FROM tbl;
     /// ```
-    fn supports_eq_alias_assigment(&self) -> bool {
+    fn supports_eq_alias_assignment(&self) -> bool {
         false
     }
 
diff --git a/src/dialect/mssql.rs b/src/dialect/mssql.rs
index 78ec621e..a5ee0bf7 100644
--- a/src/dialect/mssql.rs
+++ b/src/dialect/mssql.rs
@@ -50,7 +50,7 @@ impl Dialect for MsSqlDialect {
         true
     }
 
-    fn supports_eq_alias_assigment(&self) -> bool {
+    fn supports_eq_alias_assignment(&self) -> bool {
         true
     }
 
diff --git a/src/parser/mod.rs b/src/parser/mod.rs
index c4b92ba4..1ad637f9 100644
--- a/src/parser/mod.rs
+++ b/src/parser/mod.rs
@@ -11235,7 +11235,7 @@ impl<'a> Parser<'a> {
                 left,
                 op: BinaryOperator::Eq,
                 right,
-            } if self.dialect.supports_eq_alias_assigment()
+            } if self.dialect.supports_eq_alias_assignment()
                 && matches!(left.as_ref(), Expr::Identifier(_)) =>
             {
                 let Expr::Identifier(alias) = *left else {
diff --git a/tests/sqlparser_common.rs b/tests/sqlparser_common.rs
index 4016e5a6..94dfcfec 100644
--- a/tests/sqlparser_common.rs
+++ b/tests/sqlparser_common.rs
@@ -11353,7 +11353,7 @@ fn test_any_some_all_comparison() {
 
 #[test]
 fn test_alias_equal_expr() {
-    let dialects = all_dialects_where(|d| d.supports_eq_alias_assigment());
+    let dialects = all_dialects_where(|d| d.supports_eq_alias_assignment());
     let sql = r#"SELECT some_alias = some_column FROM some_table"#;
     let expected = r#"SELECT some_column AS some_alias FROM some_table"#;
     let _ = dialects.one_statement_parses_to(sql, expected);
@@ -11362,7 +11362,7 @@ fn test_alias_equal_expr() {
     let expected = r#"SELECT (a * b) AS some_alias FROM some_table"#;
     let _ = dialects.one_statement_parses_to(sql, expected);
 
-    let dialects = all_dialects_where(|d| !d.supports_eq_alias_assigment());
+    let dialects = all_dialects_where(|d| !d.supports_eq_alias_assignment());
     let sql = r#"SELECT x = (a * b) FROM some_table"#;
     let expected = r#"SELECT x = (a * b) FROM some_table"#;
     let _ = dialects.one_statement_parses_to(sql, expected);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to