From 3f604c5087695553b8bb2eff7ac5442f1ebde35b Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Tue, 5 Mar 2019 11:39:56 +0000 Subject: [PATCH] Remove surrounding brackets from SQL IF string --- sql/string.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sql/string.go b/sql/string.go index c709fa5c..73f64f7b 100644 --- a/sql/string.go +++ b/sql/string.go @@ -801,9 +801,12 @@ func (this Polygon) JSON() string { // --------------------------------------------- func (this SubExpression) String() string { - return print("(%v)", - this.Expr, - ) + switch this.Expr.(type) { + case IfelseStatement: + return print("%v", this.Expr) + default: + return print("(%v)", this.Expr) + } } func (this MultExpression) String() string {