Merge branch 'master' into master_0124

This commit is contained in:
Lunny Xiao 2022-03-31 17:21:46 +08:00
commit 2ed935c349
1 changed files with 1 additions and 1 deletions

View File

@ -757,7 +757,7 @@ func (session *Session) incrVersionFieldValue(fieldValue *reflect.Value) {
// Context sets the context on this session // Context sets the context on this session
func (session *Session) Context(ctx context.Context) *Session { func (session *Session) Context(ctx context.Context) *Session {
if session.ctx != nil { if session.engine.logSessionID && session.ctx != nil {
ctx = context.WithValue(ctx, log.SessionIDKey, session.ctx.Value(log.SessionIDKey)) ctx = context.WithValue(ctx, log.SessionIDKey, session.ctx.Value(log.SessionIDKey))
ctx = context.WithValue(ctx, log.SessionKey, session.ctx.Value(log.SessionKey)) ctx = context.WithValue(ctx, log.SessionKey, session.ctx.Value(log.SessionKey))
ctx = context.WithValue(ctx, log.SessionShowSQLKey, session.ctx.Value(log.SessionShowSQLKey)) ctx = context.WithValue(ctx, log.SessionShowSQLKey, session.ctx.Value(log.SessionShowSQLKey))