From: Date: June 27 2006 8:48pm Subject: bk commit into 5.1 tree (jani:1.2224) BUG#20208 List-Archive: http://lists.mysql.com/commits/8347 X-Bug: 20208 Message-Id: <20060627184850.9E18A1EFA2F@a80-186-41-201.elisa-laajakaista.fi> Below is the list of changes that have just been committed into a local 5.1 repository of jani. When jani 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 1.2224 06/06/27 21:48:41 jani@stripped +3 -0 Fix for bug#20208 "Blobs greater than 8K are being truncated to 8K" sql/item.h 1.204 06/06/27 21:48:34 jani@stripped +1 -0 Made a function of a piece of code that will be used in two places. sql/item.cc 1.196 06/06/27 21:48:34 jani@stripped +8 -3 Fix for Bug#20208. This will avoid sending out FIELD_TYPE_VARCHAR when the length can be larger than varchar can contain. include/mysql_com.h 1.109 06/06/27 21:48:34 jani@stripped +7 -7 Changed default value for MAX_BLOB_WIDTH. Increased the default width for blob. # 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: jani # Host: ua141d10.elisa.omakaista.fi # Root: /home/my/bk/mysql-5.1 --- 1.108/include/mysql_com.h 2006-06-14 12:07:41 +03:00 +++ 1.109/include/mysql_com.h 2006-06-27 21:48:34 +03:00 @@ -172,13 +172,13 @@ struct st_vio; /* Only C */ typedef struct st_vio Vio; -#define MAX_TINYINT_WIDTH 3 /* Max width for a TINY w.o. sign */ -#define MAX_SMALLINT_WIDTH 5 /* Max width for a SHORT w.o. sign */ -#define MAX_MEDIUMINT_WIDTH 8 /* Max width for a INT24 w.o. sign */ -#define MAX_INT_WIDTH 10 /* Max width for a LONG w.o. sign */ -#define MAX_BIGINT_WIDTH 20 /* Max width for a LONGLONG */ -#define MAX_CHAR_WIDTH 255 /* Max length for a CHAR colum */ -#define MAX_BLOB_WIDTH 8192 /* Default width for blob */ +#define MAX_TINYINT_WIDTH 3 /* Max width for a TINY w.o. sign */ +#define MAX_SMALLINT_WIDTH 5 /* Max width for a SHORT w.o. sign */ +#define MAX_MEDIUMINT_WIDTH 8 /* Max width for a INT24 w.o. sign */ +#define MAX_INT_WIDTH 10 /* Max width for a LONG w.o. sign */ +#define MAX_BIGINT_WIDTH 20 /* Max width for a LONGLONG */ +#define MAX_CHAR_WIDTH 255 /* Max length for a CHAR colum */ +#define MAX_BLOB_WIDTH 16777216 /* Default width for blob */ typedef struct st_net { #if !defined(CHECK_EMBEDDED_DIFFERENCES) || !defined(EMBEDDED_LIBRARY) --- 1.195/sql/item.cc 2006-06-16 13:16:58 +03:00 +++ 1.196/sql/item.cc 2006-06-27 21:48:34 +03:00 @@ -3878,21 +3878,26 @@ } -void Item_empty_string::make_field(Send_field *tmp_field) +enum_field_types Item::string_field_type() const { enum_field_types type= FIELD_TYPE_VAR_STRING; if (max_length >= 16777216) type= FIELD_TYPE_LONG_BLOB; else if (max_length >= 65536) type= FIELD_TYPE_MEDIUM_BLOB; - init_make_field(tmp_field, type); + return type; +} + +void Item_empty_string::make_field(Send_field *tmp_field) +{ + init_make_field(tmp_field, string_field_type()); } enum_field_types Item::field_type() const { switch (result_type()) { - case STRING_RESULT: return MYSQL_TYPE_VARCHAR; + case STRING_RESULT: return string_field_type(); case INT_RESULT: return FIELD_TYPE_LONGLONG; case DECIMAL_RESULT: return FIELD_TYPE_NEWDECIMAL; case REAL_RESULT: return FIELD_TYPE_DOUBLE; --- 1.203/sql/item.h 2006-06-18 13:20:27 +03:00 +++ 1.204/sql/item.h 2006-06-27 21:48:34 +03:00 @@ -537,6 +537,7 @@ virtual Item_result result_type() const { return REAL_RESULT; } virtual Item_result cast_to_int_type() const { return result_type(); } virtual enum_field_types field_type() const; + virtual enum_field_types string_field_type() const; virtual enum Type type() const =0; /*