diff -ru mysql-5.5.16-new/sql/mysqld.cc mysql-5.5.16/sql/mysqld.cc --- mysql-5.5.16-new/sql/mysqld.cc 2011-10-17 08:37:21.000000000 -0400 +++ mysql-5.5.16/sql/mysqld.cc 2011-10-17 08:55:14.000000000 -0400 @@ -1481,11 +1481,13 @@ my_free(opt_bin_logname); bitmap_free(&temp_pool); free_max_user_conn(); +#ifndef EMBEDDED_LIBRARY free_global_user_stats(); free_global_client_stats(); free_global_thread_stats(); free_global_table_stats(); free_global_index_stats(); +#endif #ifdef HAVE_REPLICATION end_slave_list(); #endif @@ -4028,9 +4030,11 @@ if (!DEFAULT_ERRMSGS[0][0]) unireg_abort(1); +#ifndef EMBEDDED_LIBRARY /* We have to initialize the storage engines before CSV logging */ init_global_table_stats(); init_global_index_stats(); +#endif if (ha_init()) { @@ -4168,9 +4172,11 @@ init_max_user_conn(); init_update_queries(); +#ifndef EMBEDDED_LIBRARY init_global_user_stats(); init_global_client_stats(); init_global_thread_stats(); +#endif DBUG_RETURN(0); } Only in mysql-5.5.16/sql: .mysqld.cc.swp diff -ru mysql-5.5.16-new/sql/sql_parse.cc mysql-5.5.16/sql/sql_parse.cc --- mysql-5.5.16-new/sql/sql_parse.cc 2011-10-17 08:37:21.000000000 -0400 +++ mysql-5.5.16/sql/sql_parse.cc 2011-10-17 08:47:11.000000000 -0400 @@ -5666,7 +5666,9 @@ } // Updates THD stats and the global user stats. thd->update_stats(true); +#ifndef EMBEDDED_LIBRARY update_global_user_stats(thd, true, time(NULL)); +#endif DBUG_VOID_RETURN; } Only in mysql-5.5.16/sql: .sql_parse.cc.swp diff -ru mysql-5.5.16-new/sql/sql_prepare.cc mysql-5.5.16/sql/sql_prepare.cc --- mysql-5.5.16-new/sql/sql_prepare.cc 2011-10-17 08:37:06.000000000 -0400 +++ mysql-5.5.16/sql/sql_prepare.cc 2011-10-17 09:10:54.000000000 -0400 @@ -2270,7 +2270,9 @@ } // Updates THD stats and the global user stats. thd->update_stats(true); +#ifndef EMBEDDED_LIBRARY update_global_user_stats(thd, true, time(NULL)); +#endif DBUG_VOID_RETURN; } @@ -2710,7 +2712,10 @@ } // Updates THD stats and the global user stats. thd->update_stats(true); +#ifndef EMBEDDED_LIBRARY update_global_user_stats(thd, true, time(NULL)); +#endif + DBUG_VOID_RETURN; } @@ -2885,7 +2890,10 @@ } // Updates THD stats and the global user stats. thd->update_stats(true); + +#ifndef EMBEDDED_LIBRARY update_global_user_stats(thd, true, time(NULL)); +#endif DBUG_VOID_RETURN; } @@ -3011,7 +3019,10 @@ } // Updates THD stats and the global user stats. thd->update_stats(true); +#ifndef EMBEDDED_LIBRARY update_global_user_stats(thd, true, time(NULL)); +#endif + DBUG_VOID_RETURN; } Only in mysql-5.5.16/sql: .sql_prepare.cc.swp diff -ru mysql-5.5.16-new/sql/sql_reload.cc mysql-5.5.16/sql/sql_reload.cc --- mysql-5.5.16-new/sql/sql_reload.cc 2011-10-17 08:37:06.000000000 -0400 +++ mysql-5.5.16/sql/sql_reload.cc 2011-10-17 09:10:58.000000000 -0400 @@ -299,15 +299,19 @@ if (options & REFRESH_TABLE_STATS) { mysql_mutex_lock(&LOCK_global_table_stats); +#ifndef EMBEDDED_LIBRARY free_global_table_stats(); init_global_table_stats(); +#endif mysql_mutex_unlock(&LOCK_global_table_stats); } if (options & REFRESH_INDEX_STATS) { mysql_mutex_lock(&LOCK_global_index_stats); +#ifndef EMBEDDED_LIBRARY free_global_index_stats(); init_global_index_stats(); +#endif mysql_mutex_unlock(&LOCK_global_index_stats); } if (options & (REFRESH_USER_STATS | REFRESH_CLIENT_STATS | REFRESH_THREAD_STATS)) @@ -315,18 +319,24 @@ mysql_mutex_lock(&LOCK_global_user_client_stats); if (options & REFRESH_USER_STATS) { +#ifndef EMBEDDED_LIBRARY free_global_user_stats(); init_global_user_stats(); +#endif } if (options & REFRESH_CLIENT_STATS) { +#ifndef EMBEDDED_LIBRARY free_global_client_stats(); init_global_client_stats(); +#endif } if (options & REFRESH_THREAD_STATS) { +#ifndef EMBEDDED_LIBRARY free_global_thread_stats(); init_global_thread_stats(); +#endif } mysql_mutex_unlock(&LOCK_global_user_client_stats); } Only in mysql-5.5.16/sql: .sql_reload.cc.swp