diff options
author | Oystein Grovlen <oystein.grovlen@oracle.com> | 2011-01-12 11:27:31 +0100 |
---|---|---|
committer | Oystein Grovlen <oystein.grovlen@oracle.com> | 2011-01-12 11:27:31 +0100 |
commit | a648063319ad782c4845fc95d3ae9f20d5e3088c (patch) | |
tree | 3d3660184c4d2907cdd9c1985a9fd0183f10ba48 /sql/item_cmpfunc.cc | |
parent | c04979b84127ef8aa435368d1281bfb4322e0054 (diff) | |
parent | 541e0fa8bf7ffaf7f443cdc2cc69721032aeefcf (diff) | |
download | mariadb-git-a648063319ad782c4845fc95d3ae9f20d5e3088c.tar.gz |
Merge fix for Bug#59211 to mysql-5.5-security
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r-- | sql/item_cmpfunc.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc index fe8ff3a74d0..0e989b310fa 100644 --- a/sql/item_cmpfunc.cc +++ b/sql/item_cmpfunc.cc @@ -1208,9 +1208,12 @@ get_year_value(THD *thd, Item ***item_arg, Item **cache_arg, value of 2000. */ Item *real_item= item->real_item(); - if (!(real_item->type() == Item::FIELD_ITEM && - ((Item_field *)real_item)->field->type() == MYSQL_TYPE_YEAR && - ((Item_field *)real_item)->field->field_length == 4)) + Field *field= NULL; + if (real_item->type() == Item::FIELD_ITEM) + field= ((Item_field *)real_item)->field; + else if (real_item->type() == Item::CACHE_ITEM) + field= ((Item_cache *)real_item)->field(); + if (!(field && field->type() == MYSQL_TYPE_YEAR && field->field_length == 4)) { if (value < 70) value+= 100; |