~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/drizzled.cc

  • Committer: Brian Aker
  • Date: 2009-01-22 00:08:56 UTC
  • mto: This revision was merged to the branch mainline in revision 801.
  • Revision ID: brian@tangent.org-20090122000856-rr7sw18x052blr6o
Binlog variables removal

Show diffs side-by-side

added added

removed removed

Lines of Context:
3563
3563
static st_show_var_func_container
3564
3564
show_flushstatustime_cont= { &show_flushstatustime };
3565
3565
 
3566
 
static int show_slave_running(Session *session __attribute__((unused)),
3567
 
                              SHOW_VAR *var, char *buff)
3568
 
{
3569
 
  var->type= SHOW_MY_BOOL;
3570
 
  pthread_mutex_lock(&LOCK_active_mi);
3571
 
  var->value= buff;
3572
 
  *((bool *)buff)= (bool) (active_mi && active_mi->slave_running &&
3573
 
                                 active_mi->rli.slave_running);
3574
 
  pthread_mutex_unlock(&LOCK_active_mi);
3575
 
  return 0;
3576
 
}
3577
 
 
3578
 
static st_show_var_func_container
3579
 
show_slave_running_cont= { &show_slave_running };
3580
 
 
3581
 
static int show_slave_retried_trans(Session *session __attribute__((unused)),
3582
 
                                    SHOW_VAR *var, char *buff)
3583
 
{
3584
 
  /*
3585
 
    TODO: with multimaster, have one such counter per line in
3586
 
    SHOW SLAVE STATUS, and have the sum over all lines here.
3587
 
  */
3588
 
  pthread_mutex_lock(&LOCK_active_mi);
3589
 
  if (active_mi)
3590
 
  {
3591
 
    var->type= SHOW_LONG;
3592
 
    var->value= buff;
3593
 
    pthread_mutex_lock(&active_mi->rli.data_lock);
3594
 
    *((long *)buff)= (long)active_mi->rli.retried_trans;
3595
 
    pthread_mutex_unlock(&active_mi->rli.data_lock);
3596
 
  }
3597
 
  else
3598
 
    var->type= SHOW_UNDEF;
3599
 
  pthread_mutex_unlock(&LOCK_active_mi);
3600
 
  return 0;
3601
 
}
3602
 
 
3603
 
static st_show_var_func_container
3604
 
show_slave_retried_trans_cont= { &show_slave_retried_trans };
3605
 
 
3606
 
static int show_slave_received_heartbeats(Session *session __attribute__((unused)),
3607
 
                                          SHOW_VAR *var, char *buff)
3608
 
{
3609
 
  pthread_mutex_lock(&LOCK_active_mi);
3610
 
  if (active_mi)
3611
 
  {
3612
 
    var->type= SHOW_LONGLONG;
3613
 
    var->value= buff;
3614
 
    pthread_mutex_lock(&active_mi->rli.data_lock);
3615
 
    *((int64_t *)buff)= active_mi->received_heartbeats;
3616
 
    pthread_mutex_unlock(&active_mi->rli.data_lock);
3617
 
  }
3618
 
  else
3619
 
    var->type= SHOW_UNDEF;
3620
 
  pthread_mutex_unlock(&LOCK_active_mi);
3621
 
  return 0;
3622
 
}
3623
 
 
3624
 
static st_show_var_func_container
3625
 
show_slave_received_heartbeats_cont= { &show_slave_received_heartbeats };
3626
 
 
3627
 
static int show_heartbeat_period(Session *session __attribute__((unused)),
3628
 
                                 SHOW_VAR *var, char *buff)
3629
 
{
3630
 
  pthread_mutex_lock(&LOCK_active_mi);
3631
 
  if (active_mi)
3632
 
  {
3633
 
    var->type= SHOW_CHAR;
3634
 
    var->value= buff;
3635
 
    sprintf(buff, "%.3f",active_mi->heartbeat_period);
3636
 
  }
3637
 
  else
3638
 
    var->type= SHOW_UNDEF;
3639
 
  pthread_mutex_unlock(&LOCK_active_mi);
3640
 
  return 0;
3641
 
}
3642
 
 
3643
 
