delimiter |; CREATE FUNCTION `WORKINGDAYS`() RETURNS int(11) NOT DETERMINISTIC CONTAINS SQL SQL SECURITY DEFINER COMMENT '' BEGIN declare x int(11); set x=-1; RETURN x; END | delimiter ;| create view v1 as select 1 as one, WORKINGDAYS() as DAYS; connect (addconroot, localhost, root,,*NO-ONE*); connection addconroot; select column_name from information_schema.columns where table_name='v1' and table_schema='test';