Postgres returns a timestamp from date_trunc, whereas MySQL returns a

date from date().  We should probably just modify DateFuncs.date to
return a date in both cases (perhaps with a separate DateFun.DateCast
class), but for now it's easier to have MySQL return a timestamp as
well.
This commit is contained in:
Andrzej Kapolka
2010-07-22 21:37:11 +00:00
parent 27ff0f6f55
commit 061219bc57
@@ -90,7 +90,10 @@ public class MySQLBuilder
public Void visit (DateTruncate exp)
{
// exp.getTruncation() is currently always DAY
return appendFunctionCall("date", exp.getArg());
_builder.append(" cast(");
appendFunctionCall("date", exp.getArg());
_builder.append(" as datetime)");
return null;
}
protected String getDateFunction (Part part)