Bug report #13546

qgis trying to update first empty text row with null in db

Added by zimirrr leonid over 8 years ago. Updated over 8 years ago.

Status:Closed
Priority:Normal
Assignee:Jürgen Fischer
Category:Attribute table
Affected QGIS version:2.10.1 Regression?:No
Operating System:win 7 Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:21588

Description

I have Postgresql table

CREATE TABLE test_qgis(
  id serial NOT NULL,
  "colText" text,
  "colChar" character varying(300),
  "GEOM" geometry(Point,4326),
  CONSTRAINT test_qgis_pkey PRIMARY KEY (id)
)WITH (OIDS=FALSE);

INSERT INTO test_qgis("colText", "colChar", "GEOM") VALUES ('', '', st_setSrid(st_point(20,30),4326));
INSERT INTO test_qgis("colText", "colChar", "GEOM") VALUES ('', '', st_setSrid(st_point(30,10),4326));
  1. Open table with qgis
  2. Open Attribute table
  3. Toggle editing mode ON
    colText and colChar became 'NULL' in first row
  4. Toggle editing mode OFF
    qgis asks to "Save Changes"

this bug doesn't appear when column type "character"

Associated revisions

Revision 3beaed9f
Added by Jürgen Fischer over 8 years ago

editor widget: don't reset empty strings to null, if default value is null (fixes #13546)

History

#1 Updated by zimirrr leonid over 8 years ago

*this bug doesn't appear when column type "character"

#2 Updated by Paolo Cavallini over 8 years ago

  • Subject changed from qgis trying to update first emty text row with null in db to qgis trying to update first empty text row with null in db

#3 Updated by Jürgen Fischer over 8 years ago

  • Assignee set to Jürgen Fischer

#4 Updated by Jürgen Fischer over 8 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF