@@ -718,7 +718,7 @@ copy_statement_to_parent(pTHX_ SV *h, imp_xxh_t *imp_xxh)
718
718
return ;
719
719
parent = DBIc_PARENT_H (imp_xxh );
720
720
if (parent && SvROK (parent )) {
721
- SV * tmp_sv = * hv_fetch ((HV * )SvRV (h ), "Statement" , 9 , 1 );
721
+ SV * tmp_sv = * hv_fetchs ((HV * )SvRV (h ), "Statement" , 1 );
722
722
if (SvOK (tmp_sv ))
723
723
(void )hv_store ((HV * )SvRV (parent ), "Statement" , 9 , SvREFCNT_inc (tmp_sv ), 0 );
724
724
}
@@ -754,7 +754,7 @@ set_err_sv(SV *h, imp_xxh_t *imp_xxh, SV *err, SV *errstr, SV *state, SV *method
754
754
int err_changed = 0 ;
755
755
756
756
if ( DBIc_has (imp_xxh , DBIcf_HandleSetErr )
757
- && (hook_svp = hv_fetch ((HV * )SvRV (h ),"HandleSetErr" , 12 ,0 ))
757
+ && (hook_svp = hv_fetchs ((HV * )SvRV (h ),"HandleSetErr" ,0 ))
758
758
&& hook_svp
759
759
&& ((void )(SvGMAGICAL (* hook_svp ) && mg_get (* hook_svp )), SvOK (* hook_svp ))
760
760
) {
@@ -1107,7 +1107,7 @@ dbih_inner(pTHX_ SV *orv, const char *what)
1107
1107
if (!SvMAGICAL (ohv )) {
1108
1108
if (!what )
1109
1109
return NULL ;
1110
- if (!hv_fetch ((HV * )ohv ,"_NO_DESTRUCT_WARN" , 17 ,0 ))
1110
+ if (!hv_fetchs ((HV * )ohv ,"_NO_DESTRUCT_WARN" ,0 ))
1111
1111
sv_dump (orv );
1112
1112
croak ("%s handle %s is not a DBI handle (has no magic)" ,
1113
1113
what , neatsvpv (orv ,0 ));
@@ -1437,7 +1437,7 @@ dbih_setup_handle(pTHX_ SV *orv, char *imp_class, SV *parent, SV *imp_datasv)
1437
1437
if ( (imp_mem_stash = gv_stashsv (imp_mem_name , FALSE)) == NULL )
1438
1438
croak (errmsg , neatsvpv (orv ,0 ), SvPVbyte_nolen (imp_mem_name ), "unknown _mem package" );
1439
1439
1440
- if ((svp = hv_fetch ((HV * )SvRV (h ), "dbi_imp_data" , 12 , 0 ))) {
1440
+ if ((svp = hv_fetchs ((HV * )SvRV (h ), "dbi_imp_data" , 0 ))) {
1441
1441
dbi_imp_data = * svp ;
1442
1442
if (SvGMAGICAL (dbi_imp_data )) /* call FETCH via magic */
1443
1443
mg_get (dbi_imp_data );
@@ -1478,9 +1478,9 @@ dbih_setup_handle(pTHX_ SV *orv, char *imp_class, SV *parent, SV *imp_datasv)
1478
1478
1479
1479
/* setup Callbacks from parents' ChildCallbacks */
1480
1480
if (DBIc_has (parent_imp , DBIcf_Callbacks )
1481
- && (tmp_svp = hv_fetch ((HV * )SvRV (parent ), "Callbacks" , 9 , 0 ))
1481
+ && (tmp_svp = hv_fetchs ((HV * )SvRV (parent ), "Callbacks" , 0 ))
1482
1482
&& SvROK (* tmp_svp ) && SvTYPE (SvRV (* tmp_svp )) == SVt_PVHV
1483
- && (tmp_svp = hv_fetch ((HV * )SvRV (* tmp_svp ), "ChildCallbacks" , 14 , 0 ))
1483
+ && (tmp_svp = hv_fetchs ((HV * )SvRV (* tmp_svp ), "ChildCallbacks" , 0 ))
1484
1484
&& SvROK (* tmp_svp ) && SvTYPE (SvRV (* tmp_svp )) == SVt_PVHV
1485
1485
) {
1486
1486
/* XXX mirrors behaviour of dbih_set_attr_k() of Callbacks */
@@ -1493,7 +1493,7 @@ dbih_setup_handle(pTHX_ SV *orv, char *imp_class, SV *parent, SV *imp_datasv)
1493
1493
if (1 ) {
1494
1494
AV * av ;
1495
1495
/* add weakref to new (outer) handle into parents ChildHandles array */
1496
- tmp_svp = hv_fetch ((HV * )SvRV (parent ), "ChildHandles" , 12 , 1 );
1496
+ tmp_svp = hv_fetchs ((HV * )SvRV (parent ), "ChildHandles" , 1 );
1497
1497
if (!SvROK (* tmp_svp )) {
1498
1498
SV * ChildHandles_rvav = newRV_noinc ((SV * )newAV ());
1499
1499
sv_setsv (* tmp_svp , ChildHandles_rvav );
@@ -1523,14 +1523,14 @@ dbih_setup_handle(pTHX_ SV *orv, char *imp_class, SV *parent, SV *imp_datasv)
1523
1523
case DBIt_DB :
1524
1524
/* cache _inner_ handle, but also see quick_FETCH */
1525
1525
(void )hv_store ((HV * )SvRV (h ), "Driver" , 6 , newRV_inc (SvRV (parent )), 0 );
1526
- (void )hv_fetch ((HV * )SvRV (h ), "Statement" , 9 , 1 ); /* store writable undef */
1526
+ (void )hv_fetchs ((HV * )SvRV (h ), "Statement" , 1 ); /* store writable undef */
1527
1527
break ;
1528
1528
case DBIt_ST :
1529
1529
DBIc_NUM_FIELDS ((imp_sth_t * )imp ) = -1 ;
1530
1530
/* cache _inner_ handle, but also see quick_FETCH */
1531
1531
(void )hv_store ((HV * )SvRV (h ), "Database" , 8 , newRV_inc (SvRV (parent )), 0 );
1532
1532
/* copy (alias) Statement from the sth up into the dbh */
1533
- tmp_svp = hv_fetch ((HV * )SvRV (h ), "Statement" , 9 , 1 );
1533
+ tmp_svp = hv_fetchs ((HV * )SvRV (h ), "Statement" , 1 );
1534
1534
(void )hv_store ((HV * )SvRV (parent ), "Statement" , 9 , SvREFCNT_inc (* tmp_svp ), 0 );
1535
1535
break ;
1536
1536
}
@@ -1638,7 +1638,7 @@ dbih_dumpcom(pTHX_ imp_xxh_t *imp_xxh, const char *msg, int level)
1638
1638
if (!inner || !SvROK (inner ))
1639
1639
return 1 ;
1640
1640
if (DBIc_TYPE (imp_xxh ) <= DBIt_DB ) {
1641
- SV * * svp = hv_fetch ((HV * )SvRV (inner ), "CachedKids" , 10 , 0 );
1641
+ SV * * svp = hv_fetchs ((HV * )SvRV (inner ), "CachedKids" , 0 );
1642
1642
if (svp && SvROK (* svp ) && SvTYPE (SvRV (* svp )) == SVt_PVHV ) {
1643
1643
HV * hv = (HV * )SvRV (* svp );
1644
1644
PerlIO_printf (DBILOGFP ,"%s CachedKids %d\n" , pad , (int )HvKEYS (hv ));
@@ -1654,12 +1654,12 @@ dbih_dumpcom(pTHX_ imp_xxh_t *imp_xxh, const char *msg, int level)
1654
1654
}
1655
1655
}
1656
1656
else if (DBIc_TYPE (imp_xxh ) == DBIt_DB ) {
1657
- SV * * svp = hv_fetch ((HV * )SvRV (inner ), "Name" , 4 , 0 );
1657
+ SV * * svp = hv_fetchs ((HV * )SvRV (inner ), "Name" , 0 );
1658
1658
if (svp && SvOK (* svp ))
1659
1659
PerlIO_printf (DBILOGFP ,"%s Name %s\n" , pad , neatsvpv (* svp ,0 ));
1660
1660
}
1661
1661
else if (DBIc_TYPE (imp_xxh ) == DBIt_ST ) {
1662
- SV * * svp = hv_fetch ((HV * )SvRV (inner ), "Statement" , 9 , 0 );
1662
+ SV * * svp = hv_fetchs ((HV * )SvRV (inner ), "Statement" , 0 );
1663
1663
if (svp && SvOK (* svp ))
1664
1664
PerlIO_printf (DBILOGFP ,"%s Statement %s\n" , pad , neatsvpv (* svp ,0 ));
1665
1665
}
@@ -2352,7 +2352,7 @@ dbih_get_attr_k(SV *h, SV *keysv, int dbikey)
2352
2352
valuesv = & PL_sv_undef ;
2353
2353
2354
2354
/* fetch from tied outer handle to trigger FETCH magic */
2355
- svp = hv_fetch ((HV * )DBIc_MY_H (imp_sth ), "NAME" , 4 , FALSE);
2355
+ svp = hv_fetchs ((HV * )DBIc_MY_H (imp_sth ), "NAME" , FALSE);
2356
2356
sv = (svp ) ? * svp : & PL_sv_undef ;
2357
2357
if (SvGMAGICAL (sv )) /* call FETCH via magic */
2358
2358
mg_get (sv );
@@ -2776,7 +2776,7 @@ static void
2776
2776
clear_cached_kids (pTHX_ SV * h , imp_xxh_t * imp_xxh , const char * meth_name , int trace_level )
2777
2777
{
2778
2778
if (DBIc_TYPE (imp_xxh ) <= DBIt_DB ) {
2779
- SV * * svp = hv_fetch ((HV * )SvRV (h ), "CachedKids" , 10 , 0 );
2779
+ SV * * svp = hv_fetchs ((HV * )SvRV (h ), "CachedKids" , 0 );
2780
2780
if (svp && SvROK (* svp ) && SvTYPE (SvRV (* svp )) == SVt_PVHV ) {
2781
2781
HV * hv = (HV * )SvRV (* svp );
2782
2782
if (HvKEYS (hv )) {
@@ -2890,7 +2890,7 @@ dbi_profile(SV *h, imp_xxh_t *imp_xxh, SV *statement_sv, SV *method, NV t1, NV t
2890
2890
2891
2891
h_hv = (HV * )SvRV (dbih_inner (aTHX_ h , "dbi_profile" ));
2892
2892
2893
- profile = * hv_fetch (h_hv , "Profile" , 7 , 1 );
2893
+ profile = * hv_fetchs (h_hv , "Profile" , 1 );
2894
2894
if (profile && SvMAGICAL (profile ))
2895
2895
mg_get (profile ); /* FETCH */
2896
2896
if (!profile || !SvROK (profile )) {
@@ -2907,7 +2907,7 @@ dbi_profile(SV *h, imp_xxh_t *imp_xxh, SV *statement_sv, SV *method, NV t1, NV t
2907
2907
/* statement_sv: undef = use $h->{Statement}, "" (&sv_no) = use empty string */
2908
2908
2909
2909
if (!SvOK (statement_sv )) {
2910
- SV * * psv = hv_fetch (h_hv , "Statement" , 9 , 0 );
2910
+ SV * * psv = hv_fetchs (h_hv , "Statement" , 0 );
2911
2911
statement_sv = (psv && SvOK (* psv )) ? * psv : & PL_sv_no ;
2912
2912
}
2913
2913
statement_pv = SvPV_nolen (statement_sv );
@@ -2918,7 +2918,7 @@ dbi_profile(SV *h, imp_xxh_t *imp_xxh, SV *statement_sv, SV *method, NV t1, NV t
2918
2918
2919
2919
dest_node = _profile_next_node (profile , "Data" );
2920
2920
2921
- tmp = * hv_fetch ((HV * )SvRV (profile ), "Path" , 4 , 1 );
2921
+ tmp = * hv_fetchs ((HV * )SvRV (profile ), "Path" , 1 );
2922
2922
if (SvROK (tmp ) && SvTYPE (SvRV (tmp ))== SVt_PVAV ) {
2923
2923
int len ;
2924
2924
av = (AV * )SvRV (tmp );
@@ -3464,7 +3464,7 @@ XS(XS_DBI_dispatch)
3464
3464
if (is_DESTROY ) {
3465
3465
3466
3466
/* force destruction of any outstanding children */
3467
- if ((tmp_svp = hv_fetch ((HV * )SvRV (h ), "ChildHandles" , 12 , FALSE)) && SvROK (* tmp_svp )) {
3467
+ if ((tmp_svp = hv_fetchs ((HV * )SvRV (h ), "ChildHandles" , FALSE)) && SvROK (* tmp_svp )) {
3468
3468
AV * av = (AV * )SvRV (* tmp_svp );
3469
3469
I32 kidslots ;
3470
3470
PerlIO * logfp = DBILOGFP ;
@@ -3556,7 +3556,7 @@ XS(XS_DBI_dispatch)
3556
3556
}
3557
3557
3558
3558
if (DBIc_has (imp_xxh ,DBIcf_Callbacks )
3559
- && (tmp_svp = hv_fetch ((HV * )SvRV (h ), "Callbacks" , 9 , 0 ))
3559
+ && (tmp_svp = hv_fetchs ((HV * )SvRV (h ), "Callbacks" , 0 ))
3560
3560
&& ( (hook_svp = hv_fetch ((HV * )SvRV (* tmp_svp ), meth_name , strlen (meth_name ), 0 ))
3561
3561
/* the "*" fallback callback only applies to non-nested calls
3562
3562
* and also doesn't apply to the 'set_err' or DESTROY methods.
@@ -3566,7 +3566,7 @@ XS(XS_DBI_dispatch)
3566
3566
*/
3567
3567
|| (!is_nested_call && !PL_dirty && meth_type != methtype_set_err &&
3568
3568
meth_type != methtype_DESTROY &&
3569
- (hook_svp = hv_fetch ((HV * )SvRV (* tmp_svp ), "*" , 1 , 0 ))
3569
+ (hook_svp = hv_fetchs ((HV * )SvRV (* tmp_svp ), "*" , 0 ))
3570
3570
)
3571
3571
)
3572
3572
&& SvROK (* hook_svp )
@@ -4003,7 +4003,7 @@ XS(XS_DBI_dispatch)
4003
4003
char intro [200 ];
4004
4004
4005
4005
if (meth_type == methtype_set_err ) {
4006
- SV * * sem_svp = hv_fetch ((HV * )SvRV (h ), "dbi_set_err_method" , 18 , GV_ADDWARN );
4006
+ SV * * sem_svp = hv_fetchs ((HV * )SvRV (h ), "dbi_set_err_method" , GV_ADDWARN );
4007
4007
if (SvOK (* sem_svp ))
4008
4008
err_meth_name = SvPV_nolen (* sem_svp );
4009
4009
}
@@ -4021,7 +4021,7 @@ XS(XS_DBI_dispatch)
4021
4021
if ( DBIc_has (imp_xxh , DBIcf_ShowErrorStatement )
4022
4022
&& !is_unrelated_to_Statement
4023
4023
&& (DBIc_TYPE (imp_xxh ) == DBIt_ST || ima_flags & IMA_SHOW_ERR_STMT )
4024
- && (statement_svp = hv_fetch ((HV * )SvRV (h ), "Statement" , 9 , 0 ))
4024
+ && (statement_svp = hv_fetchs ((HV * )SvRV (h ), "Statement" , 0 ))
4025
4025
&& statement_svp && SvOK (* statement_svp )
4026
4026
) {
4027
4027
SV * * svp = 0 ;
@@ -4031,7 +4031,7 @@ XS(XS_DBI_dispatch)
4031
4031
/* fetch from tied outer handle to trigger FETCH magic */
4032
4032
/* could add DBIcf_ShowErrorParams (default to on?) */
4033
4033
if (!(ima_flags & IMA_HIDE_ERR_PARAMVALUES )) {
4034
- svp = hv_fetch ((HV * )DBIc_MY_H (imp_xxh ),"ParamValues" , 11 ,FALSE);
4034
+ svp = hv_fetchs ((HV * )DBIc_MY_H (imp_xxh ),"ParamValues" ,FALSE);
4035
4035
if (svp && SvMAGICAL (* svp ))
4036
4036
mg_get (* svp ); /* XXX may recurse, may croak. could use eval */
4037
4037
}
@@ -4056,7 +4056,7 @@ XS(XS_DBI_dispatch)
4056
4056
hook_svp = NULL ;
4057
4057
if ( (SvTRUE (err_sv ) || (is_warning && DBIc_has (imp_xxh , DBIcf_RaiseWarn )))
4058
4058
&& DBIc_has (imp_xxh , DBIcf_HandleError )
4059
- && (hook_svp = hv_fetch ((HV * )SvRV (h ),"HandleError" , 11 ,0 ))
4059
+ && (hook_svp = hv_fetchs ((HV * )SvRV (h ),"HandleError" ,0 ))
4060
4060
&& hook_svp && SvOK (* hook_svp )
4061
4061
) {
4062
4062
dSP ;
@@ -5126,7 +5126,7 @@ take_imp_data(h)
5126
5126
* destroyed they may need to interact with the 'zombie' parent dbh.
5127
5127
* So we do our best to neautralize them (finish & rebless)
5128
5128
*/
5129
- if ((tmp_svp = hv_fetch ((HV * )SvRV (h ), "ChildHandles" , 12 , FALSE)) && SvROK (* tmp_svp )) {
5129
+ if ((tmp_svp = hv_fetchs ((HV * )SvRV (h ), "ChildHandles" , FALSE)) && SvROK (* tmp_svp )) {
5130
5130
AV * av = (AV * )SvRV (* tmp_svp );
5131
5131
HV * zombie_stash = gv_stashpv ("DBI::zombie" , GV_ADDWARN );
5132
5132
I32 kidslots ;
@@ -5570,7 +5570,7 @@ set_err(h, err, errstr=&PL_sv_no, state=&PL_sv_undef, method=&PL_sv_undef, resul
5570
5570
}
5571
5571
else {
5572
5572
/* store provided method name so handler code can find it */
5573
- sem_svp = hv_fetch ((HV * )SvRV (h ), "dbi_set_err_method" , 18 , 1 );
5573
+ sem_svp = hv_fetchs ((HV * )SvRV (h ), "dbi_set_err_method" , 1 );
5574
5574
if (SvOK (method )) {
5575
5575
sv_setpv (* sem_svp , SvPV_nolen (method ));
5576
5576
}
0 commit comments