fix append_constant_fields (at least did not work with sqlite)