File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -4026,9 +4026,17 @@ dbd_st_FETCH_internal(
4026
4026
I32 keylen ;
4027
4027
for (n = 0 ; n < DBIc_NUM_PARAMS (imp_sth ); n ++ )
4028
4028
{
4029
- keylen = sprintf (key , "%d" , n );
4030
- (void )hv_store (pvhv , key ,
4031
- keylen , newSVsv (imp_sth -> params [n ].value ), 0 );
4029
+ // https://metacpan.org/pod/DBI#ParamValues says keys
4030
+ // are typically integers starting at 1
4031
+ // 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
+ (void )hv_store (pvhv , key ,
4038
+ keylen , & PL_sv_undef , 0 );
4039
+ }
4032
4040
}
4033
4041
}
4034
4042
retsv = sv_2mortal (newRV_noinc ((SV * )pvhv ));
You can’t perform that action at this time.
0 commit comments