Some ovsqlite-util polish
Bo Lindbergh <[email protected]> Mon, 29 Jul 2024 13:09:36 +0200
| Newsgroups | gmane.network.inn |
|---|---|
| Message-ID | <[email protected]> |
--Apple-Mail=_0CC43BDE-9FF1-411D-A195-0C322DC8AAD9
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=us-ascii
It doesn't seem to be explicitly stated in the DBI documentation,
but the RaiseError attribute passed to the connect method applies
to that method call itself as well as to future method calls
on the returned database handle. So, with RaiseError => 1,
there's no need to check the return value. Patch attached.
/Bo Lindbergh
--Apple-Mail=_0CC43BDE-9FF1-411D-A195-0C322DC8AAD9
Content-Disposition: attachment;
filename=ovslite-util.diff
Content-Type: application/octet-stream;
x-unix-mode=0600;
name="ovslite-util.diff"
Content-Transfer-Encoding: 7bit
diff --git a/storage/ovsqlite/ovsqlite-util.in b/storage/ovsqlite/ovsqlite-util.in
index 1c787f637..aa0f20081 100644
--- a/storage/ovsqlite/ovsqlite-util.in
+++ b/storage/ovsqlite/ovsqlite-util.in
@@ -101,7 +101,7 @@ my @pack_length_bias = (
my $dbh = DBI->connect(
$datasource, '', '',
{ PrintError => 0, RaiseError => 1, AutoCommit => 0 },
-) or die "Can't connect to database: " . DBI::errstr();
+);
# To process multiple SQL statements in a do() handle.
$dbh->{sqlite_allow_multiple_statements} = 1;
--Apple-Mail=_0CC43BDE-9FF1-411D-A195-0C322DC8AAD9
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--
inn-workers mailing list
[email protected]
https://lists.isc.org/mailman/listinfo/inn-workers
--Apple-Mail=_0CC43BDE-9FF1-411D-A195-0C322DC8AAD9--