Skip to content

Commit

Permalink
small fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
hhhapz committed Jun 12, 2024
1 parent 6484996 commit 67306c9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ func (h *Handler) doExecWatch(ctx context.Context, w io.Writer, opt metacmd.Opti

// doExecChart executes a single query against the database, displaying its output as a chart.
func (h *Handler) doExecChart(ctx context.Context, w io.Writer, opt metacmd.Option, prefix, sqlstr string, qtyp bool, bind []interface{}) error {
stdout, _, _ := h.l.Stdout(), h.l.Stderr(), h.l.Interactive()
stdout := h.l.Stdout()
typ := env.TermGraphics()
if !typ.Available() {
return text.ErrGraphicsNotSupported
Expand All @@ -1063,6 +1063,7 @@ func (h *Handler) doExecChart(ctx context.Context, w io.Writer, opt metacmd.Opti
if err != nil {
return err
}
defer rows.Close()
// get cols
cols, err := drivers.Columns(h.u, rows)
if err != nil {
Expand Down Expand Up @@ -1150,6 +1151,7 @@ func (h *Handler) doExecSet(ctx context.Context, w io.Writer, opt metacmd.Option
if err != nil {
return err
}
defer rows.Close()
// get cols
cols, err := drivers.Columns(h.u, rows)
if err != nil {
Expand Down Expand Up @@ -1190,6 +1192,7 @@ func (h *Handler) doExecExec(ctx context.Context, w io.Writer, _ metacmd.Option,
if err != nil {
return err
}
defer rows.Close()
// exec resulting rows
if err := h.doExecRows(ctx, w, rows); err != nil {
return err
Expand Down

0 comments on commit 67306c9

Please sign in to comment.