Commit 4cabc608 authored by Sergei Golubchik's avatar Sergei Golubchik

correct temporal fields in max_display_length_for_field()

it's *display length* (a.k.a. field_length)
not storage length (a.k.a. pack_length)
parent d4b1425b
...@@ -98,20 +98,22 @@ max_display_length_for_field(enum_field_types sql_type, unsigned int metadata) ...@@ -98,20 +98,22 @@ max_display_length_for_field(enum_field_types sql_type, unsigned int metadata)
return 3; return 3;
case MYSQL_TYPE_DATE: case MYSQL_TYPE_DATE:
case MYSQL_TYPE_TIME:
return 3; return 3;
case MYSQL_TYPE_TIME:
return MIN_TIME_WIDTH;
case MYSQL_TYPE_TIME2: case MYSQL_TYPE_TIME2:
return max_display_length_for_temporal2_field(MIN_TIME_WIDTH, metadata); return max_display_length_for_temporal2_field(MIN_TIME_WIDTH, metadata);
case MYSQL_TYPE_TIMESTAMP: case MYSQL_TYPE_TIMESTAMP:
return 4; return MAX_DATETIME_WIDTH;
case MYSQL_TYPE_TIMESTAMP2: case MYSQL_TYPE_TIMESTAMP2:
return max_display_length_for_temporal2_field(MAX_DATETIME_WIDTH, metadata); return max_display_length_for_temporal2_field(MAX_DATETIME_WIDTH, metadata);
case MYSQL_TYPE_DATETIME: case MYSQL_TYPE_DATETIME:
return 8; return MAX_DATETIME_WIDTH;
case MYSQL_TYPE_DATETIME2: case MYSQL_TYPE_DATETIME2:
return max_display_length_for_temporal2_field(MAX_DATETIME_WIDTH, metadata); return max_display_length_for_temporal2_field(MAX_DATETIME_WIDTH, metadata);
......
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