[GRASS-dev] [GRASS GIS] #3108: db selection: integer overflow

GRASS GIS trac at osgeo.org
Thu Jul 28 10:42:06 PDT 2016


#3108: db selection: integer overflow
--------------------------------------------+-------------------------
 Reporter:  mlennert                        |      Owner:  grass-dev@…
     Type:  defect                          |     Status:  new
 Priority:  normal                          |  Milestone:  7.0.5
Component:  Database                        |    Version:  svn-trunk
 Keywords:  v.db.univar db.select overflow  |        CPU:  Unspecified
 Platform:  Unspecified                     |
--------------------------------------------+-------------------------
 I don't have the time to look into it right now, but there seems to be
 some serious overflow happening in vector db selection:



 {{{
 v.info -c communes
 [...]
 INTEGER|REVENU_FIS
 [...]
 }}}

 Directly in sqlite I get the following:


 {{{
 sqlite> select min(REVENU_FIS), max(REVENU_FIS), sum(REVENU_FIS) from
 communes;
 0|7558043447|857584291001
 }}}

 However, using GRASS tools, I get:


 {{{
 db.select sql="select min(REVENU_FIS), max(REVENU_FIS), sum(REVENU_FIS)
 from communes"
 min(REVENU_FIS)|max(REVENU_FIS)|sum(REVENU_FIS)
 0|-1031891145|-1409168199
 }}}

 and


 {{{
 v.db.univar communes col=REVENU_FIS
 Reading column values...
 Number of values: 36610
 Minimum: -2001804970
 Maximum: 2098650536
 Range: 4100455506
 Mean: 20726578.6176728
 Arithmetic mean of absolute values: 21930820.0978148
 Variance: 7.76208158145393e+15
 Standard deviation: 88102676.3580649
 Coefficient of variation: 4.25071006571934
 Sum: 758800043193
 }}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3108>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list