summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-02-08 03:21:34 +0200
committerunknown <monty@hundin.mysql.fi>2002-02-08 03:21:34 +0200
commit0f9932a162bdd80d83fd0c4a3d6641d41ff3f1e3 (patch)
tree6fb2be8a25c87f580e5d7831b049ad0839a48237 /sql/handler.cc
parent6340283614f9f5cc4b9212ec5affa177b3f71711 (diff)
downloadmariadb-git-0f9932a162bdd80d83fd0c4a3d6641d41ff3f1e3.tar.gz
Fix some bugs introduced with the new my_getopt
Added counting of rollback's and commits Fixed bug in 'SELECT 0 LIMIT 0' Fixed bug in 'SELECT SQL_CALC_FOUND_ROWS' Docs/manual.texi: Changelog configure.in: Cleanup myisam/myisamchk.c: Fix some bugs introduced with the new my_getopt mysql-test/r/limit.result: Test for bugfix mysql-test/r/rpl000001.result: fix wrong result mysql-test/r/select.result: Fix things after fixing ignore index() mysql-test/r/select_found.result: Test of bug in SQL_CALC_FOUND_ROWS mysql-test/t/limit.test: Test bug in LIMIT 0 mysql-test/t/rpl000001.test: fix wrong result mysql-test/t/select_found.test: Test of bug in SQL_CALC_FOUND_ROWS sql/handler.cc: Added counting of rollback's and commits sql/mysql_priv.h: Added counting of rollback's and commits sql/mysqld.cc: Added counting of rollback's and commits sql/sql_select.cc: Fixed bug in 'SELECT 0 LIMIT 0' Fixed bug in 'SELECT SQL_CALC_FOUND_ROWS'
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 1e879c55b5e..507b77c977b 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -45,6 +45,7 @@ static int NEAR_F delete_file(const char *name,const char *ext,int extflag);
ulong ha_read_count, ha_write_count, ha_delete_count, ha_update_count,
ha_read_key_count, ha_read_next_count, ha_read_prev_count,
ha_read_first_count, ha_read_last_count,
+ ha_commit_count, ha_rollback_count,
ha_read_rnd_count, ha_read_rnd_next_count;
const char *ha_table_type[] = {
@@ -267,6 +268,7 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans)
#ifdef USING_TRANSACTIONS
if (opt_using_transactions)
{
+ bool operation_done=0;
/* Update the binary log if we have cached some queries */
if (trans == &thd->transaction.all && mysql_bin_log.is_open() &&
my_b_tell(&thd->transaction.trans_log))
@@ -297,12 +299,17 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans)
}
trans->innodb_active_trans=0;
if (trans == &thd->transaction.all)
+ {
query_cache.invalidate(Query_cache_table::INNODB);
+ operation_done=1;
+ }
}
#endif
if (error && trans == &thd->transaction.all && mysql_bin_log.is_open())
sql_print_error("Error: Got error during commit; Binlog is not up to date!");
thd->tx_isolation=thd->session_tx_isolation;
+ if (operation_done)
+ statistic_increment(ha_commit_count,&LOCK_status);
}
#endif // using transactions
DBUG_RETURN(error);
@@ -316,6 +323,7 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans)
#ifdef USING_TRANSACTIONS
if (opt_using_transactions)
{
+ bool operation_done=0;
#ifdef HAVE_BERKELEY_DB
if (trans->bdb_tid)
{
@@ -325,6 +333,7 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans)
error=1;
}
trans->bdb_tid=0;
+ operation_done=1;
}
#endif
#ifdef HAVE_INNOBASE_DB
@@ -336,6 +345,7 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans)
error=1;
}
trans->innodb_active_trans=0;
+ operation_done=1;
}
#endif
if (trans == &thd->transaction.all)
@@ -343,6 +353,8 @@ int ha_rollback_trans(THD *thd, THD_TRANS *trans)
WRITE_CACHE, (my_off_t) 0, 0, 1);
thd->transaction.trans_log.end_of_file= max_binlog_cache_size;
thd->tx_isolation=thd->session_tx_isolation;
+ if (operation_done)
+ statistic_increment(ha_rollback_count,&LOCK_status);
}
#endif /* USING_TRANSACTIONS */
DBUG_RETURN(error);