View Issue Details

IDProjectCategoryView StatusLast Update
0005933SymmetricDSBugpublic2023-07-26 17:53
Reportersymds-tryout Assigned To 
Priorityhigh 
Status acknowledgedResolutionopen 
Product Version3.14.7 
Summary0005933: SqliteDdlReader: Change to pragma table_xinfo not working on Android
DescriptionAs discussed here (https://sourceforge.net/p/symmetricds/discussion/1354726/thread/797ef0e617/ ), the change in commit 729e2e6 in symmetric-db/src/main/java/org/jumpmind/db/platform/sqlite/SqliteDdlReader.java
from table_info to table_xinfo is not working on Android (at least not in the Android Studio's Simluator).

The code excerpt I'm referring to:

public Table readTable(String catalog, String schema, String tableName) {
        Table table = null;
        List<Column> columns = platform.getSqlTemplate().query("pragma table_xinfo(" + quote(tableName) + ")", COLUMN_MAPPER);
        

Returned list is empty for table_xinfo, but is filled when using table_info.

This can be seen during debugging as well as in the database inspector where table_info gives results, and table_xinfo does not.

Tested in Android Studio 2022.2.1 Patch 2 , emulated a Pixel 3 XL with Android Pie (9.0).

After changing from table_xinfo to table_info, application works fine again.
I stumbled upon this problem when updating from SymmetricDS-Android-3.12.9 to 3.14.7.
Steps To ReproduceIn Android Studio, try table_info as well as table_xinfo on a table created from SymmetricDS.
Tagsdialect: android, dialect: sqlite

Activities

symds-tryout

2023-07-23 10:48

reporter   ~0002354

Ticket related to the above mentioned commit: https://www.symmetricds.org/issues/view.php?id=765

symds-tryout

2023-07-23 12:29

reporter   ~0002355

pragma table_xinfo only supported from Sqlite 3.26.0 (https://www.sqlite.org/changes.html )

Therefore only supported from Android API Level 30 (https://developer.android.com/reference/android/database/sqlite/package-summary )
which effectively means Android 11 as a minimum requirement (https://developer.android.com/tools/releases/platforms ).

So using pragma table_xinfo without a version check on Android seems to be a little too optimistic, unless I missed a minimum requirement somewhere.
Personally, I'd prefer to still have Android 9 supported by SymmetricDS.

Issue History

Date Modified Username Field Change
2023-07-23 10:41 symds-tryout New Issue
2023-07-23 10:41 symds-tryout Tag Attached: dialect: android
2023-07-23 10:41 symds-tryout Tag Attached: dialect: sqlite
2023-07-23 10:48 symds-tryout Note Added: 0002354
2023-07-23 12:29 symds-tryout Note Added: 0002355
2023-07-26 17:53 cquamme Status new => acknowledged