~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to sql/item_strfunc.cc

  • Committer: Brian Aker
  • Date: 2008-07-05 19:24:24 UTC
  • mfrom: (53.2.8 codestyle)
  • Revision ID: brian@tangent.org-20080705192424-3uslywtteymm7xqy
First pass of removing BIT_TYPE

Show diffs side-by-side

added added

removed removed

Lines of Context:
2190
2190
  null_value= 0;
2191
2191
  unsigned_flag= !(from_base < 0);
2192
2192
 
2193
 
  if (args[0]->field_type() == MYSQL_TYPE_BIT) 
2194
 
  {
2195
 
    /* 
2196
 
     Special case: The string representation of BIT doesn't resemble the
2197
 
     decimal representation, so we shouldn't change it to string and then to
2198
 
     decimal. 
2199
 
    */
2200
 
    dec= args[0]->val_int();
2201
 
  }
 
2193
  if (from_base < 0)
 
2194
    dec= my_strntoll(res->charset(), res->ptr(), res->length(),
 
2195
                     -from_base, &endptr, &err);
2202
2196
  else
2203
 
  {
2204
 
    if (from_base < 0)
2205
 
      dec= my_strntoll(res->charset(), res->ptr(), res->length(),
2206
 
                       -from_base, &endptr, &err);
2207
 
    else
2208
 
      dec= (longlong) my_strntoull(res->charset(), res->ptr(), res->length(),
2209
 
                                   from_base, &endptr, &err);
2210
 
  }
 
2197
    dec= (longlong) my_strntoull(res->charset(), res->ptr(), res->length(),
 
2198
                                 from_base, &endptr, &err);
2211
2199
 
2212
2200
  ptr= longlong2str(dec, ans, to_base);
2213
2201
  if (str->copy(ans, (uint32) (ptr-ans), default_charset()))