[GRASS-dev] db function needed to check if column exists in table

Markus Metz markus.metz.giswork at googlemail.com
Mon Jan 30 06:17:58 EST 2012


On Mon, Jan 30, 2012 at 12:04 PM, Martin Landa <landa.martin at gmail.com> wrote:
> Hi,
>
> 2012/1/30 Markus Metz <markus.metz.giswork at googlemail.com>:
>>>     db_get_column(driver, hcolumn,key, &column);
>>>     if (!column)
>>>         G_fatal_error(_("Missing column <%s> in table <%s>"), hcolumn, table);
>>>
>
> in this case you would probably need to close DB connection before
> calling G_fatal_error(). Probably candidate for new error handler (see
> [1]) which would close DB connections, close input vector map, and
> delete output vector map.

There are hundreds of places where G_fatal_error() is called without
closing DB connections. I would rather have the spawning fixed such
that sub-processes are closed if the calling process is closed. This
is working fine on Linux, but not on Windows.

Markus M

>
> Martin
>
> [1] http://trac.osgeo.org/grass/browser/grass/trunk/lib/vector/Vlib/handler.c#L26
>
> --
> Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa


More information about the grass-dev mailing list