Commit 9b1c2825 authored by marko's avatar marko

Import mysql-5.1-new changeset 1.1945.48.1 (Anthony Curtis):

Finalize storage engine plugins

ha_innodb.cc: remove unwanted handlerton entries; changes for show status
parent 82381c6b
...@@ -203,6 +203,7 @@ static int innobase_release_savepoint(THD* thd, void *savepoint); ...@@ -203,6 +203,7 @@ static int innobase_release_savepoint(THD* thd, void *savepoint);
static handler *innobase_create_handler(TABLE_SHARE *table); static handler *innobase_create_handler(TABLE_SHARE *table);
handlerton innobase_hton = { handlerton innobase_hton = {
MYSQL_HANDLERTON_INTERFACE_VERSION,
"InnoDB", "InnoDB",
SHOW_OPTION_YES, SHOW_OPTION_YES,
"Supports transactions, row-level locking, and foreign keys", "Supports transactions, row-level locking, and foreign keys",
...@@ -226,16 +227,9 @@ handlerton innobase_hton = { ...@@ -226,16 +227,9 @@ handlerton innobase_hton = {
innobase_create_handler, /* Create a new handler */ innobase_create_handler, /* Create a new handler */
innobase_drop_database, /* Drop a database */ innobase_drop_database, /* Drop a database */
innobase_end, /* Panic call */ innobase_end, /* Panic call */
innobase_release_temporary_latches, /* Release temporary latches */
innodb_export_status, /* Update Statistics */
innobase_start_trx_and_assign_read_view, /* Start Consistent Snapshot */ innobase_start_trx_and_assign_read_view, /* Start Consistent Snapshot */
innobase_flush_logs, /* Flush logs */ innobase_flush_logs, /* Flush logs */
innobase_show_status, /* Show status */ innobase_show_status, /* Show status */
#ifdef HAVE_REPLICATION
innobase_repl_report_sent_binlog, /* Replication Report Sent Binlog */
#else
NULL,
#endif
HTON_NO_FLAGS HTON_NO_FLAGS
}; };
...@@ -1977,6 +1971,11 @@ innobase_repl_report_sent_binlog( ...@@ -1977,6 +1971,11 @@ innobase_repl_report_sent_binlog(
int cmp; int cmp;
ibool can_release_threads = 0; ibool can_release_threads = 0;
if (!innodb_inited) {
return 0;
}
/* If synchronous replication is not switched on, or this thd is /* If synchronous replication is not switched on, or this thd is
sending binlog to a slave where we do not need synchronous replication, sending binlog to a slave where we do not need synchronous replication,
then return immediately */ then return immediately */
...@@ -6561,9 +6560,10 @@ ha_innobase::transactional_table_lock( ...@@ -6561,9 +6560,10 @@ ha_innobase::transactional_table_lock(
Here we export InnoDB status variables to MySQL. */ Here we export InnoDB status variables to MySQL. */
int int
innodb_export_status(void) innodb_export_status()
/*======================*/ /*==================*/
{ {
if (innodb_inited)
srv_export_innodb_status(); srv_export_innodb_status();
return 0; return 0;
} }
...@@ -6651,7 +6651,8 @@ innodb_show_status( ...@@ -6651,7 +6651,8 @@ innodb_show_status(
bool result = FALSE; bool result = FALSE;
if (stat_print(thd, innobase_hton.name, "", str)) { if (stat_print(thd, innobase_hton.name, strlen(innobase_hton.name),
STRING_WITH_LEN(""), str, flen)) {
result= TRUE; result= TRUE;
} }
my_free(str, MYF(0)); my_free(str, MYF(0));
...@@ -6676,6 +6677,7 @@ innodb_mutex_show_status( ...@@ -6676,6 +6677,7 @@ innodb_mutex_show_status(
ulint rw_lock_count_os_wait= 0; ulint rw_lock_count_os_wait= 0;
ulint rw_lock_count_os_yield= 0; ulint rw_lock_count_os_yield= 0;
ulonglong rw_lock_wait_time= 0; ulonglong rw_lock_wait_time= 0;
uint hton_name_len= strlen(innobase_hton.name), buf1len, buf2len;
DBUG_ENTER("innodb_mutex_show_status"); DBUG_ENTER("innodb_mutex_show_status");
#ifdef MUTEX_PROTECT_TO_BE_ADDED_LATER #ifdef MUTEX_PROTECT_TO_BE_ADDED_LATER
...@@ -6690,16 +6692,17 @@ innodb_mutex_show_status( ...@@ -6690,16 +6692,17 @@ innodb_mutex_show_status(
{ {
if (mutex->count_using > 0) if (mutex->count_using > 0)
{ {
my_snprintf(buf1, sizeof(buf1), "%s:%s", buf1len= my_snprintf(buf1, sizeof(buf1), "%s:%s",
mutex->cmutex_name, mutex->cfile_name); mutex->cmutex_name, mutex->cfile_name);
my_snprintf(buf2, sizeof(buf2), buf2len= my_snprintf(buf2, sizeof(buf2),
"count=%lu, spin_waits=%lu, spin_rounds=%lu, " "count=%lu, spin_waits=%lu, spin_rounds=%lu, "
"os_waits=%lu, os_yields=%lu, os_wait_times=%lu", "os_waits=%lu, os_yields=%lu, os_wait_times=%lu",
mutex->count_using, mutex->count_spin_loop, mutex->count_using, mutex->count_spin_loop,
mutex->count_spin_rounds, mutex->count_spin_rounds,
mutex->count_os_wait, mutex->count_os_yield, mutex->count_os_wait, mutex->count_os_yield,
mutex->lspent_time/1000); mutex->lspent_time/1000);
if (stat_print(thd, innobase_hton.name, buf1, buf2)) if (stat_print(thd, innobase_hton.name, hton_name_len,
buf1, buf1len, buf2, buf2len))
{ {
#ifdef MUTEX_PROTECT_TO_BE_ADDED_LATER #ifdef MUTEX_PROTECT_TO_BE_ADDED_LATER
mutex_exit(&mutex_list_mutex); mutex_exit(&mutex_list_mutex);
...@@ -6721,7 +6724,7 @@ innodb_mutex_show_status( ...@@ -6721,7 +6724,7 @@ innodb_mutex_show_status(
mutex = UT_LIST_GET_NEXT(list, mutex); mutex = UT_LIST_GET_NEXT(list, mutex);
} }
my_snprintf(buf2, sizeof(buf2), buf2len= my_snprintf(buf2, sizeof(buf2),
"count=%lu, spin_waits=%lu, spin_rounds=%lu, " "count=%lu, spin_waits=%lu, spin_rounds=%lu, "
"os_waits=%lu, os_yields=%lu, os_wait_times=%lu", "os_waits=%lu, os_yields=%lu, os_wait_times=%lu",
rw_lock_count, rw_lock_count_spin_loop, rw_lock_count, rw_lock_count_spin_loop,
...@@ -6729,7 +6732,8 @@ innodb_mutex_show_status( ...@@ -6729,7 +6732,8 @@ innodb_mutex_show_status(
rw_lock_count_os_wait, rw_lock_count_os_yield, rw_lock_count_os_wait, rw_lock_count_os_yield,
rw_lock_wait_time/1000); rw_lock_wait_time/1000);
if (stat_print(thd, innobase_hton.name, "rw_lock_mutexes", buf2)) if (stat_print(thd, innobase_hton.name, hton_name_len,
STRING_WITH_LEN("rw_lock_mutexes"), buf2, buf2len))
{ {
DBUG_RETURN(1); DBUG_RETURN(1);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment