We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0c8c2d3 commit 0bbd203Copy full SHA for 0bbd203
dbdimp.c
@@ -4026,9 +4026,17 @@ dbd_st_FETCH_internal(
4026
I32 keylen;
4027
for (n= 0; n < DBIc_NUM_PARAMS(imp_sth); n++)
4028
{
4029
- keylen= sprintf(key, "%d", n);
4030
- (void)hv_store(pvhv, key,
4031
- keylen, newSVsv(imp_sth->params[n].value), 0);
+ // https://metacpan.org/pod/DBI#ParamValues says keys
+ // are typically integers starting at 1
+ // values should be undef if not yet bound
4032
+ keylen= sprintf(key, "%d", n+1);
4033
+ if (imp_sth->params[n].value) {
4034
+ (void)hv_store(pvhv, key,
4035
+ keylen, newSVsv(imp_sth->params[n].value), 0);
4036
+ } else {
4037
4038
+ keylen, &PL_sv_undef, 0);
4039
+ }
4040
}
4041
4042
retsv= sv_2mortal(newRV_noinc((SV*)pvhv));
0 commit comments