~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/opt_range.cc

  • Committer: Lee
  • Date: 2009-01-06 20:24:58 UTC
  • mfrom: (759 drizzle)
  • mto: This revision was merged to the branch mainline in revision 763.
  • Revision ID: lbieber@lbieber-desktop-20090106202458-82n4kyftrnakvl4r
merge with latest from the trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
5755
5755
    return 0;                                   // Found end of tree
5756
5756
  if (element->parent != parent)
5757
5757
  {
5758
 
    sql_print_error("Wrong tree: Parent doesn't point at parent");
 
5758
    errmsg_printf(ERRMSG_LVL_ERROR, "Wrong tree: Parent doesn't point at parent");
5759
5759
    return -1;
5760
5760
  }
5761
5761
  if (element->color == SEL_ARG::RED &&
5762
5762
      (element->left->color == SEL_ARG::RED ||
5763
5763
       element->right->color == SEL_ARG::RED))
5764
5764
  {
5765
 
    sql_print_error("Wrong tree: Found two red in a row");
 
5765
    errmsg_printf(ERRMSG_LVL_ERROR, "Wrong tree: Found two red in a row");
5766
5766
    return -1;
5767
5767
  }
5768
5768
  if (element->left == element->right && element->left != &null_element)
5769
5769
  {                                             // Dummy test
5770
 
    sql_print_error("Wrong tree: Found right == left");
 
5770
    errmsg_printf(ERRMSG_LVL_ERROR, "Wrong tree: Found right == left");
5771
5771
    return -1;
5772
5772
  }
5773
5773
  count_l=test_rb_tree(element->left,element);
5776
5776
  {
5777
5777
    if (count_l == count_r)
5778
5778
      return count_l+(element->color == SEL_ARG::BLACK);
5779
 
    sql_print_error("Wrong tree: Incorrect black-count: %d - %d",
 
5779
    errmsg_printf(ERRMSG_LVL_ERROR, "Wrong tree: Incorrect black-count: %d - %d",
5780
5780
            count_l,count_r);
5781
5781
  }
5782
5782
  return -1;                                    // Error, no more warnings
5863
5863
  uint32_t e_count=0;
5864
5864
  if (this == root && use_count != 1)
5865
5865
  {
5866
 
    sql_print_information("Use_count: Wrong count %lu for root",use_count);
 
5866
    errmsg_printf(ERRMSG_LVL_INFO, "Use_count: Wrong count %lu for root",use_count);
5867
5867
    return;
5868
5868
  }
5869
5869
  if (this->type != SEL_ARG::KEY_RANGE)
5876
5876
      ulong count=count_key_part_usage(root,pos->next_key_part);
5877
5877
      if (count > pos->next_key_part->use_count)
5878
5878
      {
5879
 
        sql_print_information("Use_count: Wrong count for key at 0x%lx, %lu "
 
5879
        errmsg_printf(ERRMSG_LVL_INFO, "Use_count: Wrong count for key at 0x%lx, %lu "
5880
5880
                              "should be %lu", (long unsigned int)pos,
5881
5881
                              pos->next_key_part->use_count, count);
5882
5882
        return;
5885
5885
    }
5886
5886
  }
5887
5887
  if (e_count != elements)
5888
 
    sql_print_warning("Wrong use count: %u (should be %u) for tree at 0x%lx",
 
5888
    errmsg_printf(ERRMSG_LVL_WARN, "Wrong use count: %u (should be %u) for tree at 0x%lx",
5889
5889
                      e_count, elements, (long unsigned int) this);
5890
5890
}
5891
5891