Check in between query statements to see if the query was interrupted
This allows a long series of uninterruptible statements to still be interrupted for a long running query that might do something like create or drop many databases.pull/7010/head
parent
f58a50c231
commit
32d10de94f
|
@ -260,6 +260,21 @@ func (e *QueryExecutor) executeQuery(query *Query, opt ExecutionOptions, closing
|
|||
// Stop after the first error.
|
||||
break
|
||||
}
|
||||
|
||||
// Check if the query was interrupted during an uninterruptible statement.
|
||||
interrupted := false
|
||||
if ctx.InterruptCh != nil {
|
||||
select {
|
||||
case <-ctx.InterruptCh:
|
||||
interrupted = true
|
||||
default:
|
||||
// Query has not been interrupted.
|
||||
}
|
||||
}
|
||||
|
||||
if interrupted {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// Send error results for any statements which were not executed.
|
||||
|
|
Loading…
Reference in New Issue