From c4f84483452a9eb106a795c54694db51a980ca6c Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Thu, 19 Apr 2018 13:36:08 +0100 Subject: [PATCH] Ensure session wide variables are available on a live query context --- db/socket.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/db/socket.go b/db/socket.go index 1dc00795..afef30b4 100644 --- a/db/socket.go +++ b/db/socket.go @@ -55,7 +55,10 @@ func (s *socket) ctx(ns, db string) (ctx context.Context) { ctx = context.WithValue(ctx, ctxKeyNs, ns) ctx = context.WithValue(ctx, ctxKeyDb, db) - auth := s.fibre.Get(varKeyAuth).(*cnf.Auth) + keep := s.fibre.Get(ctxKeyKeep) + ctx = context.WithValue(ctx, ctxKeyKeep, keep) + + auth := s.fibre.Get(ctxKeyAuth).(*cnf.Auth) ctx = context.WithValue(ctx, ctxKeyAuth, auth.Data) ctx = context.WithValue(ctx, ctxKeyKind, auth.Kind)