~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/item/cmpfunc.cc

  • Committer: Monty Taylor
  • Date: 2009-01-28 04:37:46 UTC
  • mto: (779.7.3 devel)
  • mto: This revision was merged to the branch mainline in revision 816.
  • Revision ID: mordred@inaugust.com-20090128043746-d2yukekishwn3ftm
TurnedĀ onĀ -Wshadow.

Show diffs side-by-side

added added

removed removed

Lines of Context:
512
512
  }
513
513
 
514
514
  session= current_session;
 
515
  Item_field *field_item= NULL;
515
516
 
516
517
  if (args[0]->real_item()->type() == FIELD_ITEM)
517
518
  {
518
 
    Item_field *field_item= (Item_field*) (args[0]->real_item());
 
519
    field_item= static_cast<Item_field*>(args[0]->real_item());
519
520
    if (field_item->field->can_be_compared_as_int64_t() &&
520
521
        !(field_item->is_datetime() && args[1]->result_type() == STRING_RESULT))
521
522
    {
530
531
 
531
532
    if (args[1]->real_item()->type() == FIELD_ITEM)
532
533
    {
533
 
      Item_field *field_item= (Item_field*) (args[1]->real_item());
 
534
      field_item= static_cast<Item_field*>(args[1]->real_item());
534
535
      if (field_item->field->can_be_compared_as_int64_t() &&
535
536
          !(field_item->is_datetime() &&
536
537
            args[0]->result_type() == STRING_RESULT))
3625
3626
    /* All DATE/DATETIME fields/functions has the STRING result type. */
3626
3627
    if (cmp_type == STRING_RESULT || cmp_type == ROW_RESULT)
3627
3628
    {
3628
 
      uint32_t col, cols= args[0]->cols();
 
3629
      uint32_t col, num_cols= args[0]->cols();
3629
3630
 
3630
 
      for (col= 0; col < cols; col++)
 
3631
      for (col= 0; col < num_cols; col++)
3631
3632
      {
3632
3633
        bool skip_column= false;
3633
3634
        /*
3747
3748
    if (array && !(session->is_fatal_error))            // If not EOM
3748
3749
    {
3749
3750
      uint32_t j=0;
3750
 
      for (uint32_t i=1 ; i < arg_count ; i++)
 
3751
      for (uint32_t arg_num=1 ; arg_num < arg_count ; arg_num++)
3751
3752
      {
3752
 
        array->set(j,args[i]);
3753
 
        if (!args[i]->null_value)                       // Skip NULL values
 
3753
        array->set(j,args[arg_num]);
 
3754
        if (!args[arg_num]->null_value)                 // Skip NULL values
3754
3755
          j++;
3755
3756
        else
3756
3757
          have_null= 1;