fixed mysql script for SR; more consistent use of version variables