Opened 5 years ago
Closed 5 years ago
#3928 closed defect (fixed)
parser: --json bug with white space in parameter values
Reported by: | neteler | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.8.1 |
Component: | LibGIS | Version: | git-releasebranch78 |
Keywords: | parser | Cc: | |
CPU: | Unspecified | Platform: | Unspecified |
Description
At time the JSON support stumbles over white space:
Consider:
GRASS 7.8.1dev (nc_spm_08):~ > v.db.update map=antenna_position column='z_antenna' qcolumn='z + 2.00' --json { "module": "v.db.update", "id": "v.db.update_1804289383", "inputs":[ {"param": "map", "value": "antenna_position"}, {"param": "layer", "value": "1"}, {"param": "column", "value": "z_antenna"}, {"param": "query_column", "value": "z"} ]}
The part + 2.00
does not survive...
The issue is somewhere in https://github.com/OSGeo/grass/blob/master/lib/gis/parser_json.c
Change History (3)
comment:1 by , 5 years ago
comment:3 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
The problem is the use of G_tokenizer() with "+" in line:
https://github.com/OSGeo/grass/blob/master/lib/gis/parser_json.c#L347
A solution might be to switch to "@" in order to not confuse with algebraic functions.
Patch:
Then the following works fine:
as well as
as well as for actinia's importer: