summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2004-11-08 21:45:23 +0100
committerunknown <guilhem@mysql.com>2004-11-08 21:45:23 +0100
commitc4d04e9ec112e5df429844934507488c2c3990b9 (patch)
tree275260deec89412ded62aaa9e08627e2723dc8ef /sql
parent6449cd15e6fea50a1193c2cac0c83ac29501dbe7 (diff)
downloadmariadb-git-c4d04e9ec112e5df429844934507488c2c3990b9.tar.gz
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.
Diffstat (limited to 'sql')
-rw-r--r--sql/handler.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index f7a1a6ef0bf..cb88ab463d8 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -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);