[GRASS-dev] [GRASS GIS] #391: SQLite driver doesn't complain enough with stupid mistakes

Hamish hamish_b at yahoo.com
Tue Dec 9 01:34:01 EST 2008


> Hamish wrote:
> >  G64:spearf> g.copy vect=archsites,tmp_arch
> >  G64:spearf> v.db.addcol tmp_arch column='x double y double'
[missing comma in columns='' didn't cause an error & left it broken]

Markus Neteler wrote:
> "columns" is a STRING, so in theory there are (other) cases that
> more than two parameters can be listed, e.g. the SQL statements.

I meant could the SQLite driver to throw an error, not G_parser().


> Question: could we add in the parser something like
> opt->pairanswer = YES|NO,
> 
> and enforce pairs in case of YES? This would be useful as
> well for east_north coordinates and such. Default NULL/NO for
> compatibility.
> ?
> 
> Dunno if we can change the struct (yet another API change?),

AFAIK that is already there & working in the parser so nothing new needed.
If key_desc has a comma in it, the parser looks for a pair(|set),
 e.g. opt->key_desc = "x,y";


G64> d.barscale at=50 --q
ERROR: option <at> must be provided in multiples of 2
       You provided 1 items:
       50

G64> d.barscale at=50, --q
ERROR: option <at> must be provided in multiples of 2
       You provided 1 items:
       50,

G64> d.barscale at=50,50,50 --q
ERROR: option <at> must be provided in multiples of 2
       You provided 3 items:
       50,50,50



G64> d.legend elevation.dem at=80,10,5 --q
ERROR: option <at> must be provided in multiples of 4
       You provided 3 items:
       80,10,5

G64> d.legend elevation.dem at=80,10,5,10,11 --q
ERROR: option <at> must be provided in multiples of 4
       You provided 5 items:
       80,10,5,10,11


see check_multiple_opts() in lib/gis/parser.c


Hamish



      



More information about the grass-dev mailing list