diff options
author | unknown <cmiller@zippy.cornsilk.net> | 2007-08-31 15:24:43 -0400 |
---|---|---|
committer | unknown <cmiller@zippy.cornsilk.net> | 2007-08-31 15:24:43 -0400 |
commit | 13fea36d03529eefceadaa16b8a9d1faf3802eed (patch) | |
tree | a4312c3393e59c7c903a284b76a49c01dcd7bdc4 /sql/unireg.h | |
parent | 898333f843b5c750b9863ea94d60ab81a9caca4e (diff) | |
download | mariadb-git-13fea36d03529eefceadaa16b8a9d1faf3802eed.tar.gz |
Bug#15776: 32-bit signed int used for length of blob
Based on contributed patch from Martin Friebe, CLA from 2007-02-24.
The parser lacked support for field sizes after signed long,
when it should extend to 2**32-1.
Now, we correct that limitation, and also make the error handling
consistent for casts.
mysql-test/r/type_blob.result:
Verify that blobs may be created with the size that is already
documented.
Additionally, test the limits of several other types.
mysql-test/t/type_blob.test:
Verify that blobs may be created with the size that is already
documented.
Additionally, test the limits of several other types.
sql/field.cc:
atoi() insufficient to gauge the length of some fields. Change
it to strtoul().
sql/item_create.cc:
atoi() insufficient to gauge the length of some fields. Change
it to strtoul().
If a casted length is too long, raise an error.
sql/share/errmsg.txt:
Change ER_TOO_BIG_FIELDLENGTH so that it can accept sizes larger
than 2**15 -- instead, 2**32.
sql/sql_yacc.yy:
Make lengths take, in addition to NUM, LONG_NUM, ULONGLONG_NUM,
and DECIMAL_NUM.
sql/unireg.h:
Define new constant.
Diffstat (limited to 'sql/unireg.h')
-rw-r--r-- | sql/unireg.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/unireg.h b/sql/unireg.h index 81ca18c1d32..0ab2a40048b 100644 --- a/sql/unireg.h +++ b/sql/unireg.h @@ -60,6 +60,7 @@ #define MAX_MBWIDTH 3 /* Max multibyte sequence */ #define MAX_FIELD_CHARLENGTH 255 #define MAX_FIELD_VARCHARLENGTH 65535 +#define MAX_FIELD_BLOBLENGTH UINT_MAX #define CONVERT_IF_BIGGER_TO_BLOB 512 /* Used for CREATE ... SELECT */ /* Max column width +1 */ |