Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query with RENAME breaks on Android 8, 9 and 10, but only with new versions #95

Open
CRTCTY opened this issue Aug 26, 2022 · 1 comment

Comments

@CRTCTY
Copy link

CRTCTY commented Aug 26, 2022

I was tasked with getting an older cordova app to work. It used cordova-sqlite-ext 2.3.0 and worked up until Android 11. After that the DB did not start due to:

java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String io.liteglue.SQLDatabaseHandle.getLastErrorMessage()' on a null object reference

A similar issue exists in the cordova-sqlite-storage repo, it is storesafe/cordova-sqlite-storage#995 and can apparently be solved by updating to a newer version.

I decided to do that and updated to the latest cordova-sqlite-ext version, 6.0.0 and the DB started to work on Android 12 devices. (it seems that any version >= 4.0.0 works).

However, this broke compatibility with Android 8 devices. On those a previously working query:

ALTER TABLE "<name of the table>" RENAME COLUMN <name of the column> TO <new name>;

now fails with a SQLiteException:

(near "COLUMN": syntax error (code 1): , while compiling: ALTER TABLE "<name of the table>" RENAME COLUMN <name of the column> TO <new name>;)

I have not touched this query and it definitely worked fine before updating. The only thing I could find about this up to now was that maybe the RENAME keyword is not supported? Which does not really make sense since it used to work?

@CRTCTY
Copy link
Author

CRTCTY commented Aug 26, 2022

I also managed to recreate the error on a Samsung Galaxy S8 with Android 9.0 and a Samsung Galaxy S9 with Android 10.0.
A Samsung Galaxy S20 with Android 11.0 worked fine.

@CRTCTY CRTCTY changed the title Query with RENAME breaks on Android 8, but only with new versions Query with RENAME breaks on Android 8, 9 and 10, but only with new versions Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant