SQL: fewer exceptions for UPGRADING and stricter variable check
SQL: fewer exceptions for UPGRADING and stricter variable check

Using isset() to avoid warnings. Being more consistent in behaviour
here reduces the weird edge cases that might occur during upgrade tasks.

xenocrat/chyrp-lite,xenocrat/chyrp-lite