Fix table join (fixes #7068)
refresh field names after encoding is changed (fixes #6840)