Bug report #470
adding a column to GRASS vector corrupts it
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||All||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||fixed/implemented|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||10529|
QGIS SVN 6277, GRASS 6.3 CVS 18.12.2006 ~3:00 PM
Plugins -> GRASS
1. 'Open mapset' "spearfish60/PERMANENT"
2. 'Create new Grass vector' "testing"
3. digitise one feature (eg. a point) using default 'Next not used' category mode
4. switch to 'Table', add one column (any type, any name)
5. 'Edit attributes' and click on the point you've digitised in point 3
6. you get "WARNING: ATTRIBUTES MISSING" and you can't edit the attribute you set the column for in step 4
Trying to 'Update' the table yields:
DBMI-DBF driver error: SQL parser error in statement: update test set WARNING: ATTRIBUTES MISSING = 'WARNING: ATTRIBUTES MISSING' where cat = 1 Error in db_execute_immediate()
Closing the GRASS Edit and opening it back, as well as removing the GRASS vector from layers list and adding it back doesn't help. If you quit QGIS and start it back, and then add the GRASS vector in question it is added but nothing is rendered.
You can display and query the vector in GRASS tough, but you can't edit the attribute you have added in step 4 (it is not listed), both in v.digit and d.what.vect -e. Strange is that v.info -c reports this column OK and v.db.connect -p says the database link is OK.
IOW, the GRASS vectro in question is corruputed.
All references to GRASS should be in capital letters. Please get rid of "Grass".
#1 Updated by anonymous - almost 14 years ago
This is not bug but feature. First you create an element with a category but a table does not exist yet so there is no record created in the table. Then when the table exists QGIS cannot find appropriate record in the table so it says "WARNING: ATTRIBUTES MISSING". That is true, the record in the table for the element's category is missing.
That may be intended or not.
I agrree that this can be inconvenient and I suggest two mprovements:
1) when the table is created and elemts with categories of that layer exist
QGIS should ask user if new records should be inserted for them in the table
2) in the 'GRASS Attributes dialog' it should be more clearly explained that
a record in table is missing and there should be a button for adding a new
record to the table for that element
Both improvements canot be done in 0.8 so I am going to change this ticket
PS: Changing this ticket back to 0.8/critical bug will only result in
changing owner to nobody by me.