List:Commits« Previous MessageNext Message »
From:Tatjana A Nuernberg Date:August 10 2006 1:35pm
Subject:bk commit into 4.1 tree (tnurnberg:1.2538) BUG#19844
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of tnurnberg. When tnurnberg does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-08-10 15:35:27+02:00, tnurnberg@stripped +1 -0
  Bug#19844: time_format in Union truncates values
  
  time_format() claimed %H and %k would return at most two digits
  (hours 0-23), but this coincided neither with actual behaviour
  nor with docs.  this is not visible in simple queries; forcing
  a temp-table is probably the easiest way to see this.  adjusted
  the return-length appropriately; the alternative would be to
  adjust the docs to say that behaviour for > 99 hours is undefined.

  sql/item_timefunc.cc@stripped, 2006-08-10 15:35:24+02:00, tnurnberg@stripped +2 -2
    Bug#19844: time_format in Union truncates values
    
    unbreak promises we make about field-length of %H and %k in
    time_format() so they coincide with the actual range rather
    than just 0..23. the docs say we must operate outside that
    range, so we'd better do it right.
    One digit values are padded to two digits with %H, "longer"
    values are handled correctly up to seven digits including
    any sign.
    (clarified comments as per jimw's suggestion.)

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	tnurnberg
# Host:	salvation.intern.azundris.com
# Root:	/home/tnurnberg/work/mysql-4.1-maint-19844

--- 1.106/sql/item_timefunc.cc	2006-08-10 15:35:38 +02:00
+++ 1.107/sql/item_timefunc.cc	2006-08-10 15:35:38 +02:00
@@ -1615,8 +1615,8 @@ uint Item_func_date_format::format_lengt
 	size += 2;
 	break;
       case 'k': /* hour ( 0..23) */
-      case 'H': /* hour (00..23) */
-	size += 7; /* docs guarantee success for > 23, cover full range  */
+      case 'H': /* hour (00..23; value > 23 OK, padding always 2-digit) */
+	size += 7; /* docs allow > 23, range depends on sizeof(unsigned int) */
 	break;
       case 'r': /* time, 12-hour (hh:mm:ss [AP]M) */
 	size += 11;
Thread
bk commit into 4.1 tree (tnurnberg:1.2538) BUG#19844Tatjana A Nuernberg10 Aug