static st_show_var_func_container
3644
 
show_heartbeat_period_cont= { &show_heartbeat_period};
3645
 
 
3646
3566
static int show_open_tables(Session *session __attribute__((unused)),
3647
3567
                            SHOW_VAR *var, char *buff)
3648
3568
{
3673
3593
SHOW_VAR status_vars[]= {
3674
3594
  {"Aborted_clients",          (char*) &aborted_threads,        SHOW_LONGLONG},
3675
3595
  {"Aborted_connects",         (char*) &aborted_connects,       SHOW_LONGLONG},
3676
 
  {"Binlog_cache_disk_use",    (char*) &binlog_cache_disk_use,  SHOW_LONGLONG},
3677
 
  {"Binlog_cache_use",         (char*) &binlog_cache_use,       SHOW_LONGLONG},
3678
3596
  {"Bytes_received",           (char*) offsetof(STATUS_VAR, bytes_received), SHOW_LONGLONG_STATUS},
3679
3597
  {"Bytes_sent",               (char*) offsetof(STATUS_VAR, bytes_sent), SHOW_LONGLONG_STATUS},
3680
3598
  {"Com",                      (char*) com_status_vars, SHOW_ARRAY},
3720
3638
  {"Select_range",             (char*) offsetof(STATUS_VAR, select_range_count), SHOW_LONG_STATUS},
3721
3639
  {"Select_range_check",       (char*) offsetof(STATUS_VAR, select_range_check_count), SHOW_LONG_STATUS},
3722
3640
  {"Select_scan",              (char*) offsetof(STATUS_VAR, select_scan_count), SHOW_LONG_STATUS},
3723
 
  {"Slave_open_temp_tables",   (char*) &slave_open_temp_tables, SHOW_LONGLONG},
3724
 
  {"Slave_retried_transactions",(char*) &show_slave_retried_trans_cont, SHOW_FUNC},
3725
 
  {"Slave_heartbeat_period",   (char*) &show_heartbeat_period_cont, SHOW_FUNC},
3726
 
  {"Slave_received_heartbeats",(char*) &show_slave_received_heartbeats_cont, SHOW_FUNC},
3727
 
  {"Slave_running",            (char*) &show_slave_running_cont,     SHOW_FUNC},
3728
3641
  {"Slow_launch_threads",      (char*) &slow_launch_threads,    SHOW_LONGLONG},
3729
3642
  {"Slow_queries",             (char*) offsetof(STATUS_VAR, long_query_count), SHOW_LONG_STATUS},
3730
3643
  {"Sort_merge_passes",        (char*) offsetof(STATUS_VAR, filesort_merge_passes), SHOW_LONG_STATUS},
3733
3646
  {"Sort_scan",                (char*) offsetof(STATUS_VAR, filesort_scan_count), SHOW_LONG_STATUS},
3734
3647
  {"Table_locks_immediate",    (char*) &locks_immediate,        SHOW_INT},
3735
3648
  {"Table_locks_waited",       (char*) &locks_waited,           SHOW_INT},
3736
 
#ifdef HAVE_MMAP
3737
 
  {"Tc_log_max_pages_used",    (char*) &tc_log_max_pages_used,  SHOW_LONGLONG},
3738
 
  {"Tc_log_page_size",         (char*) &tc_log_page_size,       SHOW_LONGLONG},
3739
 
  {"Tc_log_page_waits",        (char*) &tc_log_page_waits,      SHOW_LONGLONG},
3740
 
#endif
3741
3649
  {"Threads_connected",        (char*) &connection_count,       SHOW_INT},
3742
3650
  {"Threads_created",          (char*) &thread_created,         SHOW_LONG_NOFLUSH},
3743
3651
  {"Threads_running",          (char*) &thread_running,         SHOW_INT},