This patch adds a regression test for the bug with domains and ALTERTABLE that Tom fixed a few hours ago.
Barring any objections I'll apply this to HEAD by the end of the day.
-Neil