Fix tests under MySQL (skip self-join on terms table).

Change-Id: I4675324997a02a00384edbdff7f46047e30d9d71
Merge "Fix tests under MySQL (skip self-join on terms table)."