Commit 68391ace authored by Sergei Golubchik's avatar Sergei Golubchik

fix for x86 and other 32-bit little engian arch

(and for 64-bit big endian)
parent 45755c4e
...@@ -68,71 +68,71 @@ int append_interval(String *str, interval_type int_type, const INTERVAL &interva ...@@ -68,71 +68,71 @@ int append_interval(String *str, interval_type int_type, const INTERVAL &interva
size_t len; size_t len;
switch (int_type) { switch (int_type) {
case INTERVAL_YEAR: case INTERVAL_YEAR:
len= my_snprintf(buf,sizeof(buf),"%u", interval.year); len= my_snprintf(buf,sizeof(buf),"%lu", interval.year);
break; break;
case INTERVAL_QUARTER: case INTERVAL_QUARTER:
case INTERVAL_MONTH: case INTERVAL_MONTH:
len= my_snprintf(buf,sizeof(buf),"%u", interval.month); len= my_snprintf(buf,sizeof(buf),"%lu", interval.month);
int_type=INTERVAL_MONTH; int_type=INTERVAL_MONTH;
break; break;
case INTERVAL_WEEK: case INTERVAL_WEEK:
case INTERVAL_DAY: case INTERVAL_DAY:
len= my_snprintf(buf,sizeof(buf),"%u", interval.day); len= my_snprintf(buf,sizeof(buf),"%lu", interval.day);
int_type=INTERVAL_DAY; int_type=INTERVAL_DAY;
break; break;
case INTERVAL_HOUR: case INTERVAL_HOUR:
len= my_snprintf(buf,sizeof(buf),"%u", interval.hour); len= my_snprintf(buf,sizeof(buf),"%lu", interval.hour);
break; break;
case INTERVAL_MINUTE: case INTERVAL_MINUTE:
len= my_snprintf(buf,sizeof(buf),"%u", interval.minute); len= my_snprintf(buf,sizeof(buf),"%llu", interval.minute);
break; break;
case INTERVAL_SECOND: case INTERVAL_SECOND:
len= my_snprintf(buf,sizeof(buf),"%u", interval.second); len= my_snprintf(buf,sizeof(buf),"%llu", interval.second);
break; break;
case INTERVAL_MICROSECOND: case INTERVAL_MICROSECOND:
len= my_snprintf(buf,sizeof(buf),"%u", interval.second_part); len= my_snprintf(buf,sizeof(buf),"%llu", interval.second_part);
break; break;
case INTERVAL_YEAR_MONTH: case INTERVAL_YEAR_MONTH:
len= my_snprintf(buf,sizeof(buf),"'%u-%02u'", len= my_snprintf(buf,sizeof(buf),"'%lu-%02lu'",
interval.year, interval.month); interval.year, interval.month);
break; break;
case INTERVAL_DAY_HOUR: case INTERVAL_DAY_HOUR:
len= my_snprintf(buf,sizeof(buf),"'%u %u'", interval.day, interval.hour); len= my_snprintf(buf,sizeof(buf),"'%lu %lu'", interval.day, interval.hour);
break; break;
case INTERVAL_DAY_MINUTE: case INTERVAL_DAY_MINUTE:
len= my_snprintf(buf,sizeof(buf),"'%u %u:%02u'", len= my_snprintf(buf,sizeof(buf),"'%lu %lu:%02llu'",
interval.day, interval.hour, interval.minute); interval.day, interval.hour, interval.minute);
break; break;
case INTERVAL_DAY_SECOND: case INTERVAL_DAY_SECOND:
len= my_snprintf(buf,sizeof(buf),"'%u %u:%02u:%02u'", len= my_snprintf(buf,sizeof(buf),"'%lu %lu:%02llu:%02llu'",
interval.day, interval.hour, interval.minute, interval.second); interval.day, interval.hour, interval.minute, interval.second);
break; break;
case INTERVAL_HOUR_MINUTE: case INTERVAL_HOUR_MINUTE:
len= my_snprintf(buf,sizeof(buf),"'%u:%02u'", interval.hour, interval.minute); len= my_snprintf(buf,sizeof(buf),"'%lu:%02llu'", interval.hour, interval.minute);
break; break;
case INTERVAL_HOUR_SECOND: case INTERVAL_HOUR_SECOND:
len= my_snprintf(buf,sizeof(buf),"'%u:%02u:%02u'", len= my_snprintf(buf,sizeof(buf),"'%lu:%02llu:%02llu'",
interval.hour, interval.minute, interval.second); interval.hour, interval.minute, interval.second);
break; break;
case INTERVAL_MINUTE_SECOND: case INTERVAL_MINUTE_SECOND:
len= my_snprintf(buf,sizeof(buf),"'%u:%02u'", interval.minute, interval.second); len= my_snprintf(buf,sizeof(buf),"'%llu:%02llu'", interval.minute, interval.second);
break; break;
case INTERVAL_DAY_MICROSECOND: case INTERVAL_DAY_MICROSECOND:
len= my_snprintf(buf,sizeof(buf),"'%u %u:%02u:%02u.%06u'", len= my_snprintf(buf,sizeof(buf),"'%lu %lu:%02llu:%02llu.%06llu'",
interval.day, interval.hour, interval.minute, interval.day, interval.hour, interval.minute,
interval.second, interval.second_part); interval.second, interval.second_part);
break; break;
case INTERVAL_HOUR_MICROSECOND: case INTERVAL_HOUR_MICROSECOND:
len= my_snprintf(buf,sizeof(buf),"'%u:%02u:%02u.%06u'", len= my_snprintf(buf,sizeof(buf),"'%lu:%02llu:%02llu.%06llu'",
interval.hour, interval.minute, interval.second, interval.hour, interval.minute, interval.second,
interval.second_part); interval.second_part);
break; break;
case INTERVAL_MINUTE_MICROSECOND: case INTERVAL_MINUTE_MICROSECOND:
len= my_snprintf(buf,sizeof(buf),"'%u:%02u.%06u'", len= my_snprintf(buf,sizeof(buf),"'%llu:%02llu.%06llu'",
interval.minute, interval.second, interval.second_part); interval.minute, interval.second, interval.second_part);
break; break;
case INTERVAL_SECOND_MICROSECOND: case INTERVAL_SECOND_MICROSECOND:
len= my_snprintf(buf,sizeof(buf),"%u.%06u", interval.second, interval.second_part); len= my_snprintf(buf,sizeof(buf),"%llu.%06llu", interval.second, interval.second_part);
break; break;
default: default:
DBUG_ASSERT(0); DBUG_ASSERT(0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment