1
0
Fork 0

Merging upstream version 25.31.4.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 21:57:20 +01:00
parent 94fd84e2b9
commit 4c76f76a29
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
68 changed files with 58911 additions and 55752 deletions

View file

@ -148,6 +148,7 @@ class Generator(metaclass=_Generator):
exp.InputModelProperty: lambda self, e: f"INPUT{self.sql(e, 'this')}",
exp.Intersect: lambda self, e: self.set_operations(e),
exp.IntervalSpan: lambda self, e: f"{self.sql(e, 'this')} TO {self.sql(e, 'expression')}",
exp.Int64: lambda self, e: self.sql(exp.cast(e.this, exp.DataType.Type.BIGINT)),
exp.LanguageProperty: lambda self, e: self.naked_property(e),
exp.LocationProperty: lambda self, e: self.naked_property(e),
exp.LogProperty: lambda _, e: f"{'NO ' if e.args.get('no') else ''}LOG",
@ -593,6 +594,7 @@ class Generator(metaclass=_Generator):
WITH_SEPARATED_COMMENTS: t.Tuple[t.Type[exp.Expression], ...] = (
exp.Command,
exp.Create,
exp.Describe,
exp.Delete,
exp.Drop,
exp.From,
@ -3896,7 +3898,14 @@ class Generator(metaclass=_Generator):
if isinstance(this, exp.TsOrDsToTimestamp) or this.is_type(exp.DataType.Type.TIMESTAMP):
return self.sql(this)
return self.sql(exp.cast(this, exp.DataType.Type.TIMESTAMP))
return self.sql(exp.cast(this, exp.DataType.Type.TIMESTAMP, dialect=self.dialect))
def tsordstodatetime_sql(self, expression: exp.TsOrDsToDatetime) -> str:
this = expression.this
if isinstance(this, exp.TsOrDsToDatetime) or this.is_type(exp.DataType.Type.DATETIME):
return self.sql(this)
return self.sql(exp.cast(this, exp.DataType.Type.DATETIME, dialect=self.dialect))
def tsordstodate_sql(self, expression: exp.TsOrDsToDate) -> str:
this = expression.this