Skip to content

Commit 4e4cb45

Browse files
Nathan GabrielsonNathan Gabrielson
authored andcommitted
Comments to explain clearWarnings
1 parent 49e8c36 commit 4e4cb45

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

engine.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ func clearWarnings(ctx *sql.Context, node sql.Node) {
269269
// `show warning limit x offset y` is valid, so we need to recurse
270270
clearWarnings(ctx, n.Children()[0])
271271
case *plan.Set:
272+
// We want to maintain warnings when setting the warnings_lock variable.
273+
// Set statements also can't produce warnings, so we don't care about clearing them.
272274
case plan.ShowWarnings:
273275
// ShowWarnings should not clear the warnings, but should still reset the warning count.
274276
ctx.ClearWarningCount()

0 commit comments

Comments
 (0)