31
31
/* Position for YYYY-DD-MM HH-MM-DD.FFFFFF AM in default format */
33
static uchar internal_format_positions[]=
34
{0, 1, 2, 3, 4, 5, 6, (uchar) 255};
33
static unsigned char internal_format_positions[]=
34
{0, 1, 2, 3, 4, 5, 6, (unsigned char) 255};
36
36
static char time_separator=':';
38
38
static uint32_t const days_at_timestart=719528; /* daynr at 1970.01.01 */
39
uchar days_in_month[]= {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 0};
39
unsigned char days_in_month[]= {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 0};
42
42
Offset of system time zone from UTC in seconds used to speed up
166
166
bool is_internal_format;
167
167
const char *pos, *last_field_pos=NULL;
168
168
const char *end=str+length;
169
const uchar *format_position;
169
const unsigned char *format_position;
170
170
bool found_delimitier= 0, found_space= 0;
171
171
uint frac_pos, frac_len;
258
258
const char *start= str;
259
uint32_t tmp_value= (uint) (uchar) (*str++ - '0');
259
uint32_t tmp_value= (uint) (unsigned char) (*str++ - '0');
260
260
while (str != end && my_isdigit(&my_charset_utf8_general_ci,str[0]) &&
261
261
(!is_internal_format || --field_length))
263
tmp_value=tmp_value*10 + (uint32_t) (uchar) (*str - '0');
263
tmp_value=tmp_value*10 + (uint32_t) (unsigned char) (*str - '0');
266
266
date_len[i]= (uint) (str - start);
558
558
/* Fix the date to assume that seconds was given */
559
559
if (!found_hours && !found_days)
561
bmove_upp((uchar*) (date+4), (uchar*) (date+state),
561
bmove_upp((unsigned char*) (date+4), (unsigned char*) (date+state),
562
562
sizeof(long)*(state-1));
563
563
memset(date, 0, sizeof(long)*(4-state));
571
571
if ((end-str) >= 2 && *str == '.' && my_isdigit(&my_charset_utf8_general_ci,str[1]))
573
573
int field_length= 5;
574
str++; value=(uint) (uchar) (*str - '0');
574
str++; value=(uint) (unsigned char) (*str - '0');
575
575
while (++str != end && my_isdigit(&my_charset_utf8_general_ci, *str))
577
577
if (field_length-- > 0)
578
value= value*10 + (uint) (uchar) (*str - '0');
578
value= value*10 + (uint) (unsigned char) (*str - '0');
580
580
if (field_length > 0)
581
581
value*= (long) log_10_int[field_length];