Thu, Dec 9 2004
00:15:44
|
|
Request created by jidanni@jidanni.org
|
|
Return-Path |
<jidanni@jidanni.org>
|
Delivered-To |
grass-bugs@lists.intevation.de
|
To |
grass-bugs@intevation.de
|
Subject |
db.execute: want to do like /bin/sh -e
|
From |
Dan Jacobson <jidanni@jidanni.org>
|
Date |
Thu, 09 Dec 2004 05:39:37 +0800
|
Message-ID |
<87mzwoxyee.fsf@jidanni.org>
|
MIME-Version |
1.0
|
Content-Type |
text/plain; charset=us-ascii
|
X-Spam-Status |
No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
|
X-Spam-Level |
|
db.execute should have an option to cause it to stop after the first
error it encounters back from the driver, not just go on sending the
next line to the driver. E.g., don't go on after
DBMI-DBF driver error:
SQL parser error in statement:
UPDATE largeHouseNumbers SET housenum = 1 WHERE cat = 1 FROM tmp2
Error in db_execute_immediate()
WARNING: Error while executing: "UPDATE largeHouseNumbers SET housenum = 1
WHERE cat = 1 FROM tmp2"
Also
WARNING: Error
just like e.g.,
Error: WARNING
look silly.
|
|
Thu, Dec 9 2004
15:53:32
|
|
Mail sent by neteler@itc.it
|
|
Return-Path |
<neteler@itc.it>
|
Delivered-To |
grass-bugs@lists.intevation.de
|
Date |
Thu, 9 Dec 2004 15:53:31 +0100
|
From |
Markus Neteler <neteler@itc.it>
|
To |
Request Tracker <grass-bugs@intevation.de>
|
Cc |
grass5@grass.itc.it
|
Subject |
Re: [GRASS5] [bug #2818] (grass) db.execute: want to do like /bin/sh -e
|
Message-ID |
<20041209145331.GM4854@thuille.itc.it>
|
Mail-Followup-To |
Request Tracker <grass-bugs@intevation.de>, grass5@grass.itc.it
|
References |
<20041208231544.42519102C54@lists.intevation.de>
|
Mime-Version |
1.0
|
Content-Type |
text/plain; charset=us-ascii
|
Content-Disposition |
inline
|
In-Reply-To |
<20041208231544.42519102C54@lists.intevation.de>
|
User-Agent |
Mutt/1.4.1i
|
X-Spam-Status |
No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
|
X-Spam-Level |
|
On Thu, Dec 09, 2004 at 12:15:44AM +0100, Request Tracker wrote:
> this bug's URL: http://intevation.de/rt/webrt?serial_num=2818
> -------------------------------------------------------------------------
>
> db.execute should have an option to cause it to stop after the first
> error it encounters back from the driver, not just go on sending the
> next line to the driver. E.g., don't go on after
> DBMI-DBF driver error:
> SQL parser error in statement:
> UPDATE largeHouseNumbers SET housenum = 1 WHERE cat = 1 FROM tmp2
> Error in db_execute_immediate()
> WARNING: Error while executing: "UPDATE largeHouseNumbers SET housenum = 1
> WHERE cat = 1 FROM tmp2"
> Also
> WARNING: Error
> just like e.g.,
> Error: WARNING
> look silly.
I have added a new flag '-i' to db/base/execute.c:
Usage:
db.execute [-i] [driver=name] [database=name] [input=filename]
Flags:
-i ignore SQL errors and continue
which switches between G_warning and G_fatal_error (default now).
Of course it could be also reverted in functionality to make
G_warning the default as it was before.
However, I agree that it should stop upon error and only continue
with an additional flag to make the user aware of the problem.
Markus
|
|
Thu, Dec 9 2004
15:53:39
|
|
Status changed to resolved by mneteler
|
|