Fixes  Bug 1007242 - corrected SQL parameters & added get_raw_crash test

Adrian was quite correct, that SQL statement could never have worked and a unit test would have discovered that flaw.  I offer the correction.