summaryrefslogtreecommitdiff
path: root/sql/item_create.cc
diff options
context:
space:
mode:
authorigor@olga.mysql.com <>2007-07-07 20:03:00 -0700
committerigor@olga.mysql.com <>2007-07-07 20:03:00 -0700
commit4d8e0fb50a4b05db02522c7c094f89118ed795d1 (patch)
tree17758f1a7ba2ecd996b85e0984b32090cd88e27e /sql/item_create.cc
parente06c67443dd3875d16ae479e34f78e55f83f92d4 (diff)
downloadmariadb-git-4d8e0fb50a4b05db02522c7c094f89118ed795d1.tar.gz
Post-merge fix.
Diffstat (limited to 'sql/item_create.cc')
-rw-r--r--sql/item_create.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc
index 20041b1176a..e20926c564f 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -5039,6 +5039,18 @@ create_func_cast(THD *thd, Item *a, Cast_target cast_type,
my_error(ER_M_BIGGER_THAN_D, MYF(0), "");
return 0;
}
+ if (len > DECIMAL_MAX_PRECISION)
+ {
+ my_error(ER_TOO_BIG_PRECISION, MYF(0), len, a->name,
+ DECIMAL_MAX_PRECISION);
+ return 0;
+ }
+ if (dec > DECIMAL_MAX_SCALE)
+ {
+ my_error(ER_TOO_BIG_SCALE, MYF(0), dec, a->name,
+ DECIMAL_MAX_SCALE);
+ return 0;
+ }
res= new (thd->mem_root) Item_decimal_typecast(a, len, dec);
break;
}