by Tim Hunt.
You need to make sure that you Moodle 1.9 database structure is correct before you start the upgrade. You need to create any missing tables. Probably the easest way to do that is:
- Make a new install fo Moodle 1.9.7 somewhere (on any old computer).
- Look at the definition of the question_match_sub table in that database.
- Manually create a table exactly like that in your real Moodle database.
- Try the upgrade again.