(ctx []antlrgen.IExpressionContext)
| 1436 | } |
| 1437 | |
| 1438 | func (v *ASTBuilder) setTimefilter(ctx []antlrgen.IExpressionContext) { |
| 1439 | column := util.TrimQuote(v.getText(ctx[0])) |
| 1440 | from := util.TrimQuote(v.getText(ctx[1])) |
| 1441 | to := util.TrimQuote(v.getText(ctx[2])) |
| 1442 | timezone := util.TrimQuote(v.getText(ctx[3])) |
| 1443 | |
| 1444 | if v.SQL2AqlCtx.timeFilter != (queryCom.TimeFilter{}) { |
| 1445 | if v.SQL2AqlCtx.timeFilter.Column != column { |
| 1446 | location := v.getLocation(ctx[0]) |
| 1447 | panic(fmt.Errorf("different timefilter on %s at (line:%d, col:%d)", |
| 1448 | column, location.Line, location.CharPosition)) |
| 1449 | } |
| 1450 | if v.SQL2AqlCtx.timeFilter.From != from { |
| 1451 | location := v.getLocation(ctx[1]) |
| 1452 | panic(fmt.Errorf("different timefilter from %s at (line:%d, col:%d)", |
| 1453 | from, location.Line, location.CharPosition)) |
| 1454 | } |
| 1455 | if v.SQL2AqlCtx.timeFilter.To != to { |
| 1456 | location := v.getLocation(ctx[2]) |
| 1457 | panic(fmt.Errorf("different timefilter to %s at (line:%d, col:%d)", |
| 1458 | to, location.Line, location.CharPosition)) |
| 1459 | } |
| 1460 | if len(v.SQL2AqlCtx.timezone) != 0 && v.SQL2AqlCtx.timezone != timezone { |
| 1461 | location := v.getLocation(ctx[2]) |
| 1462 | panic(fmt.Errorf("different timefilter timezone %s at (line:%d, col:%d)", |
| 1463 | timezone, location.Line, location.CharPosition)) |
| 1464 | } |
| 1465 | return |
| 1466 | } |
| 1467 | v.SQL2AqlCtx.timeFilter = queryCom.TimeFilter{ |
| 1468 | Column: column, |
| 1469 | From: from, |
| 1470 | To: to, |
| 1471 | } |
| 1472 | v.SQL2AqlCtx.timezone = timezone |
| 1473 | } |
| 1474 | |
| 1475 | func (v *ASTBuilder) setTimeNow(ctx []antlrgen.IExpressionContext) { |
| 1476 | column := util.TrimQuote(v.getText(ctx[0])) |
no test coverage detected