2191
2191
unsigned_flag= !(from_base < 0);
2193
if (args[0]->field_type() == MYSQL_TYPE_BIT)
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
2200
dec= args[0]->val_int();
2194
dec= my_strntoll(res->charset(), res->ptr(), res->length(),
2195
-from_base, &endptr, &err);
2205
dec= my_strntoll(res->charset(), res->ptr(), res->length(),
2206
-from_base, &endptr, &err);
2208
dec= (longlong) my_strntoull(res->charset(), res->ptr(), res->length(),
2209
from_base, &endptr, &err);
2197
dec= (longlong) my_strntoull(res->charset(), res->ptr(), res->length(),
2198
from_base, &endptr, &err);
2212
2200
ptr= longlong2str(dec, ans, to_base);
2213
2201
if (str->copy(ans, (uint32) (ptr-ans), default_charset()))