Skip Menu |

This queue is for tickets about the DBD-SQLite CPAN distribution.

Report information
The Basics
Id: 21846
Status: rejected
Priority: 0/
Queue: DBD-SQLite

People
Owner: Nobody in particular
Requestors: tripiecz [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: RaiseError does not work
I noticed that the "RaiseError" attribute does not work at all. No exception (die) is raised when an error occurs. It's a problem for those who use the module in code based on exceptions and do not check return values for errors because they assume that exceptions will be raised. A trivial example is attached, which only prints out a warning, die() is not called. Is there something I miss, or is it a problem in DBD-SQLite ? The other DBD modules that I have used really do call die() on such errors. From the DBI manual: "RaiseError" (boolean, inherited) The "RaiseError" attribute can be used to force errors to raise exceptions rather than simply return error codes in the normal way. It is "off" by default. When set "on", any method which results in an error will cause the DBI to effectively do a "die("$class $method failed: $DBI::errstr")", where $class is the driver class and $method is the name of the method that failed.
Subject: die.pl
#!/usr/bin/perl use strict; use DBI; my $dbh = DBI->connect("dbi:SQLite:dbname=test.db", { RaiseError => 1, PrintError => 0, }); my $h = $dbh->selectrow_hashref(" SELECT * FROM nonexisting WHERE id = ? ", undef, 3); print "after die\n";
From: TRIPIE [...] cpan.org
I'm very sorry, there is no problem at all. I used the connect() method with wrong arguments, forgetting the username and password. I'm closing the bug now.
There is no problem at all. The mistake was on my part.