Skip to content

Commit

Permalink
Force statement configuration based on driver when including script f…
Browse files Browse the repository at this point in the history
…iles (\i, \ir, and -f)

Forces a driver statement configuration on the handler's include, prior
to invoking the included handler's run.

Fixes xo#111.
Fixes xo#43.
  • Loading branch information
Kenneth Shaw committed Jan 12, 2020
1 parent a2978c0 commit fbecfb4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func New(l rline.IO, user *user.User, wd string, nopw bool) *Handler {
return h
}

// SetSingleLineMode allows setting the single line mode toggle.
// SetSingleLineMode sets the single line mode toggle.
func (h *Handler) SetSingleLineMode(singleLineMode bool) {
h.singleLineMode = singleLineMode
}
Expand Down Expand Up @@ -869,7 +869,7 @@ func (h *Handler) query(w io.Writer, _, qstr string) error {
defer q.Close()

return tblfmt.EncodeAll(w, q, map[string]string(env.Pall()))
//return tblfmt.EncodeAll(w, q, map[string]string(env.Pall()), tblfmt.WithByteBufferPool(pool))
// return tblfmt.EncodeAll(w, q, map[string]string(env.Pall()), tblfmt.WithByteBufferPool(pool))
}

// execRows executes all the columns in the row.
Expand Down Expand Up @@ -1093,6 +1093,7 @@ func (h *Handler) Include(path string, relative bool) error {

p := New(l, h.user, filepath.Dir(path), h.nopw)
p.db, p.u = h.db, h.u
drivers.ConfigStmt(p.u, p.buf)

err = p.Run()
if err == io.EOF {
Expand Down

0 comments on commit fbecfb4

Please sign in to comment.