Skip to content

Commit bfc4cfb

Browse files
interval-expansion
Summary: - Expansion of interval grammar.
1 parent e5d75f0 commit bfc4cfb

File tree

3 files changed

+2876
-2810
lines changed

3 files changed

+2876
-2810
lines changed

go/vt/sqlparser/ast.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1800,7 +1800,10 @@ func (node *UnaryExpr) Format(buf *TrackedBuffer) {
18001800

18011801
// Format formats the node.
18021802
func (node *IntervalExpr) Format(buf *TrackedBuffer) {
1803-
buf.astPrintf(node, "interval %v %s", node.Expr, node.Unit)
1803+
nb := NewTrackedBuffer(nil)
1804+
nb.astPrintf(node, "%v", node.Expr)
1805+
es := strings.Trim(nb.String(), "'")
1806+
buf.astPrintf(node, "interval '%s %s'", es, node.Unit)
18041807
}
18051808

18061809
// Format formats the node.

0 commit comments

Comments
 (0)