.Added mysql specific error detection to return.