From 204d1310adca1f03cf10843c403249e1e4bb394b Mon Sep 17 00:00:00 2001 From: Kirill Shvakov Date: Mon, 5 Mar 2018 08:52:04 +0200 Subject: [PATCH] #89 #93 rollback: reset block buffers and close connection --- clickhouse.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/clickhouse.go b/clickhouse.go index c0dd22863c..955de6c380 100644 --- a/clickhouse.go +++ b/clickhouse.go @@ -154,9 +154,13 @@ func (ch *clickhouse) Rollback() error { if !ch.inTransaction { return sql.ErrTxDone } + if ch.block != nil { + ch.block.Reset() + } ch.block = nil + ch.buffer = nil ch.inTransaction = false - return nil + return ch.conn.Close() } func (ch *clickhouse) CheckNamedValue(nv *driver.NamedValue) error {