590
bool Field_num::get_int(const CHARSET_INFO * const cs, const char *from, uint len,
590
bool Field_num::get_int(const CHARSET_INFO * const cs, const char *from, uint32_t len,
591
591
int64_t *rnd, uint64_t unsigned_max,
592
592
int64_t signed_min, int64_t signed_max)
721
721
String *Field::val_int_as_str(String *val_buffer, bool unsigned_val)
723
723
const CHARSET_INFO * const cs= &my_charset_bin;
725
725
int64_t value= val_int();
727
727
if (val_buffer->alloc(MY_INT64_NUM_DECIMAL_DIGITS))
729
length= (uint) (*cs->cset->int64_t10_to_str)(cs, (char*) val_buffer->ptr(),
729
length= (uint32_t) (*cs->cset->int64_t10_to_str)(cs, (char*) val_buffer->ptr(),
730
730
MY_INT64_NUM_DECIMAL_DIGITS,
731
731
unsigned_val ? 10 : -10,
765
uint len= pack_length();
765
uint32_t len= pack_length();
766
766
const CHARSET_INFO * const cs= charset();
767
767
cs->coll->hash_sort(cs, ptr, len, nr, nr2);
783
783
memcpy(ptr,ptr+row_offset,pack_length());
786
*null_ptr= (uchar) ((null_ptr[0] & (uchar) ~(uint) null_bit) | (null_ptr[row_offset] & (uchar) null_bit));
786
*null_ptr= (uchar) ((null_ptr[0] & (uchar) ~(uint32_t) null_bit) | (null_ptr[row_offset] & (uchar) null_bit));
810
810
@retval 0 if this field's size is < the source field's size
811
811
@retval 1 if this field's size is >= the source field's size
813
int Field::compatible_field_size(uint field_metadata)
813
int Field::compatible_field_size(uint32_t field_metadata)
815
uint const source_size= pack_length_from_metadata(field_metadata);
816
uint const destination_size= row_pack_length();
815
uint32_t const source_size= pack_length_from_metadata(field_metadata);
816
uint32_t const destination_size= row_pack_length();
817
817
return (source_size <= destination_size);
821
int Field::store(const char *to, uint length, const CHARSET_INFO * const cs,
821
int Field::store(const char *to, uint32_t length, const CHARSET_INFO * const cs,
822
822
enum_check_fields check_level)
871
Field::pack(uchar *to, const uchar *from, uint max_length,
871
Field::pack(uchar *to, const uchar *from, uint32_t max_length,
872
872
bool low_byte_first __attribute__((unused)))
874
874
uint32_t length= pack_length();
908
908
@return New pointer into memory based on from + length of the data
911
Field::unpack(uchar* to, const uchar *from, uint param_data,
911
Field::unpack(uchar* to, const uchar *from, uint32_t param_data,
912
912
bool low_byte_first __attribute__((unused)))
914
uint length=pack_length();
914
uint32_t length=pack_length();
915
915
int from_type= 0;
917
917
If from length is > 255, it has encoded data in the upper bits. Need
1151
bool Field::get_date(DRIZZLE_TIME *ltime,uint fuzzydate)
1151
bool Field::get_date(DRIZZLE_TIME *ltime,uint32_t fuzzydate)
1154
1154
String tmp(buff,sizeof(buff),&my_charset_bin),*res;
1180
1180
enum enum_drizzle_timestamp_type type_arg __attribute__((unused)))
1182
1182
char buff[MAX_DATE_STRING_REP_LENGTH];
1183
uint length= (uint) my_TIME_to_str(ltime, buff);
1183
uint32_t length= (uint32_t) my_TIME_to_str(ltime, buff);
1184
1184
return store(buff, length, &my_charset_bin);
1188
bool Field::optimize_range(uint idx, uint part)
1188
bool Field::optimize_range(uint32_t idx, uint32_t part)
1190
1190
return test(table->file->index_flags(idx, part, 1) & HA_READ_RANGE);
1214
1214
Field *Field::new_key_field(MEM_ROOT *root, Table *new_table,
1215
1215
uchar *new_ptr, uchar *new_null_ptr,
1216
uint32_t new_null_bit)
1219
1219
if ((tmp= new_field(root, new_table, table == new_table)))
1246
1246
****************************************************************************/
1248
int Field_tiny::store(const char *from,uint len, const CHARSET_INFO * const cs)
1248
int Field_tiny::store(const char *from,uint32_t len, const CHARSET_INFO * const cs)
1362
1362
String *val_ptr __attribute__((unused)))
1364
1364
const CHARSET_INFO * const cs= &my_charset_bin;
1366
uint mlength=cmax(field_length+1,5*cs->mbmaxlen);
1366
uint32_t mlength=cmax(field_length+1,5*cs->mbmaxlen);
1367
1367
val_buffer->alloc(mlength);
1368
1368
char *to=(char*) val_buffer->ptr();
1370
1370
if (unsigned_flag)
1371
length= (uint) cs->cset->long10_to_str(cs,to,mlength, 10,
1371
length= (uint32_t) cs->cset->long10_to_str(cs,to,mlength, 10,
1374
length= (uint) cs->cset->long10_to_str(cs,to,mlength,-10,
1374
length= (uint32_t) cs->cset->long10_to_str(cs,to,mlength,-10,
1375
1375
(long) *((signed char*) ptr));
1377
1377
val_buffer->length(length);
1546
1546
int Field_str::store(double nr)
1548
1548
char buff[DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE];
1549
uint local_char_length= field_length / charset()->mbmaxlen;
1549
uint32_t local_char_length= field_length / charset()->mbmaxlen;
1632
1632
if (typelib->count < from_lib->count)
1634
for (uint i=0 ; i < from_lib->count ; i++)
1634
for (uint32_t i=0 ; i < from_lib->count ; i++)
1635
1635
if (my_strnncoll(field_charset,
1636
1636
(const uchar*)typelib->type_names[i],
1637
1637
strlen(typelib->type_names[i]),
1661
uint Field_num::is_equal(Create_field *new_field)
1661
uint32_t Field_num::is_equal(Create_field *new_field)
1663
1663
return ((new_field->sql_type == real_type()) &&
1664
((new_field->flags & UNSIGNED_FLAG) == (uint) (flags &
1664
((new_field->flags & UNSIGNED_FLAG) == (uint32_t) (flags &
1665
1665
UNSIGNED_FLAG)) &&
1666
1666
((new_field->flags & AUTO_INCREMENT_FLAG) ==
1667
(uint) (flags & AUTO_INCREMENT_FLAG)) &&
1667
(uint32_t) (flags & AUTO_INCREMENT_FLAG)) &&
1668
1668
(new_field->length <= max_display_length()));
1751
1751
bool Create_field::init(THD *thd __attribute__((unused)), char *fld_name, enum_field_types fld_type,
1752
1752
char *fld_length, char *fld_decimals,
1753
uint fld_type_modifier, Item *fld_default_value,
1753
uint32_t fld_type_modifier, Item *fld_default_value,
1754
1754
Item *fld_on_update_value, LEX_STRING *fld_comment,
1755
1755
char *fld_change, List<String> *fld_interval_list,
1756
1756
const CHARSET_INFO * const fld_charset,
1757
uint fld_geom_type __attribute__((unused)),
1757
uint32_t fld_geom_type __attribute__((unused)),
1758
1758
enum column_format_type column_format)
1760
uint sign_len, allowed_type_modifier= 0;
1760
uint32_t sign_len, allowed_type_modifier= 0;
1761
1761
uint32_t max_field_charlength= MAX_FIELD_CHARLENGTH;
1764
1764
field_name= fld_name;
1765
1765
def= fld_default_value;
1766
1766
flags= fld_type_modifier;
1767
flags|= (((uint)column_format & COLUMN_FORMAT_MASK) << COLUMN_FORMAT_FLAGS);
1767
flags|= (((uint32_t)column_format & COLUMN_FORMAT_MASK) << COLUMN_FORMAT_FLAGS);
1768
1768
unireg_check= (fld_type_modifier & AUTO_INCREMENT_FLAG ?
1769
1769
Field::NEXT_NUMBER : Field::NONE);
1770
decimals= fld_decimals ? (uint)atoi(fld_decimals) : 0;
1770
decimals= fld_decimals ? (uint32_t)atoi(fld_decimals) : 0;
1771
1771
if (decimals >= NOT_FIXED_DEC)
1773
1773
my_error(ER_TOO_BIG_SCALE, MYF(0), decimals, fld_name,
1792
1792
(fld_type_modifier & NOT_NULL_FLAG) && fld_type != DRIZZLE_TYPE_TIMESTAMP)
1793
1793
flags|= NO_DEFAULT_VALUE_FLAG;
1795
if (fld_length && !(length= (uint) atoi(fld_length)))
1795
if (fld_length && !(length= (uint32_t) atoi(fld_length)))
1796
1796
fld_length= 0; /* purecov: inspected */
1797
1797
sign_len= fld_type_modifier & UNSIGNED_FLAG ? 0 : 1;
2004
uint pack_length_to_packflag(uint type)
2004
uint32_t pack_length_to_packflag(uint32_t type)
2006
2006
switch (type) {
2007
case 1: return f_settype((uint) DRIZZLE_TYPE_TINY);
2007
case 1: return f_settype((uint32_t) DRIZZLE_TYPE_TINY);
2008
2008
case 2: assert(1);
2009
2009
case 3: assert(1);
2010
case 4: return f_settype((uint) DRIZZLE_TYPE_LONG);
2011
case 8: return f_settype((uint) DRIZZLE_TYPE_LONGLONG);
2010
case 4: return f_settype((uint32_t) DRIZZLE_TYPE_LONG);
2011
case 8: return f_settype((uint32_t) DRIZZLE_TYPE_LONGLONG);
2013
2013
return 0; // This shouldn't happen
2017
2017
Field *make_field(TABLE_SHARE *share, uchar *ptr, uint32_t field_length,
2018
2018
uchar *null_pos, uchar null_bit,
2020
2020
enum_field_types field_type,
2021
2021
const CHARSET_INFO * field_charset,
2022
2022
Field::utype unireg_check,
2259
2259
Field::set_datetime_warning(DRIZZLE_ERROR::enum_warning_level level,
2260
2260
unsigned int code,
2261
const char *str, uint str_length,
2261
const char *str, uint32_t str_length,
2262
2262
enum enum_drizzle_timestamp_type ts_type, int cuted_increment)
2264
2264
THD *thd= table ? table->in_use : current_thd;
2289
Field::set_datetime_warning(DRIZZLE_ERROR::enum_warning_level level, uint code,
2289
Field::set_datetime_warning(DRIZZLE_ERROR::enum_warning_level level, uint32_t code,
2290
2290
int64_t nr, enum enum_drizzle_timestamp_type ts_type,
2291
2291
int cuted_increment)
2297
2297
char str_nr[22];
2298
2298
char *str_end= int64_t10_to_str(nr, str_nr, -10);
2299
make_truncated_value_warning(thd, level, str_nr, (uint) (str_end - str_nr),
2299
make_truncated_value_warning(thd, level, str_nr, (uint32_t) (str_end - str_nr),
2300
2300
ts_type, field_name);
2320
Field::set_datetime_warning(DRIZZLE_ERROR::enum_warning_level level, uint code,
2320
Field::set_datetime_warning(DRIZZLE_ERROR::enum_warning_level level, uint32_t code,
2321
2321
double nr, enum enum_drizzle_timestamp_type ts_type)
2323
2323
THD *thd= table ? table->in_use : current_thd;
2327
2327
/* DBL_DIG is enough to print '-[digits].E+###' */
2328
2328
char str_nr[DBL_DIG + 8];
2329
uint str_len= sprintf(str_nr, "%g", nr);
2329
uint32_t str_len= sprintf(str_nr, "%g", nr);
2330
2330
make_truncated_value_warning(thd, level, str_nr, str_len, ts_type,