diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-10-09 18:24:17 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-10-09 18:24:17 +0200 |
commit | 2ca4141af12727d2f1342b3c7ccfa0da1a763c80 (patch) | |
tree | fb226a8cc2187ddb80d1bc204e56f83540019eed /storage/perfschema | |
parent | 01be663c503f180b47f477fb8cc7a2b55a7b79ff (diff) | |
parent | 1b41eed5d178182e7d9070450178188ca1e47265 (diff) | |
download | mariadb-git-2ca4141af12727d2f1342b3c7ccfa0da1a763c80.tar.gz |
Merge branch 'merge-perfschema-5.6' into 10.0
Diffstat (limited to 'storage/perfschema')
-rw-r--r-- | storage/perfschema/ha_perfschema.cc | 2 | ||||
-rw-r--r-- | storage/perfschema/pfs.cc | 1 | ||||
-rw-r--r-- | storage/perfschema/pfs_timer.cc | 40 |
3 files changed, 40 insertions, 3 deletions
diff --git a/storage/perfschema/ha_perfschema.cc b/storage/perfschema/ha_perfschema.cc index 01ecd341778..21a5262a2f1 100644 --- a/storage/perfschema/ha_perfschema.cc +++ b/storage/perfschema/ha_perfschema.cc @@ -205,7 +205,7 @@ maria_declare_plugin(perfschema) 0x0001, pfs_status_vars, NULL, - "5.6.26", + "5.6.27", MariaDB_PLUGIN_MATURITY_STABLE } maria_declare_plugin_end; diff --git a/storage/perfschema/pfs.cc b/storage/perfschema/pfs.cc index ea8a04a78ae..58d766f480a 100644 --- a/storage/perfschema/pfs.cc +++ b/storage/perfschema/pfs.cc @@ -4832,6 +4832,7 @@ static void end_statement_v1(PSI_statement_locker *locker, void *stmt_da) memcpy(pfs->m_message_text, da->message(), MYSQL_ERRMSG_SIZE); pfs->m_message_text[MYSQL_ERRMSG_SIZE]= 0; pfs->m_sql_errno= da->sql_errno(); + pfs->m_error_count++; memcpy(pfs->m_sqlstate, da->get_sqlstate(), SQLSTATE_LENGTH); break; case Diagnostics_area::DA_DISABLED: diff --git a/storage/perfschema/pfs_timer.cc b/storage/perfschema/pfs_timer.cc index 8c3553db2b2..8348f165e5c 100644 --- a/storage/perfschema/pfs_timer.cc +++ b/storage/perfschema/pfs_timer.cc @@ -1,4 +1,4 @@ -/* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. +/* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -125,6 +125,42 @@ void init_timers(void) */ /* + For WAIT, the cycle timer is used by default. However, it is not available + on all architectures. Fall back to the nanosecond timer in this case. It is + unlikely that neither cycle nor nanosecond are available, but we continue + probing less resolution timers anyway for consistency with other events. + */ + + if (cycle_to_pico != 0) + { + /* Normal case. */ + wait_timer= TIMER_NAME_CYCLE; + } + else if (nanosec_to_pico != 0) + { + /* Robustness, no known cases. */ + wait_timer= TIMER_NAME_NANOSEC; + } + else if (microsec_to_pico != 0) + { + /* Robustness, no known cases. */ + wait_timer= TIMER_NAME_MICROSEC; + } + else if (millisec_to_pico != 0) + { + /* Robustness, no known cases. */ + wait_timer= TIMER_NAME_MILLISEC; + } + else + { + /* + Will never be reached on any architecture, but must provide a default if + no other timers are available. + */ + wait_timer= TIMER_NAME_TICK; + } + + /* For STAGE and STATEMENT, a timer with a fixed frequency is better. The prefered timer is nanosecond, or lower resolutions. */ @@ -174,7 +210,7 @@ void init_timers(void) else if (millisec_to_pico != 0) { /* Robustness, no known cases. */ - idle_timer= TIMER_NAME_MILLISEC; + wait_timer= TIMER_NAME_MILLISEC; } else if (tick_to_pico != 0) { |