~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to sql/handler.cc

  • Committer: Brian Aker
  • Date: 2008-06-29 20:10:28 UTC
  • mto: This revision was merged to the branch mainline in revision 16.
  • Revision ID: brian@tangent.org-20080629201028-923bdzz0qcjmd6cm
Cleaned up show status.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4660
4660
  return FALSE;
4661
4661
}
4662
4662
 
4663
 
 
4664
 
static my_bool showstat_handlerton(THD *thd, plugin_ref plugin,
4665
 
                                   void *arg)
4666
 
{
4667
 
  enum ha_stat_type stat= *(enum ha_stat_type *) arg;
4668
 
  handlerton *hton= plugin_data(plugin, handlerton *);
4669
 
  if (hton->state == SHOW_OPTION_YES && hton->show_status &&
4670
 
      hton->show_status(hton, thd, stat_print, stat))
4671
 
    return TRUE;
4672
 
  return FALSE;
4673
 
}
4674
 
 
4675
4663
bool ha_show_status(THD *thd, handlerton *db_type, enum ha_stat_type stat)
4676
4664
{
4677
4665
  List<Item> field_list;
4686
4674
                            Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF))
4687
4675
    return TRUE;
4688
4676
 
4689
 
  if (db_type == NULL)
4690
 
  {
4691
 
    result= plugin_foreach(thd, showstat_handlerton,
4692
 
                           MYSQL_STORAGE_ENGINE_PLUGIN, &stat);
4693
 
  }
4694
 
  else
4695
 
  {
4696
 
    if (db_type->state != SHOW_OPTION_YES)
4697
 
    {
4698
 
      const LEX_STRING *name=&hton2plugin[db_type->slot]->name;
4699
 
      result= stat_print(thd, name->str, name->length,
4700
 
                         "", 0, "DISABLED", 8) ? 1 : 0;
4701
 
    }
4702
 
    else
4703
 
      result= db_type->show_status &&
4704
 
              db_type->show_status(db_type, thd, stat_print, stat) ? 1 : 0;
4705
 
  }
 
4677
  result= db_type->show_status &&
 
4678
    db_type->show_status(db_type, thd, stat_print, stat) ? 1 : 0;
4706
4679
 
4707
4680
  if (!result)
4708
4681
    my_eof(thd);