1309
MariaDBerrorserverhigh confidence

Query execution was interrupted

Production Risk

Medium — query does not complete; application must handle the error.

What this means

The query was killed by KILL QUERY or by the connection timeout; the partial execution was rolled back.

Why it happens
  1. 1Explicit KILL QUERY by DBA or monitoring tool
  2. 2max_execution_time exceeded (MySQL 5.7.8+)
  3. 3wait_timeout / interactive_timeout on a long query
How to reproduce
trigger — this will error
trigger — this will error
KILL QUERY <thread_id>;

expected output

ERROR 1309 (70100): Query execution was interrupted

Fix 1

Optimise the slow query

Optimise the slow query
EXPLAIN SELECT ...;

Why this works

Identify missing indexes or inefficient plans.

Fix 2

Increase MAX_EXECUTION_TIME hint

Increase MAX_EXECUTION_TIME hint
SELECT /*+ MAX_EXECUTION_TIME(5000) */ * FROM t;

Why this works

Per-query timeout override in MySQL 5.7.8+.

What not to do

Version notes

Sources
Official documentation ↗

MySQL 8.0 — 1309 ER_QUERY_INTERRUPTED

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All MariaDB errors