summaryrefslogtreecommitdiff
path: root/storage/innobase/srv
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@oracle.com>2013-02-08 09:33:21 +0200
committerMarko Mäkelä <marko.makela@oracle.com>2013-02-08 09:33:21 +0200
commit62eaf89ff070f75acb6efb7c0900ee4b0045cfa7 (patch)
treefb3c24eae45490b7947bc1b4cdc054eac781ebe2 /storage/innobase/srv
parent64b2eccebc9c483d0280708866f152d84aa463ef (diff)
parent5620418c51f89c50796c03ed1d471abcecb704c0 (diff)
downloadmariadb-git-62eaf89ff070f75acb6efb7c0900ee4b0045cfa7.tar.gz
Merge mysql-5.1 to mysql-5.5.
Diffstat (limited to 'storage/innobase/srv')
-rw-r--r--storage/innobase/srv/srv0srv.c40
1 files changed, 26 insertions, 14 deletions
diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c
index 5872ff2c437..97c34e40c1f 100644
--- a/storage/innobase/srv/srv0srv.c
+++ b/storage/innobase/srv/srv0srv.c
@@ -1,6 +1,6 @@
/*****************************************************************************
-Copyright (c) 1995, 2012, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, 2009 Google Inc.
Copyright (c) 2009, Percona Inc.
@@ -279,7 +279,7 @@ UNIV_INTERN ulint srv_data_read = 0;
/* Internal setting for "innodb_stats_method". Decides how InnoDB treats
NULL value when collecting statistics. By default, it is set to
SRV_STATS_NULLS_EQUAL(0), ie. all NULL value are treated equal */
-ulong srv_innodb_stats_method = SRV_STATS_NULLS_EQUAL;
+UNIV_INTERN ulong srv_innodb_stats_method = SRV_STATS_NULLS_EQUAL;
/* here we count the amount of data written in total (in bytes) */
UNIV_INTERN ulint srv_data_written = 0;
@@ -2105,19 +2105,31 @@ srv_export_innodb_status(void)
export_vars.innodb_truncated_status_writes = srv_truncated_status_writes;
#ifdef UNIV_DEBUG
- if (trx_sys->max_trx_id < purge_sys->done_trx_no) {
- export_vars.innodb_purge_trx_id_age = 0;
- } else {
- export_vars.innodb_purge_trx_id_age =
- trx_sys->max_trx_id - purge_sys->done_trx_no;
- }
+ {
+ trx_id_t done_trx_no;
+ trx_id_t up_limit_id;
+
+ rw_lock_s_lock(&purge_sys->latch);
+ done_trx_no = purge_sys->done_trx_no;
+ up_limit_id = purge_sys->view
+ ? purge_sys->view->up_limit_id
+ : 0;
+ rw_lock_s_unlock(&purge_sys->latch);
+
+ if (trx_sys->max_trx_id < done_trx_no) {
+ export_vars.innodb_purge_trx_id_age = 0;
+ } else {
+ export_vars.innodb_purge_trx_id_age =
+ trx_sys->max_trx_id - done_trx_no;
+ }
- if (!purge_sys->view
- || trx_sys->max_trx_id < purge_sys->view->up_limit_id) {
- export_vars.innodb_purge_view_trx_id_age = 0;
- } else {
- export_vars.innodb_purge_view_trx_id_age =
- trx_sys->max_trx_id - purge_sys->view->up_limit_id;
+ if (!up_limit_id
+ || trx_sys->max_trx_id < up_limit_id) {
+ export_vars.innodb_purge_view_trx_id_age = 0;
+ } else {
+ export_vars.innodb_purge_view_trx_id_age =
+ trx_sys->max_trx_id - up_limit_id;
+ }
}
#endif /* UNIV_DEBUG */