333
326
uint64_t binlog_cache_size= 0;
334
327
uint64_t max_binlog_cache_size= 0;
335
328
uint32_t refresh_version; /* Increments on each reload */
336
ulong aborted_threads;
337
ulong aborted_connects;
338
ulong specialflag= 0;
339
ulong binlog_cache_use= 0;
340
ulong binlog_cache_disk_use= 0;
329
uint64_t aborted_threads;
330
uint64_t aborted_connects;
331
uint64_t binlog_cache_use= 0;
332
uint64_t binlog_cache_disk_use= 0;
341
333
uint64_t max_connections;
342
334
uint64_t max_connect_errors;
343
335
ulong thread_id=1L;
344
336
pid_t current_pid;
345
ulong slow_launch_threads = 0;
337
uint64_t slow_launch_threads= 0;
346
338
uint64_t sync_binlog_period;
347
339
uint64_t expire_logs_days= 0;
348
const char *log_output_str= "FILE";
350
341
const double log_10[] = {
351
342
1e000, 1e001, 1e002, 1e003, 1e004, 1e005, 1e006, 1e007, 1e008, 1e009,
3778
3769
SHOW_VAR status_vars[]= {
3779
{"Aborted_clients", (char*) &aborted_threads, SHOW_LONG},
3780
{"Aborted_connects", (char*) &aborted_connects, SHOW_LONG},
3781
{"Binlog_cache_disk_use", (char*) &binlog_cache_disk_use, SHOW_LONG},
3782
{"Binlog_cache_use", (char*) &binlog_cache_use, SHOW_LONG},
3770
{"Aborted_clients", (char*) &aborted_threads, SHOW_LONGLONG},
3771
{"Aborted_connects", (char*) &aborted_connects, SHOW_LONGLONG},
3772
{"Binlog_cache_disk_use", (char*) &binlog_cache_disk_use, SHOW_LONGLONG},
3773
{"Binlog_cache_use", (char*) &binlog_cache_use, SHOW_LONGLONG},
3783
3774
{"Bytes_received", (char*) offsetof(STATUS_VAR, bytes_received), SHOW_LONGLONG_STATUS},
3784
3775
{"Bytes_sent", (char*) offsetof(STATUS_VAR, bytes_sent), SHOW_LONGLONG_STATUS},
3785
3776
{"Com", (char*) com_status_vars, SHOW_ARRAY},
3786
3777
{"Compression", (char*) &show_net_compression_cont, SHOW_FUNC},
3787
3778
{"Connections", (char*) &thread_id, SHOW_LONG_NOFLUSH},
3788
3779
{"Created_tmp_disk_tables", (char*) offsetof(STATUS_VAR, created_tmp_disk_tables), SHOW_LONG_STATUS},
3789
{"Created_tmp_files", (char*) &my_tmp_file_created, SHOW_LONG},
3780
{"Created_tmp_files", (char*) &my_tmp_file_created, SHOW_INT},
3790
3781
{"Created_tmp_tables", (char*) offsetof(STATUS_VAR, created_tmp_tables), SHOW_LONG_STATUS},
3791
3782
{"Flush_commands", (char*) &refresh_version, SHOW_LONG_NOFLUSH},
3792
3783
{"Handler_commit", (char*) offsetof(STATUS_VAR, ha_commit_count), SHOW_LONG_STATUS},
3812
3803
{"Key_write_requests", (char*) offsetof(KEY_CACHE, global_cache_w_requests), SHOW_KEY_CACHE_LONGLONG},
3813
3804
{"Key_writes", (char*) offsetof(KEY_CACHE, global_cache_write), SHOW_KEY_CACHE_LONGLONG},
3814
3805
{"Last_query_cost", (char*) offsetof(STATUS_VAR, last_query_cost), SHOW_DOUBLE_STATUS},
3815
{"Max_used_connections", (char*) &max_used_connections, SHOW_LONG},
3806
{"Max_used_connections", (char*) &max_used_connections, SHOW_INT},
3816
3807
{"Open_files", (char*) &my_file_opened, SHOW_LONG_NOFLUSH},
3817
3808
{"Open_streams", (char*) &my_stream_opened, SHOW_LONG_NOFLUSH},
3818
3809
{"Open_table_definitions", (char*) &show_table_definitions_cont, SHOW_FUNC},
3826
3817
{"Select_range", (char*) offsetof(STATUS_VAR, select_range_count), SHOW_LONG_STATUS},
3827
3818
{"Select_range_check", (char*) offsetof(STATUS_VAR, select_range_check_count), SHOW_LONG_STATUS},
3828
3819
{"Select_scan", (char*) offsetof(STATUS_VAR, select_scan_count), SHOW_LONG_STATUS},
3829
{"Slave_open_temp_tables", (char*) &slave_open_temp_tables, SHOW_LONG},
3820
{"Slave_open_temp_tables", (char*) &slave_open_temp_tables, SHOW_LONGLONG},
3830
3821
{"Slave_retried_transactions",(char*) &show_slave_retried_trans_cont, SHOW_FUNC},
3831
3822
{"Slave_heartbeat_period", (char*) &show_heartbeat_period_cont, SHOW_FUNC},
3832
3823
{"Slave_received_heartbeats",(char*) &show_slave_received_heartbeats_cont, SHOW_FUNC},
3833
3824
{"Slave_running", (char*) &show_slave_running_cont, SHOW_FUNC},
3834
{"Slow_launch_threads", (char*) &slow_launch_threads, SHOW_LONG},
3825
{"Slow_launch_threads", (char*) &slow_launch_threads, SHOW_LONGLONG},
3835
3826
{"Slow_queries", (char*) offsetof(STATUS_VAR, long_query_count), SHOW_LONG_STATUS},
3836
3827
{"Sort_merge_passes", (char*) offsetof(STATUS_VAR, filesort_merge_passes), SHOW_LONG_STATUS},
3837
3828
{"Sort_range", (char*) offsetof(STATUS_VAR, filesort_range_count), SHOW_LONG_STATUS},
3838
3829
{"Sort_rows", (char*) offsetof(STATUS_VAR, filesort_rows), SHOW_LONG_STATUS},
3839
3830
{"Sort_scan", (char*) offsetof(STATUS_VAR, filesort_scan_count), SHOW_LONG_STATUS},
3840
{"Table_locks_immediate", (char*) &locks_immediate, SHOW_LONG},
3841
{"Table_locks_waited", (char*) &locks_waited, SHOW_LONG},
3831
{"Table_locks_immediate", (char*) &locks_immediate, SHOW_INT},
3832
{"Table_locks_waited", (char*) &locks_waited, SHOW_INT},
3842
3833
#ifdef HAVE_MMAP
3843
{"Tc_log_max_pages_used", (char*) &tc_log_max_pages_used, SHOW_LONG},
3844
{"Tc_log_page_size", (char*) &tc_log_page_size, SHOW_LONG},
3845
{"Tc_log_page_waits", (char*) &tc_log_page_waits, SHOW_LONG},
3834
{"Tc_log_max_pages_used", (char*) &tc_log_max_pages_used, SHOW_LONGLONG},
3835
{"Tc_log_page_size", (char*) &tc_log_page_size, SHOW_LONGLONG},
3836
{"Tc_log_page_waits", (char*) &tc_log_page_waits, SHOW_LONGLONG},
3847
3838
{"Threads_connected", (char*) &connection_count, SHOW_INT},
3848
3839
{"Threads_created", (char*) &thread_created, SHOW_LONG_NOFLUSH},
3849
3840
{"Threads_running", (char*) &thread_running, SHOW_INT},
3850
3841
{"Uptime", (char*) &show_starttime_cont, SHOW_FUNC},
3851
3842
{"Uptime_since_flush_status",(char*) &show_flushstatustime_cont, SHOW_FUNC},
3852
{NULL, NULL, SHOW_LONG}
3843
{NULL, NULL, SHOW_LONGLONG}
3855
3846
static void print_version(void)