String name = functionName.toLowerCase();
SQLFunction userFunction = (SQLFunction) userFunctions.get( name );
return userFunction!=null?userFunction:(SQLFunction) dialect.getFunctions().get(name); // TODO: lowercasing done here. Was done "at random" before; maybe not needed at all ?