~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/opt_range.cc

Merge Stewart

Show diffs side-by-side

added added

removed removed

Lines of Context:
4555
4555
    if (value->real_item()->type() == Item::FIELD_ITEM
4556
4556
        && value->result_type() == STRING_RESULT)
4557
4557
    {
4558
 
      char buff[MAX_DATETIME_FULL_WIDTH];
 
4558
      char buff[drizzled::DateTime::MAX_STRING_LENGTH];
4559
4559
      String tmp(buff, sizeof(buff), &my_charset_bin);
4560
4560
      String *res= value->val_str(&tmp);
4561
4561
 
4585
4585
           * Datetime in right-hand side column is before UNIX epoch, so adjust to
4586
4586
           * lower bound.
4587
4587
           */
4588
 
          char new_value_buff[MAX_DATETIME_FULL_WIDTH];
4589
 
          size_t new_value_length;
 
4588
          char new_value_buff[drizzled::DateTime::MAX_STRING_LENGTH];
 
4589
          int new_value_length;
4590
4590
          String new_value_string(new_value_buff, sizeof(new_value_buff), &my_charset_bin);
4591
4591
 
4592
 
          min_timestamp.to_string(new_value_string.c_ptr(), &new_value_length);
 
4592
          new_value_length= min_timestamp.to_string(new_value_string.c_ptr(),
 
4593
                                    drizzled::DateTime::MAX_STRING_LENGTH);
 
4594
          assert((new_value_length+1) < drizzled::DateTime::MAX_STRING_LENGTH);
4593
4595
          new_value_string.length(new_value_length);
4594
4596
          err= value->save_str_value_in_field(field, &new_value_string);
4595
4597
        }
4599
4601
           * Datetime in right hand side column is after UNIX epoch, so adjust
4600
4602
           * to the higher bound of the epoch.
4601
4603
           */
4602
 
          char new_value_buff[MAX_DATETIME_FULL_WIDTH];
4603
 
          size_t new_value_length;
 
4604
          char new_value_buff[drizzled::DateTime::MAX_STRING_LENGTH];
 
4605
          int new_value_length;
4604
4606
          String new_value_string(new_value_buff, sizeof(new_value_buff), &my_charset_bin);
4605
4607
 
4606
 
          max_timestamp.to_string(new_value_string.c_ptr(), &new_value_length);
 
4608
          new_value_length= max_timestamp.to_string(new_value_string.c_ptr(),
 
4609
                                        drizzled::DateTime::MAX_STRING_LENGTH);
 
4610
          assert((new_value_length+1) < drizzled::DateTime::MAX_STRING_LENGTH);
4607
4611
          new_value_string.length(new_value_length);
4608
4612
          err= value->save_str_value_in_field(field, &new_value_string);
4609
4613
        }