Branch Coverage

SQLeet.xsi
Criterion Covered Total %
branch 213 502 42.4


line true false branch
40 0 101 DBISTATE_INIT;
71 0 95 ST(0) = dbd_discon_all(drh, imp_drh) ? &PL_sv_yes : &PL_sv_no;
117 50 203 char *u = (SvOK(username)) ? SvPV(username,lna) : (char*)"";
50 0 char *u = (SvOK(username)) ? SvPV(username,lna) : (char*)"";
0 50 char *u = (SvOK(username)) ? SvPV(username,lna) : (char*)"";
203 0 char *u = (SvOK(username)) ? SvPV(username,lna) : (char*)"";
118 50 203 char *p = (SvOK(password)) ? SvPV(password,lna) : (char*)"";
50 0 char *p = (SvOK(password)) ? SvPV(password,lna) : (char*)"";
0 50 char *p = (SvOK(password)) ? SvPV(password,lna) : (char*)"";
203 0 char *p = (SvOK(password)) ? SvPV(password,lna) : (char*)"";
123 253 0 ST(0) = dbd_db_login6(dbh, imp_dbh, SvPV_nolen(dbname), u, p, attribs) ? &PL_sv_yes : &PL_sv_no;
247 6 ST(0) = dbd_db_login6(dbh, imp_dbh, SvPV_nolen(dbname), u, p, attribs) ? &PL_sv_yes : &PL_sv_no;
141 69 253 if (items > 2) {
143 47 22 if (SvROK(attr) &&
43 4 if (SvROK(attr) &&
0 43 if (SvROK(attr) &&
0 43 if (SvROK(attr) &&
0 43 if (SvROK(attr) &&
0 43 if (SvROK(attr) &&
0 0 if (SvROK(attr) &&
0 0 if (SvROK(attr) &&
0 0 if (SvROK(attr) &&
0 0 if (SvROK(attr) &&
144 47 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
47 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
47 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
43 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 43 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
4 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
4 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
4 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 4 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
0 0 (DBD_ATTRIB_TRUE(attr,"Slice",5,tmp_svp) || DBD_ATTRIB_TRUE(attr,"Columns",7,tmp_svp))
154 0 279 if (SvROK(ST(1))) {
158 0 0 if ( (mg = mg_find(SvRV(sth),'P')) )
164 0 279 if (!SvROK(sth))
171 26 253 if (items > 3) { /* need to bind params before execute */
172 0 26 if (!dbdxst_bind_params(sth, imp_sth, items-2, ax+2) ) {
178 0 279 if ( dbd_st_execute(sth, imp_sth) <= -2 ) { /* -2 == error */
182 279 0 maxrows_svp = DBD_ATTRIB_GET_SVP(attr, "MaxRows", 7);
4 275 maxrows_svp = DBD_ATTRIB_GET_SVP(attr, "MaxRows", 7);
4 0 maxrows_svp = DBD_ATTRIB_GET_SVP(attr, "MaxRows", 7);
183 0 279 tmp_sv = dbdxst_fetchall_arrayref(sth, &PL_sv_undef, (maxrows_svp) ? *maxrows_svp : &PL_sv_undef);
198 4 226 if (SvROK(ST(1))) {
202 4 0 if ( (mg = mg_find(SvRV(sth),'P')) )
209 2 224 if (!SvROK(sth)) {
210 0 2 if (is_selectrow_array) { XSRETURN_EMPTY; } else { XSRETURN_UNDEF; }
217 35 193 if (items > 3) { /* need to bind params before execute */
218 0 35 if (!dbdxst_bind_params(sth, imp_sth, items-2, ax+2) ) {
219 0 0 if (is_selectrow_array) { XSRETURN_EMPTY; } else { XSRETURN_UNDEF; }
224 6 222 if ( dbd_st_execute(sth, imp_sth) <= -2 ) { /* -2 == error */
225 0 6 if (is_selectrow_array) { XSRETURN_EMPTY; } else { XSRETURN_UNDEF; }
229 4 218 if (!row_av) {
230 4 0 if (GIMME == G_SCALAR)
0 4 if (GIMME == G_SCALAR)
233 39 179 else if (is_selectrow_array) {
235 0 39 int num_fields = AvFILL(row_av)+1;
236 39 0 if (GIMME == G_SCALAR)
5 34 if (GIMME == G_SCALAR)
238 39 0 EXTEND(sp, num_fields);
0 39 EXTEND(sp, num_fields);
239 40 39 for(i=0; i < num_fields; ++i) {
310 2 74 if (DBIc_has(imp_dbh,DBIcf_AutoCommit) && DBIc_WARN(imp_dbh))
2 0 if (DBIc_has(imp_dbh,DBIcf_AutoCommit) && DBIc_WARN(imp_dbh))
312 70 6 ST(0) = dbd_db_commit(dbh, imp_dbh) ? &PL_sv_yes : &PL_sv_no;
320 2 21 if (DBIc_has(imp_dbh,DBIcf_AutoCommit) && DBIc_WARN(imp_dbh))
2 0 if (DBIc_has(imp_dbh,DBIcf_AutoCommit) && DBIc_WARN(imp_dbh))
322 21 2 ST(0) = dbd_db_rollback(dbh, imp_dbh) ? &PL_sv_yes : &PL_sv_no;
330 2 89 if ( !DBIc_ACTIVE(imp_dbh) ) {
335 1 88 if (DBIc_ACTIVE_KIDS(imp_dbh) && DBIc_WARN(imp_dbh) && !PL_dirty) {
1 0 if (DBIc_ACTIVE_KIDS(imp_dbh) && DBIc_WARN(imp_dbh) && !PL_dirty) {
1 0 if (DBIc_ACTIVE_KIDS(imp_dbh) && DBIc_WARN(imp_dbh) && !PL_dirty) {
337 1 0 char *plural = (DBIc_ACTIVE_KIDS(imp_dbh)==1) ? (char*)"" : (char*)"s";
338 0 1 warn("%s->disconnect invalidates %d active statement handle%s %s",
342 89 0 ST(0) = dbd_db_disconnect(dbh, imp_dbh) ? &PL_sv_yes : &PL_sv_no;
343 0 89 DBIc_ACTIVE_off(imp_dbh); /* ensure it's off, regardless */
0 0 DBIc_ACTIVE_off(imp_dbh); /* ensure it's off, regardless */
0 0 DBIc_ACTIVE_off(imp_dbh); /* ensure it's off, regardless */
0 0 DBIc_ACTIVE_off(imp_dbh); /* ensure it's off, regardless */
0 0 DBIc_ACTIVE_off(imp_dbh); /* ensure it's off, regardless */
353 0 1328 if (SvGMAGICAL(valuesv))
356 960 368 if (!dbd_db_STORE_attrib(dbh, imp_dbh, keysv, valuesv))
357 16 944 if (!DBIc_DBISTATE(imp_dbh)->set_attr(dbh, keysv, valuesv))
368 287 2896 if (!valuesv)
380 6 247 if (!DBIc_IMPSET(imp_dbh)) { /* was never fully set up */
382 6 0 if (DBIc_WARN(imp_dbh) && !PL_dirty && DBIc_DBISTATE(imp_dbh)->debug >= 2)
6 0 if (DBIc_WARN(imp_dbh) && !PL_dirty && DBIc_DBISTATE(imp_dbh)->debug >= 2)
0 6 if (DBIc_WARN(imp_dbh) && !PL_dirty && DBIc_DBISTATE(imp_dbh)->debug >= 2)
383 0 0 PerlIO_printf(DBIc_LOGPIO(imp_dbh),
388 2 245 if (DBIc_IADESTROY(imp_dbh)) { /* wants ineffective destroy */
389 0 2 DBIc_ACTIVE_off(imp_dbh);
0 0 DBIc_ACTIVE_off(imp_dbh);
0 0 DBIc_ACTIVE_off(imp_dbh);
0 0 DBIc_ACTIVE_off(imp_dbh);
0 0 DBIc_ACTIVE_off(imp_dbh);
390 0 2 if (DBIc_DBISTATE(imp_dbh)->debug)
391 0 0 PerlIO_printf(DBIc_LOGPIO(imp_dbh), " DESTROY %s skipped due to InactiveDestroy\n", SvPV_nolen(dbh));
393 156 91 if (DBIc_ACTIVE(imp_dbh)) {
394 5 151 if (!DBIc_has(imp_dbh,DBIcf_AutoCommit)) {
405 4 1 if (DBIc_WARN(imp_dbh) /* only warn if likely to be useful... */
406 0 4 && DBIc_is(imp_dbh, DBIcf_Executed) /* has not just called commit/rollback */
408 0 0 && (!PL_dirty || DBIc_DBISTATE(imp_dbh)->debug >= 3)
0 0 && (!PL_dirty || DBIc_DBISTATE(imp_dbh)->debug >= 3)
410 0 0 warn("Issuing rollback() due to DESTROY without explicit disconnect() of %s handle %s",
0 0 warn("Issuing rollback() due to DESTROY without explicit disconnect() of %s handle %s",
418 0 156 DBIc_ACTIVE_off(imp_dbh); /* ensure it's off, regardless */
0 0 DBIc_ACTIVE_off(imp_dbh); /* ensure it's off, regardless */
0 0 DBIc_ACTIVE_off(imp_dbh); /* ensure it's off, regardless */
0 0 DBIc_ACTIVE_off(imp_dbh); /* ensure it's off, regardless */
0 0 DBIc_ACTIVE_off(imp_dbh); /* ensure it's off, regardless */
485 775 342 DBD_ATTRIBS_CHECK("_prepare", sth, attribs);
675 100 DBD_ATTRIBS_CHECK("_prepare", sth, attribs);
675 0 DBD_ATTRIBS_CHECK("_prepare", sth, attribs);
0 675 DBD_ATTRIBS_CHECK("_prepare", sth, attribs);
100 0 DBD_ATTRIBS_CHECK("_prepare", sth, attribs);
0 100 DBD_ATTRIBS_CHECK("_prepare", sth, attribs);
0 0 DBD_ATTRIBS_CHECK("_prepare", sth, attribs);
0 0 DBD_ATTRIBS_CHECK("_prepare", sth, attribs);
487 1107 10 ST(0) = dbd_st_prepare_sv(sth, imp_sth, statement, attribs) ? &PL_sv_yes : &PL_sv_no;
518 0 223 if (SvGMAGICAL(ref))
520 133 90 if (attribs) {
521 1 132 if (SvNIOK(attribs)) {
522 1 0 sql_type = SvIV(attribs);
527 132 0 DBD_ATTRIBS_CHECK("bind_col", sth, attribs);
131 1 DBD_ATTRIBS_CHECK("bind_col", sth, attribs);
131 0 DBD_ATTRIBS_CHECK("bind_col", sth, attribs);
0 131 DBD_ATTRIBS_CHECK("bind_col", sth, attribs);
1 0 DBD_ATTRIBS_CHECK("bind_col", sth, attribs);
0 1 DBD_ATTRIBS_CHECK("bind_col", sth, attribs);
0 0 DBD_ATTRIBS_CHECK("bind_col", sth, attribs);
0 0 DBD_ATTRIBS_CHECK("bind_col", sth, attribs);
529 1 131 DBD_ATTRIB_GET_IV(attribs, "TYPE",4, svp, sql_type);
1 0 DBD_ATTRIB_GET_IV(attribs, "TYPE",4, svp, sql_type);
1 0 DBD_ATTRIB_GET_IV(attribs, "TYPE",4, svp, sql_type);
1 131 DBD_ATTRIB_GET_IV(attribs, "TYPE",4, svp, sql_type);
1 0 DBD_ATTRIB_GET_IV(attribs, "TYPE",4, svp, sql_type);
537 223 0 ? &PL_sv_yes : &PL_sv_no;
556 0 271 if (SvGMAGICAL(value))
558 229 42 if (attribs) {
559 162 67 if (SvNIOK(attribs)) {
560 162 0 sql_type = SvIV(attribs);
565 67 0 DBD_ATTRIBS_CHECK("bind_param", sth, attribs);
64 3 DBD_ATTRIBS_CHECK("bind_param", sth, attribs);
64 0 DBD_ATTRIBS_CHECK("bind_param", sth, attribs);
0 64 DBD_ATTRIBS_CHECK("bind_param", sth, attribs);
3 0 DBD_ATTRIBS_CHECK("bind_param", sth, attribs);
0 3 DBD_ATTRIBS_CHECK("bind_param", sth, attribs);
0 0 DBD_ATTRIBS_CHECK("bind_param", sth, attribs);
0 0 DBD_ATTRIBS_CHECK("bind_param", sth, attribs);
567 3 64 DBD_ATTRIB_GET_IV(attribs, "TYPE",4, svp, sql_type);
3 0 DBD_ATTRIB_GET_IV(attribs, "TYPE",4, svp, sql_type);
3 0 DBD_ATTRIB_GET_IV(attribs, "TYPE",4, svp, sql_type);
3 64 DBD_ATTRIB_GET_IV(attribs, "TYPE",4, svp, sql_type);
3 0 DBD_ATTRIB_GET_IV(attribs, "TYPE",4, svp, sql_type);
571 270 1 ? &PL_sv_yes : &PL_sv_no;
587 0 0 if (!SvROK(value_ref) || SvTYPE(SvRV(value_ref)) > SVt_PVMG)
0 0 if (!SvROK(value_ref) || SvTYPE(SvRV(value_ref)) > SVt_PVMG)
590 0 0 if (SvREADONLY(value))
592 0 0 if (SvGMAGICAL(value))
594 0 0 if (attribs) {
595 0 0 if (SvNIOK(attribs)) {
596 0 0 sql_type = SvIV(attribs);
601 0 0 DBD_ATTRIBS_CHECK("bind_param", sth, attribs);
0 0 DBD_ATTRIBS_CHECK("bind_param", sth, attribs);
0 0 DBD_ATTRIBS_CHECK("bind_param", sth, attribs);
0 0 DBD_ATTRIBS_CHECK("bind_param", sth, attribs);
0 0 DBD_ATTRIBS_CHECK("bind_param", sth, attribs);
0 0 DBD_ATTRIBS_CHECK("bind_param", sth, attribs);
0 0 DBD_ATTRIBS_CHECK("bind_param", sth, attribs);
0 0 DBD_ATTRIBS_CHECK("bind_param", sth, attribs);
602 0 0 DBD_ATTRIB_GET_IV(attribs, "TYPE",4, svp, sql_type);
0 0 DBD_ATTRIB_GET_IV(attribs, "TYPE",4, svp, sql_type);
0 0 DBD_ATTRIB_GET_IV(attribs, "TYPE",4, svp, sql_type);
0 0 DBD_ATTRIB_GET_IV(attribs, "TYPE",4, svp, sql_type);
0 0 DBD_ATTRIB_GET_IV(attribs, "TYPE",4, svp, sql_type);
606 0 0 ? &PL_sv_yes : &PL_sv_no;
616 357 583 if (items > 1) { /* need to bind params */
617 0 357 if (!dbdxst_bind_params(sth, imp_sth, items, ax) ) {
625 450 490 if (retval == 0) /* ok with no rows affected */
627 11 479 else if (retval < -1) /* -1 == unknown number of rows */
678 856 301 ST(0) = (av) ? sv_2mortal(newRV((SV *)av)) : &PL_sv_undef;
690 34 10 if (av) {
692 0 34 int num_fields = AvFILL(av)+1;
693 34 0 EXTEND(sp, num_fields);
0 34 EXTEND(sp, num_fields);
694 50 34 for(i=0; i < num_fields; ++i) {
707 18 43 if (SvOK(slice)) { /* fallback to perl implementation */
18 0 if (SvOK(slice)) { /* fallback to perl implementation */
0 18 if (SvOK(slice)) { /* fallback to perl implementation */
725 44 17 if (!DBIc_ACTIVE(imp_sth)) {
729 0 17 if (!DBIc_ACTIVE(imp_dbh)) {
732 0 0 DBIc_ACTIVE_off(imp_sth);
0 0 DBIc_ACTIVE_off(imp_sth);
0 0 DBIc_ACTIVE_off(imp_sth);
0 0 DBIc_ACTIVE_off(imp_sth);
0 0 DBIc_ACTIVE_off(imp_sth);
736 17 0 ST(0) = dbd_st_finish3(sth, imp_sth, 0) ? &PL_sv_yes : &PL_sv_no;
753 0 0 if (!destrv)
755 0 0 if (dbd_st_blob_read(sth, imp_sth, field, offset, len, destrv, destoffset))
768 0 5 if (SvGMAGICAL(valuesv))
771 5 0 if (!dbd_st_STORE_attrib(sth, imp_sth, keysv, valuesv))
772 0 5 if (!DBIc_DBISTATE(imp_sth)->set_attr(sth, keysv, valuesv))
788 199 658 if (!valuesv)
800 10 1107 if (!DBIc_IMPSET(imp_sth)) { /* was never fully set up */
802 10 0 if (DBIc_WARN(imp_sth) && !PL_dirty && DBIc_DBISTATE(imp_sth)->debug >= 2)
10 0 if (DBIc_WARN(imp_sth) && !PL_dirty && DBIc_DBISTATE(imp_sth)->debug >= 2)
0 10 if (DBIc_WARN(imp_sth) && !PL_dirty && DBIc_DBISTATE(imp_sth)->debug >= 2)
803 0 0 PerlIO_printf(DBIc_LOGPIO(imp_sth),
808 0 1107 if (DBIc_IADESTROY(imp_sth)) { /* wants ineffective destroy */
809 0 0 DBIc_ACTIVE_off(imp_sth);
0 0 DBIc_ACTIVE_off(imp_sth);
0 0 DBIc_ACTIVE_off(imp_sth);
0 0 DBIc_ACTIVE_off(imp_sth);
0 0 DBIc_ACTIVE_off(imp_sth);
810 0 0 if (DBIc_DBISTATE(imp_sth)->debug)
811 0 0 PerlIO_printf(DBIc_LOGPIO(imp_sth), " DESTROY %s skipped due to InactiveDestroy\n", SvPV_nolen(sth));
813 58 1049 if (DBIc_ACTIVE(imp_sth)) {
815 58 0 if (!PL_dirty && DBIc_ACTIVE(imp_dbh)) {
57 1 if (!PL_dirty && DBIc_ACTIVE(imp_dbh)) {
823 1 0 DBIc_ACTIVE_off(imp_sth);
1 0 DBIc_ACTIVE_off(imp_sth);
1 0 DBIc_ACTIVE_off(imp_sth);
1 0 DBIc_ACTIVE_off(imp_sth);
0 1 DBIc_ACTIVE_off(imp_sth);