DOUBLE typecast was not supported and the failure detection caused a
crash.
This patch adds support for DOUBLE typecast and fixes the crash caused
when a non-supported function is detected as part of an arithmatic.
Datetime has internal int value which is very different to MySQL's int
value. This patch differentiates between the two and also fixes a column
width issue which appeared once the datetime handling was fixed.