"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Driver.xst" between
DBI-1.642.tar.gz and DBI-1.643.tar.gz

About: DBI - The Perl Database Interface (requires one or more "driver" modules DBD::* to talk to databases).

Driver.xst  (DBI-1.642):Driver.xst  (DBI-1.643)
skipping to change at line 59 skipping to change at line 59
MODULE = DBD::~DRIVER~ PACKAGE = DBD::~DRIVER~::dr MODULE = DBD::~DRIVER~ PACKAGE = DBD::~DRIVER~::dr
void void
dbixs_revision(...) dbixs_revision(...)
PPCODE: PPCODE:
ST(0) = sv_2mortal(newSViv(DBIXS_REVISION)); ST(0) = sv_2mortal(newSViv(DBIXS_REVISION));
#ifdef dbd_discon_all #ifdef dbd_discon_all
# disconnect_all renamed and ALIAS'd to avoid length clash on VMS :-( # disconnect_all renamed and ALIAS'd to avoid length clash on VMS :-(
void bool
discon_all_(drh) discon_all_(drh)
SV * drh SV * drh
ALIAS: ALIAS:
disconnect_all = 1 disconnect_all = 1
CODE: CODE:
D_imp_drh(drh); D_imp_drh(drh);
PERL_UNUSED_VAR(ix); PERL_UNUSED_VAR(ix);
ST(0) = dbd_discon_all(drh, imp_drh) ? &PL_sv_yes : &PL_sv_no; RETVAL = dbd_discon_all(drh, imp_drh);
OUTPUT:
RETVAL
#endif /* dbd_discon_all */ #endif /* dbd_discon_all */
#ifdef dbd_dr_data_sources #ifdef dbd_dr_data_sources
void void
data_sources(drh, attr = Nullsv) data_sources(drh, attr = Nullsv)
SV *drh SV *drh
SV *attr SV *attr
PPCODE: PPCODE:
skipping to change at line 98 skipping to change at line 100
} }
} }
#endif #endif
# ------------------------------------------------------------ # ------------------------------------------------------------
# database level interface # database level interface
# ------------------------------------------------------------ # ------------------------------------------------------------
MODULE = DBD::~DRIVER~ PACKAGE = DBD::~DRIVER~::db MODULE = DBD::~DRIVER~ PACKAGE = DBD::~DRIVER~::db
void bool
_login(dbh, dbname, username, password, attribs=Nullsv) _login(dbh, dbname, username, password, attribs=Nullsv)
SV * dbh SV * dbh
SV * dbname SV * dbname
SV * username SV * username
SV * password SV * password
SV * attribs SV * attribs
CODE: CODE:
{ {
D_imp_dbh(dbh); D_imp_dbh(dbh);
#if !defined(dbd_db_login6_sv) #if !defined(dbd_db_login6_sv)
STRLEN lna; STRLEN lna;
char *u = (SvOK(username)) ? SvPV(username,lna) : (char*)""; char *u = (SvOK(username)) ? SvPV(username,lna) : (char*)"";
char *p = (SvOK(password)) ? SvPV(password,lna) : (char*)""; char *p = (SvOK(password)) ? SvPV(password,lna) : (char*)"";
#endif #endif
#ifdef dbd_db_login6_sv #ifdef dbd_db_login6_sv
ST(0) = dbd_db_login6_sv(dbh, imp_dbh, dbname, username, password, attribs) ? &PL_sv_yes : &PL_sv_no; RETVAL = dbd_db_login6_sv(dbh, imp_dbh, dbname, username, password, attribs) ;
#elif defined(dbd_db_login6) #elif defined(dbd_db_login6)
ST(0) = dbd_db_login6(dbh, imp_dbh, SvPV_nolen(dbname), u, p, attribs) ? &PL _sv_yes : &PL_sv_no; RETVAL = dbd_db_login6(dbh, imp_dbh, SvPV_nolen(dbname), u, p, attribs);
#else #else
PERL_UNUSED_ARG(attribs); PERL_UNUSED_ARG(attribs);
ST(0) = dbd_db_login( dbh, imp_dbh, SvPV_nolen(dbname), u, p) ? &PL_sv_yes : &PL_sv_no; RETVAL = dbd_db_login( dbh, imp_dbh, SvPV_nolen(dbname), u, p);
#endif #endif
} }
OUTPUT:
RETVAL
void void
selectall_arrayref(...) selectall_arrayref(...)
PREINIT: PREINIT:
SV *sth; SV *sth;
SV **maxrows_svp; SV **maxrows_svp;
SV **tmp_svp; SV **tmp_svp;
SV *tmp_sv; SV *tmp_sv;
SV *attr = &PL_sv_undef; SV *attr = &PL_sv_undef;
imp_sth_t *imp_sth; imp_sth_t *imp_sth;
skipping to change at line 258 skipping to change at line 262
SV * dbh SV * dbh
SV * statement SV * statement
SV * params SV * params
CODE: CODE:
{ {
D_imp_dbh(dbh); D_imp_dbh(dbh);
IV retval; IV retval;
#ifdef dbd_db_do6 #ifdef dbd_db_do6
/* items is a number of arguments passed to XSUB, supplied by xsubpp compile r */ /* items is a number of arguments passed to XSUB, supplied by xsubpp compile r */
/* ax contains stack base offset used by ST() macro, supplied by xsubpp comp iler */ /* ax contains stack base offset used by ST() macro, supplied by xsubpp comp iler */
retval = dbd_db_do6(dbh, imp_dbh, statement, params, items-3, ax+3); I32 offset = (items >= 3) ? 3 : items;
retval = dbd_db_do6(dbh, imp_dbh, statement, params, items-offset, ax+offset
);
#else #else
if (items > 3) if (items > 3)
croak_xs_usage(cv, "dbh, statement, params = Nullsv"); croak_xs_usage(cv, "dbh, statement, params = Nullsv");
retval = dbd_db_do4(dbh, imp_dbh, SvPV_nolen(statement), params); /* might b e dbd_db_do4_iv via macro */ retval = dbd_db_do4(dbh, imp_dbh, SvPV_nolen(statement), params); /* might b e dbd_db_do4_iv via macro */
#endif #endif
/* remember that dbd_db_do* must return <= -2 for error */ /* remember that dbd_db_do* must return <= -2 for error */
if (retval == 0) /* ok with no rows affected */ if (retval == 0) /* ok with no rows affected */
XST_mPV(0, "0E0"); /* (true but zero) */ XST_mPV(0, "0E0"); /* (true but zero) */
else if (retval < -1) /* -1 == unknown number of rows */ else if (retval < -1) /* -1 == unknown number of rows */
XST_mUNDEF(0); /* <= -2 means error */ XST_mUNDEF(0); /* <= -2 means error */
skipping to change at line 288 skipping to change at line 293
last_insert_id(dbh, catalog=&PL_sv_undef, schema=&PL_sv_undef, table=&PL_sv_unde f, field=&PL_sv_undef, attr=Nullsv) last_insert_id(dbh, catalog=&PL_sv_undef, schema=&PL_sv_undef, table=&PL_sv_unde f, field=&PL_sv_undef, attr=Nullsv)
SV * dbh SV * dbh
SV * catalog SV * catalog
SV * schema SV * schema
SV * table SV * table
SV * field SV * field
SV * attr SV * attr
CODE: CODE:
{ {
D_imp_dbh(dbh); D_imp_dbh(dbh);
ST(0) = dbd_db_last_insert_id(dbh, imp_dbh, catalog, schema, table, field, a SV *ret = dbd_db_last_insert_id(dbh, imp_dbh, catalog, schema, table, field,
ttr); attr);
ST(0) = ret;
} }
#endif #endif
void bool
commit(dbh) commit(dbh)
SV * dbh SV * dbh
CODE: CODE:
D_imp_dbh(dbh); D_imp_dbh(dbh);
if (DBIc_has(imp_dbh,DBIcf_AutoCommit) && DBIc_WARN(imp_dbh)) if (DBIc_has(imp_dbh,DBIcf_AutoCommit) && DBIc_WARN(imp_dbh))
warn("commit ineffective with AutoCommit enabled"); warn("commit ineffective with AutoCommit enabled");
ST(0) = dbd_db_commit(dbh, imp_dbh) ? &PL_sv_yes : &PL_sv_no; RETVAL = dbd_db_commit(dbh, imp_dbh);
OUTPUT:
RETVAL
void bool
rollback(dbh) rollback(dbh)
SV * dbh SV * dbh
CODE: CODE:
D_imp_dbh(dbh); D_imp_dbh(dbh);
if (DBIc_has(imp_dbh,DBIcf_AutoCommit) && DBIc_WARN(imp_dbh)) if (DBIc_has(imp_dbh,DBIcf_AutoCommit) && DBIc_WARN(imp_dbh))
warn("rollback ineffective with AutoCommit enabled"); warn("rollback ineffective with AutoCommit enabled");
ST(0) = dbd_db_rollback(dbh, imp_dbh) ? &PL_sv_yes : &PL_sv_no; RETVAL = dbd_db_rollback(dbh, imp_dbh);
OUTPUT:
RETVAL
void bool
disconnect(dbh) disconnect(dbh)
SV * dbh SV * dbh
CODE: CODE:
D_imp_dbh(dbh); D_imp_dbh(dbh);
if ( !DBIc_ACTIVE(imp_dbh) ) { if ( !DBIc_ACTIVE(imp_dbh) ) {
XSRETURN_YES; XSRETURN_YES;
} }
/* Check for disconnect() being called whilst refs to cursors */ /* Check for disconnect() being called whilst refs to cursors */
/* still exists. This possibly needs some more thought. */ /* still exists. This possibly needs some more thought. */
if (DBIc_ACTIVE_KIDS(imp_dbh) && DBIc_WARN(imp_dbh) && !PL_dirty) { if (DBIc_ACTIVE_KIDS(imp_dbh) && DBIc_WARN(imp_dbh) && !PL_dirty) {
STRLEN lna; STRLEN lna;
char *plural = (DBIc_ACTIVE_KIDS(imp_dbh)==1) ? (char*)"" : (char*)"s"; char *plural = (DBIc_ACTIVE_KIDS(imp_dbh)==1) ? (char*)"" : (char*)"s";
warn("%s->disconnect invalidates %d active statement handle%s %s", warn("%s->disconnect invalidates %d active statement handle%s %s",
SvPV(dbh,lna), (int)DBIc_ACTIVE_KIDS(imp_dbh), plural, SvPV(dbh,lna), (int)DBIc_ACTIVE_KIDS(imp_dbh), plural,
"(either destroy statement handles or call finish on them before dis connecting)"); "(either destroy statement handles or call finish on them before dis connecting)");
} }
ST(0) = dbd_db_disconnect(dbh, imp_dbh) ? &PL_sv_yes : &PL_sv_no; RETVAL = dbd_db_disconnect(dbh, imp_dbh);
DBIc_ACTIVE_off(imp_dbh); /* ensure it's off, regardless */ DBIc_ACTIVE_off(imp_dbh); /* ensure it's off, regardless */
OUTPUT:
RETVAL
void void
STORE(dbh, keysv, valuesv) STORE(dbh, keysv, valuesv)
SV * dbh SV * dbh
SV * keysv SV * keysv
SV * valuesv SV * valuesv
CODE: CODE:
D_imp_dbh(dbh); D_imp_dbh(dbh);
if (SvGMAGICAL(valuesv)) if (SvGMAGICAL(valuesv))
mg_get(valuesv); mg_get(valuesv);
skipping to change at line 458 skipping to change at line 470
#endif #endif
# -- end of DBD::~DRIVER~::db # -- end of DBD::~DRIVER~::db
# ------------------------------------------------------------ # ------------------------------------------------------------
# statement interface # statement interface
# ------------------------------------------------------------ # ------------------------------------------------------------
MODULE = DBD::~DRIVER~ PACKAGE = DBD::~DRIVER~::st MODULE = DBD::~DRIVER~ PACKAGE = DBD::~DRIVER~::st
void bool
_prepare(sth, statement, attribs=Nullsv) _prepare(sth, statement, attribs=Nullsv)
SV * sth SV * sth
SV * statement SV * statement
SV * attribs SV * attribs
CODE: CODE:
{ {
D_imp_sth(sth); D_imp_sth(sth);
DBD_ATTRIBS_CHECK("_prepare", sth, attribs); DBD_ATTRIBS_CHECK("_prepare", sth, attribs);
#ifdef dbd_st_prepare_sv #ifdef dbd_st_prepare_sv
ST(0) = dbd_st_prepare_sv(sth, imp_sth, statement, attribs) ? &PL_sv_yes : & PL_sv_no; RETVAL = dbd_st_prepare_sv(sth, imp_sth, statement, attribs);
#else #else
ST(0) = dbd_st_prepare(sth, imp_sth, SvPV_nolen(statement), attribs) ? &PL_s v_yes : &PL_sv_no; RETVAL = dbd_st_prepare(sth, imp_sth, SvPV_nolen(statement), attribs);
#endif #endif
} }
OUTPUT:
RETVAL
#ifdef dbd_st_rows #ifdef dbd_st_rows
void void
rows(sth) rows(sth)
SV * sth SV * sth
CODE: CODE:
D_imp_sth(sth); D_imp_sth(sth);
XST_mIV(0, dbd_st_rows(sth, imp_sth)); XST_mIV(0, dbd_st_rows(sth, imp_sth));
#endif /* dbd_st_rows */ #endif /* dbd_st_rows */
#ifdef dbd_st_bind_col #ifdef dbd_st_bind_col
void bool
bind_col(sth, col, ref, attribs=Nullsv) bind_col(sth, col, ref, attribs=Nullsv)
SV * sth SV * sth
SV * col SV * col
SV * ref SV * ref
SV * attribs SV * attribs
CODE: CODE:
{ {
IV sql_type = 0; IV sql_type = 0;
D_imp_sth(sth); D_imp_sth(sth);
if (SvGMAGICAL(ref)) if (SvGMAGICAL(ref))
skipping to change at line 512 skipping to change at line 526
attribs = Nullsv; attribs = Nullsv;
} }
else { else {
SV **svp; SV **svp;
DBD_ATTRIBS_CHECK("bind_col", sth, attribs); DBD_ATTRIBS_CHECK("bind_col", sth, attribs);
/* XXX we should perhaps complain if TYPE is not SvNIOK */ /* XXX we should perhaps complain if TYPE is not SvNIOK */
DBD_ATTRIB_GET_IV(attribs, "TYPE",4, svp, sql_type); DBD_ATTRIB_GET_IV(attribs, "TYPE",4, svp, sql_type);
} }
} }
switch(dbd_st_bind_col(sth, imp_sth, col, ref, sql_type, attribs)) { switch(dbd_st_bind_col(sth, imp_sth, col, ref, sql_type, attribs)) {
case 2: ST(0) = &PL_sv_yes; /* job done completely */ case 2: RETVAL = TRUE; /* job done completely */
break; break;
case 1: /* fallback to DBI default */ case 1: /* fallback to DBI default */
ST(0) = (DBIc_DBISTATE(imp_sth)->bind_col(sth, col, ref, attribs RETVAL = DBIc_DBISTATE(imp_sth)->bind_col(sth, col, ref, attribs
)) );
? &PL_sv_yes : &PL_sv_no;
break; break;
default: ST(0) = &PL_sv_no; /* dbd_st_bind_col has called set_err */ default: RETVAL = FALSE; /* dbd_st_bind_col has called set_er r */
break; break;
} }
} }
OUTPUT:
RETVAL
#endif /* dbd_st_bind_col */ #endif /* dbd_st_bind_col */
void bool
bind_param(sth, param, value, attribs=Nullsv) bind_param(sth, param, value, attribs=Nullsv)
SV * sth SV * sth
SV * param SV * param
SV * value SV * value
SV * attribs SV * attribs
CODE: CODE:
{ {
IV sql_type = 0; IV sql_type = 0;
D_imp_sth(sth); D_imp_sth(sth);
if (SvGMAGICAL(value)) if (SvGMAGICAL(value))
skipping to change at line 549 skipping to change at line 564
sql_type = SvIV(attribs); sql_type = SvIV(attribs);
attribs = Nullsv; attribs = Nullsv;
} }
else { else {
SV **svp; SV **svp;
DBD_ATTRIBS_CHECK("bind_param", sth, attribs); DBD_ATTRIBS_CHECK("bind_param", sth, attribs);
/* XXX we should perhaps complain if TYPE is not SvNIOK */ /* XXX we should perhaps complain if TYPE is not SvNIOK */
DBD_ATTRIB_GET_IV(attribs, "TYPE",4, svp, sql_type); DBD_ATTRIB_GET_IV(attribs, "TYPE",4, svp, sql_type);
} }
} }
ST(0) = dbd_bind_ph(sth, imp_sth, param, value, sql_type, attribs, FALSE, 0) RETVAL = dbd_bind_ph(sth, imp_sth, param, value, sql_type, attribs, FALSE, 0
? &PL_sv_yes : &PL_sv_no; );
} }
OUTPUT:
RETVAL
void bool
bind_param_inout(sth, param, value_ref, maxlen, attribs=Nullsv) bind_param_inout(sth, param, value_ref, maxlen, attribs=Nullsv)
SV * sth SV * sth
SV * param SV * param
SV * value_ref SV * value_ref
IV maxlen IV maxlen
SV * attribs SV * attribs
CODE: CODE:
{ {
IV sql_type = 0; IV sql_type = 0;
D_imp_sth(sth); D_imp_sth(sth);
skipping to change at line 583 skipping to change at line 599
if (SvNIOK(attribs)) { if (SvNIOK(attribs)) {
sql_type = SvIV(attribs); sql_type = SvIV(attribs);
attribs = Nullsv; attribs = Nullsv;
} }
else { else {
SV **svp; SV **svp;
DBD_ATTRIBS_CHECK("bind_param", sth, attribs); DBD_ATTRIBS_CHECK("bind_param", sth, attribs);
DBD_ATTRIB_GET_IV(attribs, "TYPE",4, svp, sql_type); DBD_ATTRIB_GET_IV(attribs, "TYPE",4, svp, sql_type);
} }
} }
ST(0) = dbd_bind_ph(sth, imp_sth, param, value, sql_type, attribs, TRUE, max RETVAL = dbd_bind_ph(sth, imp_sth, param, value, sql_type, attribs, TRUE, ma
len) xlen);
? &PL_sv_yes : &PL_sv_no;
} }
OUTPUT:
RETVAL
void void
execute(sth, ...) execute(sth, ...)
SV * sth SV * sth
CODE: CODE:
D_imp_sth(sth); D_imp_sth(sth);
IV retval; IV retval;
if (items > 1) { /* need to bind params */ if (items > 1) { /* need to bind params */
if (!dbdxst_bind_params(sth, imp_sth, items, ax) ) { if (!dbdxst_bind_params(sth, imp_sth, items, ax) ) {
XSRETURN_UNDEF; XSRETURN_UNDEF;
skipping to change at line 619 skipping to change at line 636
#ifdef dbd_st_execute_for_fetch #ifdef dbd_st_execute_for_fetch
void void
execute_for_fetch(sth, fetch_tuple_sub, tuple_status = Nullsv) execute_for_fetch(sth, fetch_tuple_sub, tuple_status = Nullsv)
SV * sth SV * sth
SV * fetch_tuple_sub SV * fetch_tuple_sub
SV * tuple_status SV * tuple_status
CODE: CODE:
{ {
D_imp_sth(sth); D_imp_sth(sth);
ST(0) = dbd_st_execute_for_fetch(sth, imp_sth, fetch_tuple_sub, tuple_status SV *ret = dbd_st_execute_for_fetch(sth, imp_sth, fetch_tuple_sub, tuple_stat
); us);
ST(0) = ret;
} }
#endif #endif
#ifdef dbd_st_last_insert_id #ifdef dbd_st_last_insert_id
void void
last_insert_id(sth, catalog=&PL_sv_undef, schema=&PL_sv_undef, table=&PL_sv_unde f, field=&PL_sv_undef, attr=Nullsv) last_insert_id(sth, catalog=&PL_sv_undef, schema=&PL_sv_undef, table=&PL_sv_unde f, field=&PL_sv_undef, attr=Nullsv)
SV * sth SV * sth
SV * catalog SV * catalog
SV * schema SV * schema
SV * table SV * table
SV * field SV * field
SV * attr SV * attr
CODE: CODE:
{ {
D_imp_sth(sth); D_imp_sth(sth);
ST(0) = dbd_st_last_insert_id(sth, imp_sth, catalog, schema, table, field, a SV *ret = dbd_st_last_insert_id(sth, imp_sth, catalog, schema, table, field,
ttr); attr);
ST(0) = ret;
} }
#endif #endif
void void
fetchrow_arrayref(sth) fetchrow_arrayref(sth)
SV * sth SV * sth
ALIAS: ALIAS:
fetch = 1 fetch = 1
CODE: CODE:
skipping to change at line 690 skipping to change at line 709
SV *tmp = dbixst_bounce_method("DBD::~DRIVER~::st::SUPER::fetchall_array ref", 3); SV *tmp = dbixst_bounce_method("DBD::~DRIVER~::st::SUPER::fetchall_array ref", 3);
SPAGAIN; SPAGAIN;
ST(0) = tmp; ST(0) = tmp;
} }
else { else {
SV *tmp = dbdxst_fetchall_arrayref(sth, slice, batch_row_count); SV *tmp = dbdxst_fetchall_arrayref(sth, slice, batch_row_count);
SPAGAIN; SPAGAIN;
ST(0) = tmp; ST(0) = tmp;
} }
void bool
finish(sth) finish(sth)
SV * sth SV * sth
CODE: CODE:
D_imp_sth(sth); D_imp_sth(sth);
D_imp_dbh_from_sth; D_imp_dbh_from_sth;
if (!DBIc_ACTIVE(imp_sth)) { if (!DBIc_ACTIVE(imp_sth)) {
/* No active statement to finish */ /* No active statement to finish */
XSRETURN_YES; XSRETURN_YES;
} }
if (!DBIc_ACTIVE(imp_dbh)) { if (!DBIc_ACTIVE(imp_dbh)) {
/* Either an explicit disconnect() or global destruction */ /* Either an explicit disconnect() or global destruction */
/* has disconnected us from the database. Finish is meaningless */ /* has disconnected us from the database. Finish is meaningless */
DBIc_ACTIVE_off(imp_sth); DBIc_ACTIVE_off(imp_sth);
XSRETURN_YES; XSRETURN_YES;
} }
#ifdef dbd_st_finish3 #ifdef dbd_st_finish3
ST(0) = dbd_st_finish3(sth, imp_sth, 0) ? &PL_sv_yes : &PL_sv_no; RETVAL = dbd_st_finish3(sth, imp_sth, 0);
#else #else
ST(0) = dbd_st_finish(sth, imp_sth) ? &PL_sv_yes : &PL_sv_no; RETVAL = dbd_st_finish(sth, imp_sth);
#endif #endif
OUTPUT:
RETVAL
void void
blob_read(sth, field, offset, len, destrv=Nullsv, destoffset=0) blob_read(sth, field, offset, len, destrv=Nullsv, destoffset=0)
SV * sth SV * sth
int field int field
long offset long offset
long len long len
SV * destrv SV * destrv
long destoffset long destoffset
CODE: CODE:
 End of changes. 37 change blocks. 
38 lines changed or deleted 61 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)