Bug report #1884

addFeatures don't work for SpatiaLite layer

Added by Alexander Bruy over 15 years ago. Updated over 15 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:Data Provider
Affected QGIS version: Regression?:No
Operating System:Windows Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:11944

Description

Seems that addFeatures method of SpatiaLite data provider don't work. I try to copy all features from shapefile to empty SpatiaLite layer with help of simple plugin and have no result. Fetures don't adds.

I run same plugin but with both shapefiles and all work fine.

Tested on Windows XP Pro SP3 with QGIS 1.2.0 (qgis-dev package, versions up to 1.2.0-25) and QGIS 1.1 obtained from OSGEO4W installer .

Sample plugin with all necessary data attached. In archive there is shapefile, empty SpatiaLite database and simple plugin which copied fetures from shapefile to database

convertor.zip - Plugin and data for testing (203 KB) Alexander Bruy, 2009-08-19 06:17 AM

History

#1 Updated by Jürgen Fischer over 15 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

fixed in 52c420b0 (SVN r11439)

Although that doesn't fix problems in your data model/plugin. You have several columns with NOT NULL constraints on them and don't assign any values. You also have a primary key column, that you don't initialize.

If you have an own primary key, you need to initialize it.

Also available in: Atom PDF