data type improvements

fix handling of text columns with zero size (select null from ...) and
add case for RAW fields