~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/item_timefunc.cc

  • Committer: Brian Aker
  • Date: 2008-07-13 22:21:51 UTC
  • Revision ID: brian@tangent.org-20080713222151-fv2tcpbsc829j2oc
Ulonglong to uint64_t

Show diffs side-by-side

added added

removed removed

Lines of Context:
199
199
  else if (seconds > 3020399)
200
200
    goto overflow;
201
201
  
202
 
  sec= (uint) ((ulonglong) seconds % 3600);
 
202
  sec= (uint) ((uint64_t) seconds % 3600);
203
203
  ltime->hour= (uint) (seconds/3600);
204
204
  ltime->minute= sec/60;
205
205
  ltime->second= sec % 60;
858
858
*/
859
859
 
860
860
static bool get_interval_info(const char *str,uint length,CHARSET_INFO *cs,
861
 
                              uint count, ulonglong *values,
 
861
                              uint count, uint64_t *values,
862
862
                              bool transform_msec)
863
863
{
864
864
  const char *end=str+length;
1295
1295
bool get_interval_value(Item *args,interval_type int_type,
1296
1296
                               String *str_value, INTERVAL *interval)
1297
1297
{
1298
 
  ulonglong array[5];
 
1298
  uint64_t array[5];
1299
1299
  longlong value= 0;
1300
1300
  const char *str= NULL;
1301
1301
  size_t length= 0;
1493
1493
  /* We don't need to set second_part and neg because they already 0 */
1494
1494
  ltime.hour= ltime.minute= ltime.second= 0;
1495
1495
  ltime.time_type= MYSQL_TIMESTAMP_DATE;
1496
 
  value= (longlong) TIME_to_ulonglong_date(&ltime);
 
1496
  value= (longlong) TIME_to_uint64_t_date(&ltime);
1497
1497
}
1498
1498
 
1499
1499
String *Item_func_curdate::val_str(String *str)
1559
1559
  decimals= DATETIME_DEC;
1560
1560
  collation.set(&my_charset_bin);
1561
1561
  store_now_in_TIME(&ltime);
1562
 
  value= TIME_to_ulonglong_time(&ltime);
 
1562
  value= TIME_to_uint64_t_time(&ltime);
1563
1563
  buff_length= (uint) my_time_to_str(&ltime, buff);
1564
1564
  max_length= buff_length;
1565
1565
}
1607
1607
  collation.set(&my_charset_bin);
1608
1608
 
1609
1609
  store_now_in_TIME(&ltime);
1610
 
  value= (longlong) TIME_to_ulonglong_datetime(&ltime);
 
1610
  value= (longlong) TIME_to_uint64_t_datetime(&ltime);
1611
1611
 
1612
1612
  buff_length= (uint) my_datetime_to_str(&ltime, buff);
1613
1613
  max_length= buff_length;
1683
1683
{
1684
1684
  assert(fixed == 1);
1685
1685
  store_now_in_TIME(&ltime);
1686
 
  return (longlong) TIME_to_ulonglong_datetime(&ltime);
 
1686
  return (longlong) TIME_to_uint64_t_datetime(&ltime);
1687
1687
}
1688
1688
 
1689
1689
 
1691
1691
{
1692
1692
  assert(fixed == 1);
1693
1693
  store_now_in_TIME(&ltime);
1694
 
  return ulonglong2double(TIME_to_ulonglong_datetime(&ltime));
 
1694
  return uint64_t2double(TIME_to_uint64_t_datetime(&ltime));
1695
1695
}
1696
1696
 
1697
1697
 
1985
1985
  if (get_date(&time_tmp, 0))
1986
1986
    return 0;
1987
1987
 
1988
 
  return (longlong) TIME_to_ulonglong_datetime(&time_tmp);
 
1988
  return (longlong) TIME_to_uint64_t_datetime(&time_tmp);
1989
1989
}
1990
1990
 
1991
1991
bool Item_func_from_unixtime::get_date(MYSQL_TIME *ltime,
1992
1992
                                       uint fuzzy_date __attribute__((unused)))
1993
1993
{
1994
 
  ulonglong tmp= (ulonglong)(args[0]->val_int());
 
1994
  uint64_t tmp= (uint64_t)(args[0]->val_int());
1995
1995
  /*
1996
1996
    "tmp > TIMESTAMP_MAX_VALUE" check also covers case of negative
1997
1997
    from_unixtime() argument since tmp is unsigned.
2300
2300
    char buffer[20];
2301
2301
    // my_charset_bin is good enough for numbers
2302
2302
    String st(buffer, sizeof(buffer), &my_charset_bin);
2303
 
    st.set((ulonglong)cast_length, &my_charset_bin);
 
2303
    st.set((uint64_t)cast_length, &my_charset_bin);
2304
2304
    str->append(st);
2305
2305
    str->append(')');
2306
2306
  }
2449
2449
    return 0;
2450
2450
  }
2451
2451
 
2452
 
  return TIME_to_ulonglong_datetime(&ltime);
 
2452
  return TIME_to_uint64_t_datetime(&ltime);
2453
2453
}
2454
2454
 
2455
2455