Opened 9 years ago
Last modified 6 years ago
#2850 new defect
v.db.update: value=NULL treated as text with NULL put between quotes
Reported by: | mlennert | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.6.2 |
Component: | Vector | Version: | svn-releasebranch70 |
Keywords: | v.db.update NULL | Cc: | |
CPU: | Unspecified | Platform: | Unspecified |
Description
v.db.update checks the type of the column to be updated and if it is not integer or double precision the content of the value parameter is automatically enclosed in single quotes.
This causes a problem with the NULL value as the column is set to contain the string 'NULL' and not the NULL value.
Currently the check is done as such:
if coltype.upper() not in ["INTEGER", "DOUBLE PRECISION"]: value = "'%s'" % value
We could just do this:
if coltype.upper() not in ["INTEGER", "DOUBLE PRECISION"] and value.upper() != 'NULL': value = "'%s'" % value
but this would mean that one could not put the string 'NULL' (or 'null') into a column.
So, we can either decide that one should not use the string 'NULL', or we have to find a different way to handle the specific value NULL.
Change History (6)
comment:1 by , 9 years ago
Milestone: | 7.0.3 |
---|
comment:3 by , 9 years ago
Milestone: | 7.0.4 → 7.0.5 |
---|
comment:4 by , 8 years ago
Milestone: | 7.0.5 → 7.0.6 |
---|
comment:5 by , 7 years ago
Milestone: | 7.0.6 → 7.0.7 |
---|
Ticket retargeted after milestone closed