~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/show.cc

Merge joe.

Show diffs side-by-side

added added

removed removed

Lines of Context:
654
654
*****************************************************************************/
655
655
 
656
656
static vector<drizzle_show_var *> all_status_vars;
657
 
static vector<drizzle_show_var *> com_status_vars;
658
657
static bool status_vars_inited= 0;
659
658
static int show_var_cmp(const void *var1, const void *var2)
660
659
{
687
686
  return all_status_vars.front();
688
687
}
689
688
 
690
 
drizzle_show_var *getCommandStatusVars()
691
 
{
692
 
  return com_status_vars.front();
693
 
}
694
 
 
695
689
/*
696
690
  Adds an array of drizzle_show_var entries to the output of SHOW STATUS
697
691
 
724
718
  return res;
725
719
}
726
720
 
727
 
int add_com_status_vars(drizzle_show_var *list)
728
 
{
729
 
  int res= 0;
730
 
 
731
 
  while (list->name)
732
 
    com_status_vars.insert(com_status_vars.begin(), list++);
733
 
  if (status_vars_inited)
734
 
    sort(com_status_vars.begin(), com_status_vars.end(),
735
 
         show_var_cmp_functor());
736
 
 
737
 
  return res;
738
 
}
739
 
 
740
721
/*
741
722
  Make all_status_vars[] usable for SHOW STATUS
742
723
 
750
731
  status_vars_inited= 1;
751
732
  sort(all_status_vars.begin(), all_status_vars.end(),
752
733
       show_var_cmp_functor());
753
 
  sort(com_status_vars.begin(), com_status_vars.end(),
754
 
       show_var_cmp_functor());
755
734
}
756
735
 
757
736
void reset_status_vars()
766
745
      (*p)->value= 0;
767
746
    ++p;
768
747
  }
769
 
 
770
 
  p= com_status_vars.begin();
771
 
  while (p != com_status_vars.end())
772
 
  {
773
 
    /* Note that SHOW_LONG_NOFLUSH variables are not reset */
774
 
    if ((*p)->type == SHOW_LONG)
775
 
      (*p)->value= 0;
776
 
    ++p;
777
 
  }
778
748
}
779
749
 
780
750
/*
789
759
void free_status_vars()
790
760
{
791
761
  all_status_vars.clear();
792
 
  com_status_vars.clear();
793
762
}
794
763
 
795
764
/*