Patch for DBD::SQLite - spurious undef warning
From: Sam Vilain (sam_at_vilain.net)
Date: 01/16/05
- Previous message: Ron Reidy: "RE: Issue with ODBC and Oracle"
- Next in thread: Tim Bunce: "Re: Patch for DBD::SQLite - spurious undef warning"
- Reply: Tim Bunce: "Re: Patch for DBD::SQLite - spurious undef warning"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 17 Jan 2005 09:50:17 +1300 To: dbi-users@perl.org
These debug messages cause "Use of uninitialised variable..." warnings
when you pass in undef parameters to $sth->execute();
Also logged as https://rt.cpan.org/Ticket/Display.html?id=9121
--- dbdimp.c~ 2004-10-05 09:02:21.000000000 +1300
+++ dbdimp.c 2004-12-24 14:45:13.000000000 +1300
@@ -328,7 +328,7 @@
int sql_type = SvIV(sql_type_sv);
sqlite_trace(4, "params left in 0x%p: %d", imp_sth->params,
1+av_len(im
p_sth->params));
- sqlite_trace(4, "bind %d type %d as %s", i, sql_type,
SvPV_nolen(value)
);
+ sqlite_trace(4, "bind %d type %d as %s", i, sql_type,
(SvPOK(value) ? S
vPV_nolen(value) : "NULL"));
if (!SvOK(value)) {
sqlite_trace(5, "binding null");
@@ -431,7 +431,7 @@
}
pos = 2 * (SvIV(param) - 1);
sqlite_trace(3, "bind into 0x%p: %d => %s (%d) pos %d\n",
- imp_sth->params, SvIV(param), SvPV_nolen(value), sql_type, pos);
+ imp_sth->params, SvIV(param), (SvPOK(value) ? SvPV_nolen(value) :
"NULL")
, sql_type, pos);
av_store(imp_sth->params, pos, SvREFCNT_inc(value));
av_store(imp_sth->params, pos+1, newSViv(sql_type));
-- Sam Vilain, sam /\T vilain |><>T net, PGP key ID: 0x05B52F13 (include my PGP key ID in personal replies to avoid spam filtering)
- Previous message: Ron Reidy: "RE: Issue with ODBC and Oracle"
- Next in thread: Tim Bunce: "Re: Patch for DBD::SQLite - spurious undef warning"
- Reply: Tim Bunce: "Re: Patch for DBD::SQLite - spurious undef warning"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]