Skip to content

Commit

Permalink
fix(tsql): Generate LOG(...) for exp.Ln (#4318)
Browse files Browse the repository at this point in the history
  • Loading branch information
VaggelisD authored Oct 30, 2024
1 parent 2af4936 commit 749886b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions sqlglot/dialects/tsql.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,7 @@ class Generator(generator.Generator):
exp.JSONExtract: _json_extract_sql,
exp.JSONExtractScalar: _json_extract_sql,
exp.LastDay: lambda self, e: self.func("EOMONTH", e.this),
exp.Ln: rename_func("LOG"),
exp.Max: max_or_greatest,
exp.MD5: lambda self, e: self.func("HASHBYTES", exp.Literal.string("MD5"), e.this),
exp.Min: min_or_least,
Expand Down
1 change: 1 addition & 0 deletions tests/dialects/test_tsql.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ def test_tsql(self):
},
)
self.validate_identity("HASHBYTES('MD2', 'x')")
self.validate_identity("LOG(n)")
self.validate_identity("LOG(n, b)")

self.validate_all(
Expand Down

0 comments on commit 749886b

Please sign in to comment.