strict mode compatibility
fix primary/standby db detection
Merge pull request #235 from will123195/3.0

fix db/dbw detection