690
709
DRIZZLE_CONFIG_NAME, "server", 0, 0
712
static int show_starttime(drizzle_show_var *var, char *buff)
714
var->type= SHOW_LONG;
716
*((long *)buff)= (long) (time(NULL) - server_start_time);
720
static int show_flushstatustime(drizzle_show_var *var, char *buff)
722
var->type= SHOW_LONG;
724
*((long *)buff)= (long) (time(NULL) - flush_status_time);
728
static st_show_var_func_container show_starttime_cont= { &show_starttime };
730
static st_show_var_func_container show_flushstatustime_cont= { &show_flushstatustime };
732
static drizzle_show_var status_vars[]= {
733
{"Aborted_clients", (char*) ¤t_global_counters.aborted_threads, SHOW_LONGLONG},
734
{"Aborted_connects", (char*) ¤t_global_counters.aborted_connects, SHOW_LONGLONG},
735
{"Bytes_received", (char*) offsetof(system_status_var, bytes_received), SHOW_LONGLONG_STATUS},
736
{"Bytes_sent", (char*) offsetof(system_status_var, bytes_sent), SHOW_LONGLONG_STATUS},
737
{"Connections", (char*) &global_thread_id, SHOW_INT_NOFLUSH},
738
{"Created_tmp_disk_tables", (char*) offsetof(system_status_var, created_tmp_disk_tables), SHOW_LONG_STATUS},
739
{"Created_tmp_tables", (char*) offsetof(system_status_var, created_tmp_tables), SHOW_LONG_STATUS},
740
{"Flush_commands", (char*) &refresh_version, SHOW_INT_NOFLUSH},
741
{"Handler_commit", (char*) offsetof(system_status_var, ha_commit_count), SHOW_LONG_STATUS},
742
{"Handler_delete", (char*) offsetof(system_status_var, ha_delete_count), SHOW_LONG_STATUS},
743
{"Handler_prepare", (char*) offsetof(system_status_var, ha_prepare_count), SHOW_LONG_STATUS},
744
{"Handler_read_first", (char*) offsetof(system_status_var, ha_read_first_count), SHOW_LONG_STATUS},
745
{"Handler_read_key", (char*) offsetof(system_status_var, ha_read_key_count), SHOW_LONG_STATUS},
746
{"Handler_read_next", (char*) offsetof(system_status_var, ha_read_next_count), SHOW_LONG_STATUS},
747
{"Handler_read_prev", (char*) offsetof(system_status_var, ha_read_prev_count), SHOW_LONG_STATUS},
748
{"Handler_read_rnd", (char*) offsetof(system_status_var, ha_read_rnd_count), SHOW_LONG_STATUS},
749
{"Handler_read_rnd_next", (char*) offsetof(system_status_var, ha_read_rnd_next_count), SHOW_LONG_STATUS},
750
{"Handler_rollback", (char*) offsetof(system_status_var, ha_rollback_count), SHOW_LONG_STATUS},
751
{"Handler_savepoint", (char*) offsetof(system_status_var, ha_savepoint_count), SHOW_LONG_STATUS},
752
{"Handler_savepoint_rollback",(char*) offsetof(system_status_var, ha_savepoint_rollback_count), SHOW_LONG_STATUS},
753
{"Handler_update", (char*) offsetof(system_status_var, ha_update_count), SHOW_LONG_STATUS},
754
{"Handler_write", (char*) offsetof(system_status_var, ha_write_count), SHOW_LONG_STATUS},
755
{"Key_blocks_not_flushed", (char*) offsetof(KEY_CACHE, global_blocks_changed), SHOW_KEY_CACHE_LONG},
756
{"Key_blocks_unused", (char*) offsetof(KEY_CACHE, blocks_unused), SHOW_KEY_CACHE_LONG},
757
{"Key_blocks_used", (char*) offsetof(KEY_CACHE, blocks_used), SHOW_KEY_CACHE_LONG},
758
{"Key_read_requests", (char*) offsetof(KEY_CACHE, global_cache_r_requests), SHOW_KEY_CACHE_LONGLONG},
759
{"Key_reads", (char*) offsetof(KEY_CACHE, global_cache_read), SHOW_KEY_CACHE_LONGLONG},
760
{"Key_write_requests", (char*) offsetof(KEY_CACHE, global_cache_w_requests), SHOW_KEY_CACHE_LONGLONG},
761
{"Key_writes", (char*) offsetof(KEY_CACHE, global_cache_write), SHOW_KEY_CACHE_LONGLONG},
762
{"Last_query_cost", (char*) offsetof(system_status_var, last_query_cost), SHOW_DOUBLE_STATUS},
763
{"Max_used_connections", (char*) ¤t_global_counters.max_used_connections, SHOW_INT},
764
{"Questions", (char*) offsetof(system_status_var, questions), SHOW_LONG_STATUS},
765
{"Select_full_join", (char*) offsetof(system_status_var, select_full_join_count), SHOW_LONG_STATUS},
766
{"Select_full_range_join", (char*) offsetof(system_status_var, select_full_range_join_count), SHOW_LONG_STATUS},
767
{"Select_range", (char*) offsetof(system_status_var, select_range_count), SHOW_LONG_STATUS},
768
{"Select_range_check", (char*) offsetof(system_status_var, select_range_check_count), SHOW_LONG_STATUS},
769
{"Select_scan", (char*) offsetof(system_status_var, select_scan_count), SHOW_LONG_STATUS},
770
{"Slow_queries", (char*) offsetof(system_status_var, long_query_count), SHOW_LONG_STATUS},
771
{"Sort_merge_passes", (char*) offsetof(system_status_var, filesort_merge_passes), SHOW_LONG_STATUS},
772
{"Sort_range", (char*) offsetof(system_status_var, filesort_range_count), SHOW_LONG_STATUS},
773
{"Sort_rows", (char*) offsetof(system_status_var, filesort_rows), SHOW_LONG_STATUS},
774
{"Sort_scan", (char*) offsetof(system_status_var, filesort_scan_count), SHOW_LONG_STATUS},
775
{"Table_locks_immediate", (char*) ¤t_global_counters.locks_immediate, SHOW_INT},
776
{"Table_locks_waited", (char*) ¤t_global_counters.locks_waited, SHOW_INT},
777
{"Threads_connected", (char*) &connection_count, SHOW_INT},
778
{"Uptime", (char*) &show_starttime_cont, SHOW_FUNC},
779
{"Uptime_since_flush_status",(char*) &show_flushstatustime_cont, SHOW_FUNC},
780
{NULL, NULL, SHOW_LONGLONG}
693
783
int init_common_variables(const char *conf_file_name, int argc,
694
784
char **argv, const char **groups)