test to ensure bad prepared statements raise a StatementInvalid exception
translate exceptions on prepared statement failure
fix exception translation
Merge branch 'master' into adequaterecord

* master:
  fix exception translation
  translate exceptions on prepared statement failure
  test to ensure bad prepared statements raise a StatementInvalid exception