diff --git a/compose.yaml b/compose.yaml index 11dca99fa2a7..f08114534bd5 100644 --- a/compose.yaml +++ b/compose.yaml @@ -31,7 +31,7 @@ services: - CMD - mariadb-admin - ping - image: mariadb:11.6.2 + image: mariadb:11.7.2 ports: - 3306:3306 networks: diff --git a/ibis/backends/sql/compilers/mysql.py b/ibis/backends/sql/compilers/mysql.py index d8f0c3262d13..910a7606717f 100644 --- a/ibis/backends/sql/compilers/mysql.py +++ b/ibis/backends/sql/compilers/mysql.py @@ -115,7 +115,11 @@ def visit_Cast(self, op, *, arg, to): # for TEXT (except when casting of course!) return arg elif from_.is_integer() and to.is_timestamp(): - return self.f.from_unixtime(arg) + return self.if_( + arg.eq(0), + self.f.timestamp("1970-01-01 00:00:00"), + self.f.from_unixtime(arg), + ) return super().visit_Cast(op, arg=arg, to=to) def visit_TimestampDiff(self, op, *, left, right):