Changed view handling for older mysql versions