From 989f06bec6c3a67cfe829962bbc129a829573137 Mon Sep 17 00:00:00 2001 From: Aleksandr Razumov Date: Sun, 19 Jun 2022 01:14:08 +0300 Subject: [PATCH] feat(proto): improve datetime inference --- proto/col_auto.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/proto/col_auto.go b/proto/col_auto.go index cec5ff74..a6165eec 100644 --- a/proto/col_auto.go +++ b/proto/col_auto.go @@ -42,7 +42,11 @@ func (c *ColAuto) Infer(t ColumnType) error { default: switch t.Base() { case ColumnTypeDateTime: - c.Data = new(ColDateTime) + v := new(ColDateTime) + if err := v.Infer(t); err != nil { + return errors.Wrap(err, "datetime") + } + c.Data = v c.DataType = t return nil case ColumnTypeEnum8, ColumnTypeEnum16: @@ -56,7 +60,7 @@ func (c *ColAuto) Infer(t ColumnType) error { case ColumnTypeDateTime64: v := new(ColDateTime64) if err := v.Infer(t); err != nil { - return errors.Wrap(err, "datetime") + return errors.Wrap(err, "datetime64") } c.Data = v c.DataType = t