diff options
author | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2011-03-15 16:56:11 +0200 |
---|---|---|
committer | Georgi Kodinov <Georgi.Kodinov@Oracle.com> | 2011-03-15 16:56:11 +0200 |
commit | bcbce343dd3d30b8ab1554710d4d62fa564e6b9a (patch) | |
tree | 496176916dabe63379a258a91d4b74477b12dc00 /sql/item_timefunc.cc | |
parent | 5ba700c3465d6db8e229e1cd98efcae3e93377fc (diff) | |
parent | 405f7ca69a36a2b2d7b02bdb945f1e6879c5aaea (diff) | |
download | mariadb-git-bcbce343dd3d30b8ab1554710d4d62fa564e6b9a.tar.gz |
auto-merge
Diffstat (limited to 'sql/item_timefunc.cc')
-rw-r--r-- | sql/item_timefunc.cc | 13 |
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))) |