~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_table.cc

Merged Nathan (and added a valgrind suppression)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1049
1049
        */
1050
1050
        interval= sql_field->interval= typelib(session->mem_root,
1051
1051
                                               sql_field->interval_list);
1052
 
        String conv;
 
1052
 
 
1053
        List_iterator<String> int_it(sql_field->interval_list);
 
1054
        String conv, *tmp;
1053
1055
        char comma_buf[4];
1054
1056
        int comma_length= cs->cset->wc_mb(cs, ',', (unsigned char*) comma_buf,
1055
1057
                                          (unsigned char*) comma_buf +
1056
1058
                                          sizeof(comma_buf));
1057
1059
        assert(comma_length > 0);
1058
1060
 
1059
 
        vector<String*>::iterator int_it= sql_field->interval_list.begin();
1060
 
        for (uint32_t i= 0; int_it != sql_field->interval_list.end(); ++int_it, ++i)
 
1061
        for (uint32_t i= 0; (tmp= int_it++); i++)
1061
1062
        {
1062
 
          String *tmp= *int_it;
 
1063
          uint32_t lengthsp;
1063
1064
          if (String::needs_conversion(tmp->length(), tmp->charset(),
1064
1065
                                       cs, &dummy))
1065
1066
          {
1071
1072
          }
1072
1073
 
1073
1074
          // Strip trailing spaces.
1074
 
          uint32_t lengthsp= cs->cset->lengthsp(cs, interval->type_names[i],
1075
 
                                                interval->type_lengths[i]);
 
1075
          lengthsp= cs->cset->lengthsp(cs, interval->type_names[i],
 
1076
                                       interval->type_lengths[i]);
1076
1077
          interval->type_lengths[i]= lengthsp;
1077
1078
          ((unsigned char *)interval->type_names[i])[lengthsp]= '\0';
1078
1079
        }