[GRASS-dev] [GRASS GIS] #185: division with dbf driver leads to protocol error

#185: division with dbf driver leads to protocol error
--------------------------+-------------------------------------------------
Reporter: mlennert | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: major | Milestone: 6.4.0
Component: default | Version: 6.3.0
Keywords: dbf division |
--------------------------+-------------------------------------------------
The help page on the dbf driver says "Arithmetic expressions using
constants and field values are allowed in condition clauses and in the RHS
of assignments".

I can confirm that these work:

{{{

v.db.update map=ilots col=prop_popmo value='P_UNDER_5+P5_TO_9'
v.db.update map=ilots col=prop_popmo value='P_UNDER_5-P5_TO_9'
v.db.update map=ilots col=prop_popmo value='(P_UNDER_5+P5_TO_9)*TOTAL_POP
}}}

However,

{{{
v.db.update map=ilots col=prop_popmo value='(P_UNDER_5+P5_TO_9)/TOTAL_POP'
}}}

gives me the following error:

{{{

ERROR: This should not happen: got a wrong expression structure after
        parsing.
dbmi: Protocol error
ERROR: Error while executing: 'UPDATE ilots SET
        prop_popmo=(P_UNDER_5+P5_TO_9)/TOTAL_POP
        '
}}}

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/185&gt;
GRASS GIS <http://grass.osgeo.org>

#185: division with dbf driver leads to protocol error
--------------------------+-------------------------------------------------
  Reporter: mlennert | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: closed
  Priority: major | Milestone: 6.4.0
Component: default | Version: 6.3.0
Resolution: worksforme | Keywords: dbf division
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Changes (by mlennert):

  * status: new => closed
  * platform: => Unspecified
  * resolution: => worksforme
  * cpu: => Unspecified

Comment:

The problem is division by 0, if I use

{{{
v.db.update map=ilots col=prop_popmo value='(P_UNDER_5+P5_TO_9)/TOTAL_POP'
where="TOTAL_POP>0"
}}}

it works.

Maybe the error message could be enhanced, but it's not really a bug, so
closing it.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/185#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>