Bug report #4766
Missing warnings when inserting wrong values into Attribute Table
|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 #:||14629|
To reproduce this issue, try the following:
In editing mode, use field calculator to add a new Integer field with width = 1 and fill it with the value 100.
This is obviously not going to work because we would need at least a width of 3 to accommodate this value.
Instead, '100' is happily displayed in the attribute table.
Only when I deactivate editing mode, the value suddenly gets truncated and reads '1' now.
In this simple case it's easy to spot. In other cases this can severely throw users off their path.
There should be some kind of warning.
#1 Updated by Maxim Dubinin about 8 years ago
This is very confusing especially for new users. Here is another test case:
1. Create a real field with 12 digits without decimals
2. Try to enter a value of lets say 1234567890123
3. Seemingly values enters ok.
4. After saving it changes to overflow -2147483648
Whatever the logic behind it, it should better warn the user not letting him enter such value instead of giving cryptic answer.
#7 Updated by Giovanni Manghi about 1 year ago
- Status changed from Open to Closed
- Resolution set to end of life
End of life notice: QGIS 2.18 LTR
#8 Updated by Anita Graser about 1 year ago
- Description updated (diff)
I've tested this using Shapefiles in 3.7: for integer fields, the length doesn't seem to matter. There is no warning but the values also aren't truncated. For decimal numbers, the attribute table now prevents inserting invalid values.