Bug report #14999
Spatialite provider does not support alphanumeric primary keys
|Affected QGIS version:||2.14.3||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||duplicate|
|Crashes QGIS or corrupts data:||No|
I'm using QGIS 2.14 Essen on a Windows 7 machine (specifically 2.14.3). If I connect to a Spatialite database, add a layer to my layers panel, and open the attribute table of the layer, QGIS populates all the cell values with the word ERROR. If I sort the table, QGIS populates all the cells with the values of one record.
1. If I use the Identify Feature tool, I can click on a feature and successfully view its attributes
2. If I use the Database Manager, I can view the entire table and it renders perfectly
3. If I use another program (Spatialite GUI, ArcGIS) I can see the attributes just fine
4. If I use an older version of QGIS - 2.8 Wien - the error doesn't occur
I've noticed that this only happens when a layer's unique ID is a text value that contains alpha characters. If the layer has an integer ID, or has a text ID where all the characters are numeric, the error doesn't occur. But this shouldn't be happening - all of the layers have a unique rowid integer column that Spatialite/SQLite creates by default, and if the attribute table viewer needs a unique numeric id to function it should look at that rowid column.
Sample database file is attached. Train station layer fails (text id, mix of alpha and numeric). Subway station layer partially fails (text id, ids that are numeric work, alpha and numeric fails). Borough layer works fine (text id, all numeric).