Doc Menu
Important

You are viewing the documentation of an older version of the TiDB database (TiDB v2.1).

It is recommended that you use the latest stable version of the TiDB database.

ADMIN CANCEL DDL

The ADMIN CANCEL DDL statement allows you to cancel a running DDL job. The job_id can be found by running ADMIN SHOW DDL JOBS.

Synopsis

AdminStmt
ADMINSHOWDDLJOBSInt64NumWhereClauseOptionalJOBQUERIESNumListTableNameNEXT_ROW_IDSLOWAdminShowSlowCHECKTABLETableNameListINDEXTableNameIdentifierHandleRange,RECOVERINDEXTableNameIdentifierCLEANUPINDEXTableNameIdentifierTABLELOCKTableNameListCHECKSUMTABLETableNameListCANCELDDLJOBSNumListRELOADEXPR_PUSHDOWN_BLACKLISTOPT_RULE_BLACKLISTBINDINGSPLUGINSENABLEDISABLEPluginNameListREPAIRTABLETableNameCreateTableStmtFLUSHCAPTUREEVOLVEBINDINGS
NumList
Int64Num,

Examples

To cancel the currently running DDL jobs and return whether the corresponding jobs are successfully cancelled, use ADMIN CANCEL DDL JOBS:

ADMIN CANCEL DDL JOBS job_id [, job_id] ...;

If the operation fails to cancel the jobs, specific reasons are displayed.

Note:

  • Only this operation can cancel DDL jobs. All other operations and environment changes (such as machine restart and cluster restart) cannot cancel these jobs.
  • This operation can cancel multiple DDL jobs at the same time. You can get the ID of DDL jobs using the ADMIN SHOW DDL JOBS statement.
  • If the jobs you want to cancel are finished, the cancellation operation fails.

MySQL compatibility

This statement is a TiDB extension to MySQL syntax.

See also