summaryrefslogtreecommitdiff
path: root/sql/item_timefunc.cc
diff options
context:
space:
mode:
authorGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2011-03-15 16:56:11 +0200
committerGeorgi Kodinov <Georgi.Kodinov@Oracle.com>2011-03-15 16:56:11 +0200
commitace88ca2ddebe2457cfb0b406022bf046c8100f5 (patch)
tree496176916dabe63379a258a91d4b74477b12dc00 /sql/item_timefunc.cc
parent4f786b3efebedaccabba2de90f685c1e019cc02b (diff)
parent7a37a7c0c8dfece51bb7fdcb171d74ab04ef2736 (diff)
downloadmariadb-git-ace88ca2ddebe2457cfb0b406022bf046c8100f5.tar.gz
auto-merge
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r--sql/item_timefunc.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index 99467b7c3fc..d5bde222d4c 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -2524,6 +2524,19 @@ String *Item_char_typecast::val_str(String *str)
String *res;
uint32 length;
+ if (cast_length >= 0 &&
+ ((unsigned) cast_length) > current_thd->variables.max_allowed_packet)
+ {
+ push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_WARN_ALLOWED_PACKET_OVERFLOWED,
+ ER(ER_WARN_ALLOWED_PACKET_OVERFLOWED),
+ cast_cs == &my_charset_bin ?
+ "cast_as_binary" : func_name(),
+ current_thd->variables.max_allowed_packet);
+ null_value= 1;
+ return 0;
+ }
+
if (!charset_conversion)
{
if (!(res= args[0]->val_str(str)))