spaccabit/spatialite-android

Database.exec(...) crashes on bad SQL

Closed this issue · 3 comments

What steps will reproduce the problem?
1. make invalid SQL statement
2. try to execute it in db.exec(invalidSqlStr, new Callback() {...} );
3. wrap it in try{ } catch {Exception e}

What is the expected output? What do you see instead?
exception should be thrown; instead process crashes. Sometimes very silently, 
so I couldn't pinpoint the reason for some time.

What version of the product are you using? On what operating system?
b247b2ca607c Android 2.3.3 device and emulator

Please provide any additional information below.
attached diff adds junit test case to show the issue (I hope I created it 
properly, I've no experience with diff).

Original issue reported on code.google.com by mateuszz...@gmail.com on 18 Mar 2012 at 9:21

Attachments:

Original comment by efroh...@gmail.com on 18 Mar 2012 at 1:37

  • Changed state: Accepted
It appears that even valid SQL seems to cause a crash.  I tried the following 
string with no luck.

"INSERT INTO test (num, value) VALUES (3,5);"

Original comment by efroh...@gmail.com on 31 Mar 2012 at 7:38

Issues resolved and changes have been commited.  Tests cases have been updated.

Original comment by efroh...@gmail.com on 1 Apr 2012 at 11:32

  • Changed state: Fixed