From 82d8a99c057f51b72a1b0a0a386ef69209947b9c Mon Sep 17 00:00:00 2001 From: "cmiller@zippy.cornsilk.net" <> Date: Thu, 10 Apr 2008 15:55:37 -0400 Subject: [PATCH] Fix mismerge. --- sql/field.cc | 2 +- sql/item_create.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/field.cc b/sql/field.cc index 91f356988e4..18bb7153060 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -8615,7 +8615,7 @@ bool create_field::init(THD *thd, char *fld_name, enum_field_types fld_type, and 19 as length of 4.1 compatible representation. Silently shrink it to MAX_DATETIME_COMPRESSED_WIDTH. */ - DBUG_ASSERT(MAX_DATETIME_COMPRESSED_WIDTH < UINT_MAX); + DBUG_ASSERT(MAX_DATETIME_COMPRESSED_WIDTH < UINT_MAX); if (length != UINT_MAX) /* avoid overflow; is safe because of min() */ length= ((length+1)/2)*2; length= min(length, MAX_DATETIME_COMPRESSED_WIDTH); diff --git a/sql/item_create.cc b/sql/item_create.cc index 6f3608b6b9a..c897b7aef79 100644 --- a/sql/item_create.cc +++ b/sql/item_create.cc @@ -531,7 +531,7 @@ Item *create_func_cast(Item *a, Cast_target cast_type, ulong decoded_size; errno= 0; decoded_size= strtoul(c_len, NULL, 10); - if (errno != 0) + if ((errno != 0) || (decoded_size > MAX_FIELD_BLOBLENGTH)) { my_error(ER_TOO_BIG_DISPLAYWIDTH, MYF(0), "cast as char", MAX_FIELD_BLOBLENGTH); return NULL;