From a21cd97c3506a70297afc3dd3f64cdfd2dc0a4e6 Mon Sep 17 00:00:00 2001
From: Georgi Kodinov <joro@sun.com>
Date: Fri, 20 Nov 2009 12:10:47 +0200
Subject: Bug #45261 : Crash, stored procedure + decimal Bug #48370  Absolutely
 wrong calculations with GROUP BY and   decimal fields when using IF

Added the test cases in the above two bugs for regression
testing.
Added additional tests that demonstrate a incomplete fix.
Added a new factory method for Field_new_decimal to
create a field from an (decimal returning) Item.
In the new method made sure that all the precision and
length variables are capped in a proper way.
This is required because Item's can have larger precision
than the decimal fields and thus need to be capped when
creating a field based on an Item type.
Fixed the wrong typecast to Item_decimal.
---
 sql/field.h | 1 +
 1 file changed, 1 insertion(+)

(limited to 'sql/field.h')

diff --git a/sql/field.h b/sql/field.h
index 784b9133790..ae074cc1a30 100644
--- a/sql/field.h
+++ b/sql/field.h
@@ -807,6 +807,7 @@ public:
   uint is_equal(Create_field *new_field);
   virtual const uchar *unpack(uchar* to, const uchar *from,
                               uint param_data, bool low_byte_first);
+  static Field *create_from_item (Item *);
 };
 
 
-- 
cgit v1.2.1