sqlcipher/android-database-sqlcipher

Inconsistent error messages

Closed this issue · 5 comments

As reproduced in sqlcipher/sqlcipher-android-tests#16:

While a constraint exception is reported with a correct error message such as: error code 19: UNIQUE constraint failed: tt.a

some other errors are reported with error messages with no error code and obviously some information missing, for example:

  • near "SLCT": syntax error: , while compiling: SLCT 1"
  • no such function: UPER: , while compiling: SELECT UPER('Test')

Just like #295 this was fixed in AOSP several years ago. Again I am not sure how easy it is to incorporate these fixes due to the divergence in code.

Hi @brodybits

While I understand the is no error code present in your two examples, both examples provide error messages that direct the developer to the issue at hand. Do you feel the error messages are not helpful, or just advocating for an error number with the message?

I renamed this issue to a hopefully more accurate title.

I would definitely agree with you that in the cases discussed here and covered in sqlcipher/sqlcipher-android-tests#16 the error messages do provide the needed information to the developer to diagnose the "issue at hand". But I wanted to cover a couple things:

I would like to see automatic testing to verify the information that is actually reported, or at least the most important information. This is what I had wanted to contribute in sqlcipher/sqlcipher-android-tests#16, at least to a partial extent. I hope it was clear that sqlcipher/sqlcipher-android-tests#16 is there to verify current existing behavior and provide a starting point to verify the changes in case the error code may be included for certain other cases in the future.

What drove this was that a major user had reported a "meaningless error messages" issue (storesafe/cordova-sqlite-storage#366) on my sqlite plugin (without sqlcipher). I did some further testing last fall to verify that this would not be a problem again. This is how I had discovered the error message inconsistencies reported here.

I think it is also evident that the inconsistent error messages with the ugly : , while compiling pattern is due to the divergence between android-database-sqlcipher and the newer AOSP android.database.sqlite implementation.

I can definitely understand that cleaning up error messages and dealing with the divergence may not be so important in the foreseeable future. For now is there any reason not to include the test cases I contributed in sqlcipher/sqlcipher-android-tests#16?

Hi @brodybits

I'm just circling back to this specific Github issue. Is there a specific issue that remains such that we should keep this specific issue open? We have since merged in your sqlcipher/sqlcipher-android-tests#16 with the test suite. Thanks!

Thanks for merging sqlcipher/sqlcipher-android-tests#16, closing on my part.

👍 Thanks @brodybits!