Re: stack smashing when using ogrinfo with DB2 driver
> Another question is - why does VRT driver switch a layer to read only mode
> when using FID tag to specify primary key column?
I can just answer on that non-DB2 specific part. The reason is that when explicitly setting FID, when you want to update the underlying layer, you'd need to access its real FID, but, in the general case, the exposed FID at the VRT level cannot be matched with the underlying FID.
For example imagine you have a CSV file with
For the OGR CSV driver, the FID of this CSV file is implicit. The first record will be FID 1, the next one 2
If in your VRT you set <FID>my_id</FID>, then in the OGR VRT layer, you'll have 2 features of FID 10 and 11.
If you do SetFeature(vrt_feature) where vrt_feature.my_id = 11, the VRT driver would have to realize that this vrt_feature.my_id= 11 corresponds to csv_feature.implicit_id = 2. Which he cannot do efficiently (would require a full scan)