mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 02:44:59 +00:00
handling missing epoch constraint correctly (#2366)
(cherry picked from commit 843312dfc9)
This commit is contained in:
parent
f42a33640a
commit
bb2c805cac
1 changed files with 7 additions and 5 deletions
|
|
@ -170,12 +170,14 @@ func (p *ExecutionPlanner) compileColumn(col *parser.ColumnDefinition) (*createT
|
|||
unit := c.Expr.(*parser.StringLit)
|
||||
timeUnit = unit.Value
|
||||
|
||||
epochString := c.EpochExpr.(*parser.StringLit)
|
||||
tm, err := time.ParseInLocation(time.RFC3339, epochString.Value, time.UTC)
|
||||
if err != nil {
|
||||
return nil, sql3.NewErrInvalidTimeEpoch(c.EpochExpr.Pos().Line, c.EpochExpr.Pos().Line, epochString.Value)
|
||||
if c.EpochExpr != nil {
|
||||
epochString := c.EpochExpr.(*parser.StringLit)
|
||||
tm, err := time.ParseInLocation(time.RFC3339, epochString.Value, time.UTC)
|
||||
if err != nil {
|
||||
return nil, sql3.NewErrInvalidTimeEpoch(c.EpochExpr.Pos().Line, c.EpochExpr.Pos().Line, epochString.Value)
|
||||
}
|
||||
epoch = tm
|
||||
}
|
||||
epoch = tm
|
||||
|
||||
case *parser.TimeQuantumConstraint:
|
||||
unit := c.Expr.(*parser.StringLit)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue