Bug report #11498
spatialite layer added via browser lose first field
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||19768|
When loading a spatialite layer using browser (browsing the file, not using the connection) the first field of the table (may be only if it's a pkey) is not shown
#5 Updated by Luca Lanteri almost 6 years ago
- File test.sqlite added
You're right: I try with a brand new DB and it works, but if I use some other DB the problem persists.
I can't understand if it's a SL version problem. All my databases may be: SpatiaLite version 4.1.1
and SQLite version 3.8.2. I'll try to investigate deeper.
I try to attach an example db.
#7 Updated by Luca Lanteri almost 6 years ago
I also view all field if I load it via SL connection (using the "feather" button or browser with SL connection), but If I browse the file system using browser I lose the "gid" field.
I tested it on linux and win7 and QGIS 2.0 and 2.4.
I really not understand how to replicate it but I'm sure it isn't a local problem
#8 Updated by Giovanni Manghi almost 6 years ago
- Status changed from Feedback to Open
- Affected QGIS version changed from 2.4.0 to master
Salvatore Larosa wrote:
neither with the attached DB, I see with both browser and add button:
I am trying with SL 4.0.0 and SQLite 3.7.13
ok now I see: in the browser one must add the SL layer by browsing directly the SL file, not the connection.
#9 Updated by Salvatore Larosa almost 6 years ago
- Category changed from Browser to Data Provider/OGR
- Status changed from Open to Feedback
I see now, but it is an OGR provider issue and occurs only when a primary key was defined.
FID Column has not fetched by ogr provider, but that might be considered as an expected behavior(?)
#15 Updated by Jukka Rahkonen almost 6 years ago
I must admit that I do not really use QGIS much. In WFS it is normal to hide FIDs from the users and it looks like QGIS WFS client is hiding them also. For my mind FIDs are for the system but I understand that sometimes it it good to be able to see them. However, editing FIDs is usually an extremely bad idea. For example if Spatialite happens to accept such edit it will invalidate spatial index and ruin foreign key relations. But perhaps I do not need to worry and QGIS and database drivers + triggers in the databases can prevent all the damage.