Commit c4d04e9e authored by unknown's avatar unknown
Browse files

As rollback can be 30 times slower than insert in InnoDB, and user may

not know there's rollback (if it's because of a dupl row), better warn
that it's happening. It can also be of use for a DBA killing a
connection and wondering what this connection is still doing now. Example:
|  5 | root | localhost | test | Killed  | 10   | Rolling back | insert into i select * from j |


sql/handler.cc:
  As rollback can be 30 times slower than insert in InnoDB, and user may
  not know there's rollback (if it's because of a dupl row), better warn.
parent 6449cd15
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -581,6 +581,12 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans)
  if (opt_using_transactions)
  {
    bool operation_done=0;
    /*
      As rollback can be 30 times slower than insert in InnoDB, and user may
      not know there's rollback (if it's because of a dupl row), better warn.
    */
    const char *save_proc_info= thd->proc_info;
    thd->proc_info= "Rolling back";
#ifdef HAVE_NDBCLUSTER_DB
    if (trans->ndb_tid)
    {
@@ -652,6 +658,7 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans)
    thd->variables.tx_isolation=thd->session_tx_isolation;
    if (operation_done)
      statistic_increment(ha_rollback_count,&LOCK_status);
    thd->proc_info= save_proc_info;
  }
#endif /* USING_TRANSACTIONS */
  DBUG_RETURN(error);