Commit c72c3e4c authored by unknown's avatar unknown

Merge mysql.com:/home/jimw/my/mysql-5.0-10590

into  mysql.com:/home/jimw/my/mysql-5.0-clean


sql/item_timefunc.cc:
  Auto merged
parents 48078eea af8cbbae
...@@ -688,3 +688,6 @@ id select_type table type possible_keys key key_len ref rows Extra ...@@ -688,3 +688,6 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings: Warnings:
Note 1003 select timestamp_diff(WEEK,_latin1'2001-02-01',_latin1'2001-05-01') AS `a1`,timestamp_diff(SECOND_FRAC,_latin1'2001-02-01 12:59:59.120000',_latin1'2001-05-01 12:58:58.119999') AS `a2` Note 1003 select timestamp_diff(WEEK,_latin1'2001-02-01',_latin1'2001-05-01') AS `a1`,timestamp_diff(SECOND_FRAC,_latin1'2001-02-01 12:59:59.120000',_latin1'2001-05-01 12:58:58.119999') AS `a2`
select time_format('100:00:00', '%H %k %h %I %l');
time_format('100:00:00', '%H %k %h %I %l')
100 100 04 04 4
...@@ -336,3 +336,9 @@ DROP TABLE t1; ...@@ -336,3 +336,9 @@ DROP TABLE t1;
explain extended select timestampdiff(SQL_TSI_WEEK, '2001-02-01', '2001-05-01') as a1, explain extended select timestampdiff(SQL_TSI_WEEK, '2001-02-01', '2001-05-01') as a1,
timestampdiff(SQL_TSI_FRAC_SECOND, '2001-02-01 12:59:59.120000', '2001-05-01 12:58:58.119999') as a2; timestampdiff(SQL_TSI_FRAC_SECOND, '2001-02-01 12:59:59.120000', '2001-05-01 12:58:58.119999') as a2;
#
# Bug #10590: %h, %I, and %l format specifies should all return results in
# the 0-11 range
#
select time_format('100:00:00', '%H %k %h %I %l');
...@@ -499,7 +499,6 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time, ...@@ -499,7 +499,6 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time,
timestamp_type type, String *str) timestamp_type type, String *str)
{ {
char intbuff[15]; char intbuff[15];
uint days_i;
uint hours_i; uint hours_i;
uint weekday; uint weekday;
ulong length; ulong length;
...@@ -602,8 +601,7 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time, ...@@ -602,8 +601,7 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time,
break; break;
case 'h': case 'h':
case 'I': case 'I':
days_i= l_time->hour/24; hours_i= (l_time->hour%24 + 11)%12+1;
hours_i= (l_time->hour%24 + 11)%12+1 + 24*days_i;
length= int10_to_str(hours_i, intbuff, 10) - intbuff; length= int10_to_str(hours_i, intbuff, 10) - intbuff;
str->append_with_prefill(intbuff, length, 2, '0'); str->append_with_prefill(intbuff, length, 2, '0');
break; break;
...@@ -624,8 +622,7 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time, ...@@ -624,8 +622,7 @@ bool make_date_time(DATE_TIME_FORMAT *format, TIME *l_time,
str->append_with_prefill(intbuff, length, 1, '0'); str->append_with_prefill(intbuff, length, 1, '0');
break; break;
case 'l': case 'l':
days_i= l_time->hour/24; hours_i= (l_time->hour%24 + 11)%12+1;
hours_i= (l_time->hour%24 + 11)%12+1 + 24*days_i;
length= int10_to_str(hours_i, intbuff, 10) - intbuff; length= int10_to_str(hours_i, intbuff, 10) - intbuff;
str->append_with_prefill(intbuff, length, 1, '0'); str->append_with_prefill(intbuff, length, 1, '0');
break; break;
......
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