Skip to content

Commit

Permalink
chore: remove missing releaseConn
Browse files Browse the repository at this point in the history
  • Loading branch information
vmihailenco committed Oct 1, 2023
1 parent a4c3d24 commit 48aa57b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions ch/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ func (db *DB) _query(ctx context.Context, query string) (*blockIter, error) {
db.writeQuery(ctx, cn, wr, query)
db.writeBlock(ctx, wr, nil)
}); err != nil {
db.releaseConn(cn, err)
return nil, err
}

Expand Down
13 changes: 6 additions & 7 deletions ch/query_select.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ import (
"github.com/uptrace/go-clickhouse/ch/internal"
)

type union struct {
expr string
query *SelectQuery
}

type SelectQuery struct {
baseQuery

Expand All @@ -31,8 +26,12 @@ type SelectQuery struct {
limit int
offset int
final bool
union []union
}

union []union
type union struct {
expr string
query *SelectQuery
}

var _ Query = (*SelectQuery)(nil)
Expand Down Expand Up @@ -162,7 +161,7 @@ func (q *SelectQuery) ExcludeColumn(columns ...string) *SelectQuery {
return q
}

///------------------------------------------------------------------------------
//------------------------------------------------------------------------------

func (q *SelectQuery) Union(other *SelectQuery) *SelectQuery {
return q.addUnion(" UNION ", other)
Expand Down
2 changes: 1 addition & 1 deletion ch/testdata/snapshots/TestQuery-19
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CREATE TABLE IF NOT EXISTS "my-table_dist" AS "my-table" ON CLUSTER "my-cluster" Engine = Distributed("my-cluster", currentDatabase(), "my-table", rand())
CREATE TABLE IF NOT EXISTS "my-table_dist" ON CLUSTER "my-cluster" AS "my-table" Engine = Distributed("my-cluster", currentDatabase(), "my-table", rand())

0 comments on commit 48aa57b

Please sign in to comment.