Hi, Roberto!You are wrong, with UDF function result type known because then goes something like:at "value" parameter, COLUMN_CREATE know that we are using a STRING, but should be any other data type
The *|as type|* part allows one to specify the value type. In most cases, this is redundant because MariaDB will be able to deduce the type of the value. Explicit type specification may be needed when the type of the value is not apparent. For example, a literal |'2012-12-01'| has a CHAR type by default, one will need to specify|'2012-12-01' AS DATE| to have it stored as a date. See the Datatypes <https://mariadb.com/kb/en/mariadb/dynamic-columns/#Datatypes> section for further details.
mysql>*|CREATE FUNCTION metaphon RETURNS STRING SONAME 'udf_example.so';|*
mysql>*|CREATE FUNCTION myfunc_double RETURNS REAL SONAME 'udf_example.so';|*
mysql>*|CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME 'udf_example.so';|*
( http://dev.mysql.com/doc/refman/5.1/en/udf-compiling.html )
Type just have to be sent to the client. Some functions required argument of certain type so ask correcpondent val*() method of Item object but top most function (or constant or field) determinate type of the column in SELECT list and the type should be known.
So previous statement about 3rd column was very precise.