diff --git a/chain.go b/chain.go index 3ddeb8a..8bc4367 100644 --- a/chain.go +++ b/chain.go @@ -291,6 +291,7 @@ func (this *Query) BuildSelectSql() (map[string]interface{}, error) { withSql := "" if len(this.with) > 0 { var builder strings.Builder + builder.Reset() builder.WriteString("WITH ") boo := false for k, v := range this.with { @@ -351,6 +352,7 @@ func (this *Query) BuildSelectSql() (map[string]interface{}, error) { if len(this.join) > 0 { var builder strings.Builder + builder.Reset() for _, joinitem := range this.join { if len(joinitem) < 2 { continue diff --git a/db.go b/db.go index 43c7340..32d6c77 100644 --- a/db.go +++ b/db.go @@ -307,6 +307,7 @@ func GetRow(dbName, table_name, alias string, titles string, with, join [][]stri withSql := "" if len(with) > 0 { var builder strings.Builder + builder.Reset() builder.WriteString("WITH ") boo := false for k, v := range with { @@ -353,6 +354,7 @@ func GetRow(dbName, table_name, alias string, titles string, with, join [][]stri if len(join) > 0 { var builder strings.Builder + builder.Reset() for _, joinitem := range join { if len(joinitem) < 2 { continue @@ -496,6 +498,7 @@ func FetchRows(dbName, table_name, alias string, titles string, with, join [][]s withSql := "" if len(with) > 0 { var builder strings.Builder + builder.Reset() builder.WriteString("WITH ") boo := false for k, v := range with { @@ -543,6 +546,7 @@ func FetchRows(dbName, table_name, alias string, titles string, with, join [][]s if len(join) > 0 { var builder strings.Builder + builder.Reset() for _, joinitem := range join { if len(joinitem) < 2 { continue diff --git a/transaction_chain.go b/transaction_chain.go index d73b639..9686a04 100644 --- a/transaction_chain.go +++ b/transaction_chain.go @@ -225,6 +225,7 @@ func (this *TxQuery) BuildSelectSql() (map[string]interface{}, error) { withSql := "" if len(this.with) > 0 { var builder strings.Builder + builder.Reset() builder.WriteString("WITH ") boo := false for k, v := range this.with { @@ -269,6 +270,7 @@ func (this *TxQuery) BuildSelectSql() (map[string]interface{}, error) { if len(this.join) > 0 { var builder strings.Builder + builder.Reset() for _, joinitem := range this.join { if len(joinitem) < 2 { continue