Branch Coverage

dbdimp_virtual_table.inc
Criterion Covered Total %
branch 199 494 40.2


line true false branch
34 0 65 PUSHMARK(SP);
35 0 65 XPUSHs(((perl_vtab *) pVTab)->perl_vtab_obj);
36 0 65 XPUSHs(sv_2mortal(newSViv(i)));
43 65 0 FREETMPS;
58 0 958 if ( is_error ) {
59 0 0 s = SvPV(result, len);
65 7 951 if ( !SvOK(result) ) {
7 0 if ( !SvOK(result) ) {
7 0 if ( !SvOK(result) ) {
67 835 116 } else if ( SvPOK(result) ) {
68 835 0 s = SvPV(result, len);
70 0 116 } else if( SvIOK_UV(result) ) {
72 0 0 sqlite3_result_int64( context, (sqlite3_int64)SvUV(result));
77 0 116 } else if ( !_sqlite_atoi64(SvPV(result, len), &iv) ) {
116 0 } else if ( !_sqlite_atoi64(SvPV(result, len), &iv) ) {
79 0 0 } else if ( SvNOK(result) && ( sizeof(NV) == sizeof(double) || SvNVX(result) == (double) SvNVX(result) ) ) {
80 0 0 sqlite3_result_double( context, SvNV(result));
82 0 0 s = SvPV(result, len);
104 0 20 if( vt==NULL ) return SQLITE_NOMEM;
112 0 20 PUSHMARK(SP);
113 0 20 XPUSHs(sv_2mortal(newSVpv(init_data->perl_class, 0)));
114 0 20 XPUSHs(init_data->dbh);
115 121 20 for(i = 0; i < argc; i++) {
116 0 121 XPUSHs(newSVpvn_flags(argv[i], strlen(argv[i]), SVs_TEMP|SVf_UTF8));
123 0 20 if ( count != 1 ) {
132 0 20 if ( !sv_isobject(perl_vtab_obj) ) {
139 0 20 PUSHMARK(SP);
140 0 20 XPUSHs(perl_vtab_obj);
146 0 20 if (count != 1 ) {
156 20 0 rc = sqlite3_declare_vtab(db, SvPVutf8_nolen(sql));
159 20 0 if (rc == SQLITE_OK) {
169 20 0 FREETMPS;
271 69 84 for (i=0; inConstraint; i++){
277 61 8 hv_stores(constraint, "usable", pCons->usable ? &PL_sv_yes : &PL_sv_no);
283 24 84 for (i=0; inOrderBy; i++){
287 2 22 hv_stores(order, "desc", pOrder->desc ? &PL_sv_yes : &PL_sv_no);
292 0 84 PUSHMARK(SP);
293 0 84 XPUSHs( ((perl_vtab *) pVTab)->perl_vtab_obj);
294 0 84 XPUSHs( sv_2mortal( newRV_noinc((SV*) constraints)));
295 0 84 XPUSHs( sv_2mortal( newRV_noinc((SV*) order_by)));
301 0 84 if (count != 1)
304 84 0 if (!(hashref && SvROK(hashref) && SvTYPE(SvRV(hashref)) == SVt_PVHV))
84 0 if (!(hashref && SvROK(hashref) && SvTYPE(SvRV(hashref)) == SVt_PVHV))
0 84 if (!(hashref && SvROK(hashref) && SvTYPE(SvRV(hashref)) == SVt_PVHV))
308 84 0 pIdxInfo->idxNum = (val && SvOK(*val)) ? SvIV(*val) : 0;
0 84 pIdxInfo->idxNum = (val && SvOK(*val)) ? SvIV(*val) : 0;
0 0 pIdxInfo->idxNum = (val && SvOK(*val)) ? SvIV(*val) : 0;
0 0 pIdxInfo->idxNum = (val && SvOK(*val)) ? SvIV(*val) : 0;
84 0 pIdxInfo->idxNum = (val && SvOK(*val)) ? SvIV(*val) : 0;
310 84 0 if (val && SvOK(*val)) {
0 84 if (val && SvOK(*val)) {
0 0 if (val && SvOK(*val)) {
0 0 if (val && SvOK(*val)) {
312 0 84 char *str = SvPVutf8(*val, len);
319 84 0 pIdxInfo->orderByConsumed = (val && SvTRUE(*val)) ? 1 : 0;
84 0 pIdxInfo->orderByConsumed = (val && SvTRUE(*val)) ? 1 : 0;
0 84 pIdxInfo->orderByConsumed = (val && SvTRUE(*val)) ? 1 : 0;
0 0 pIdxInfo->orderByConsumed = (val && SvTRUE(*val)) ? 1 : 0;
0 84 pIdxInfo->orderByConsumed = (val && SvTRUE(*val)) ? 1 : 0;
0 0 pIdxInfo->orderByConsumed = (val && SvTRUE(*val)) ? 1 : 0;
0 0 pIdxInfo->orderByConsumed = (val && SvTRUE(*val)) ? 1 : 0;
0 84 pIdxInfo->orderByConsumed = (val && SvTRUE(*val)) ? 1 : 0;
0 0 pIdxInfo->orderByConsumed = (val && SvTRUE(*val)) ? 1 : 0;
0 0 pIdxInfo->orderByConsumed = (val && SvTRUE(*val)) ? 1 : 0;
0 0 pIdxInfo->orderByConsumed = (val && SvTRUE(*val)) ? 1 : 0;
0 0 pIdxInfo->orderByConsumed = (val && SvTRUE(*val)) ? 1 : 0;
0 0 pIdxInfo->orderByConsumed = (val && SvTRUE(*val)) ? 1 : 0;
84 0 pIdxInfo->orderByConsumed = (val && SvTRUE(*val)) ? 1 : 0;
84 0 pIdxInfo->orderByConsumed = (val && SvTRUE(*val)) ? 1 : 0;
84 0 pIdxInfo->orderByConsumed = (val && SvTRUE(*val)) ? 1 : 0;
0 84 pIdxInfo->orderByConsumed = (val && SvTRUE(*val)) ? 1 : 0;
0 0 pIdxInfo->orderByConsumed = (val && SvTRUE(*val)) ? 1 : 0;
0 84 pIdxInfo->orderByConsumed = (val && SvTRUE(*val)) ? 1 : 0;
0 0 pIdxInfo->orderByConsumed = (val && SvTRUE(*val)) ? 1 : 0;
321 84 0 pIdxInfo->estimatedCost = (val && SvOK(*val)) ? SvNV(*val) : 0;
0 84 pIdxInfo->estimatedCost = (val && SvOK(*val)) ? SvNV(*val) : 0;
0 0 pIdxInfo->estimatedCost = (val && SvOK(*val)) ? SvNV(*val) : 0;
0 0 pIdxInfo->estimatedCost = (val && SvOK(*val)) ? SvNV(*val) : 0;
84 0 pIdxInfo->estimatedCost = (val && SvOK(*val)) ? SvNV(*val) : 0;
324 84 0 pIdxInfo->estimatedRows = (val && SvOK(*val)) ? SvIV(*val) : 0;
84 0 pIdxInfo->estimatedRows = (val && SvOK(*val)) ? SvIV(*val) : 0;
84 0 pIdxInfo->estimatedRows = (val && SvOK(*val)) ? SvIV(*val) : 0;
0 84 pIdxInfo->estimatedRows = (val && SvOK(*val)) ? SvIV(*val) : 0;
0 0 pIdxInfo->estimatedRows = (val && SvOK(*val)) ? SvIV(*val) : 0;
329 69 84 for (i=0; inConstraint; i++){
331 69 0 if (!(rv && SvROK(*rv) && SvTYPE(SvRV(*rv)) == SVt_PVHV))
69 0 if (!(rv && SvROK(*rv) && SvTYPE(SvRV(*rv)) == SVt_PVHV))
0 69 if (!(rv && SvROK(*rv) && SvTYPE(SvRV(*rv)) == SVt_PVHV))
335 60 9 argvIndex = (val && SvOK(*val)) ? SvIV(*val) + 1: 0;
0 60 argvIndex = (val && SvOK(*val)) ? SvIV(*val) + 1: 0;
0 0 argvIndex = (val && SvOK(*val)) ? SvIV(*val) + 1: 0;
0 0 argvIndex = (val && SvOK(*val)) ? SvIV(*val) + 1: 0;
60 0 argvIndex = (val && SvOK(*val)) ? SvIV(*val) + 1: 0;
340 60 9 pConsUsage->omit = (val && SvTRUE(*val)) ? 1 : 0;
60 0 pConsUsage->omit = (val && SvTRUE(*val)) ? 1 : 0;
0 60 pConsUsage->omit = (val && SvTRUE(*val)) ? 1 : 0;
0 0 pConsUsage->omit = (val && SvTRUE(*val)) ? 1 : 0;
0 60 pConsUsage->omit = (val && SvTRUE(*val)) ? 1 : 0;
0 0 pConsUsage->omit = (val && SvTRUE(*val)) ? 1 : 0;
0 0 pConsUsage->omit = (val && SvTRUE(*val)) ? 1 : 0;
0 60 pConsUsage->omit = (val && SvTRUE(*val)) ? 1 : 0;
0 0 pConsUsage->omit = (val && SvTRUE(*val)) ? 1 : 0;
0 0 pConsUsage->omit = (val && SvTRUE(*val)) ? 1 : 0;
0 0 pConsUsage->omit = (val && SvTRUE(*val)) ? 1 : 0;
0 0 pConsUsage->omit = (val && SvTRUE(*val)) ? 1 : 0;
0 0 pConsUsage->omit = (val && SvTRUE(*val)) ? 1 : 0;
60 0 pConsUsage->omit = (val && SvTRUE(*val)) ? 1 : 0;
60 0 pConsUsage->omit = (val && SvTRUE(*val)) ? 1 : 0;
0 60 pConsUsage->omit = (val && SvTRUE(*val)) ? 1 : 0;
0 0 pConsUsage->omit = (val && SvTRUE(*val)) ? 1 : 0;
0 0 pConsUsage->omit = (val && SvTRUE(*val)) ? 1 : 0;
60 0 pConsUsage->omit = (val && SvTRUE(*val)) ? 1 : 0;
0 0 pConsUsage->omit = (val && SvTRUE(*val)) ? 1 : 0;
344 84 0 FREETMPS;
365 0 122 if( cursor==NULL ) return SQLITE_NOMEM;
369 0 122 PUSHMARK(SP);
370 0 122 XPUSHs( ((perl_vtab *) pVTab)->perl_vtab_obj);
374 0 122 if (count != 1) {
381 0 122 if ( !sv_isobject(perl_cursor) ) {
391 122 0 if (rc == SQLITE_OK) {
400 122 0 FREETMPS;
422 9 113 FREETMPS;
441 0 132 PUSHMARK(SP);
442 0 132 XPUSHs(((perl_vtab_cursor *) pVtabCursor)->perl_cursor_obj);
443 0 132 XPUSHs(sv_2mortal(newSViv(idxNum)));
444 0 132 XPUSHs(sv_2mortal(newSVpv(idxStr, 0)));
445 114 132 for(i = 0; i < argc; i++) {
446 0 114 XPUSHs(stacked_sv_from_sqlite3_value(aTHX_ argv[i], string_mode));
454 132 0 FREETMPS;
470 0 185 PUSHMARK(SP);
471 0 185 XPUSHs(((perl_vtab_cursor *) pVtabCursor)->perl_cursor_obj);
478 185 0 FREETMPS;
494 0 317 PUSHMARK(SP);
495 0 317 XPUSHs(((perl_vtab_cursor *) pVtabCursor)->perl_cursor_obj);
499 0 317 if (count != 1) {
505 317 0 eof = SvTRUE(sv); /* eof = SvTRUE(POPs); # I don't understand why :-( */
0 317 eof = SvTRUE(sv); /* eof = SvTRUE(POPs); # I don't understand why :-( */
0 0 eof = SvTRUE(sv); /* eof = SvTRUE(POPs); # I don't understand why :-( */
0 317 eof = SvTRUE(sv); /* eof = SvTRUE(POPs); # I don't understand why :-( */
0 0 eof = SvTRUE(sv); /* eof = SvTRUE(POPs); # I don't understand why :-( */
0 0 eof = SvTRUE(sv); /* eof = SvTRUE(POPs); # I don't understand why :-( */
317 0 eof = SvTRUE(sv); /* eof = SvTRUE(POPs); # I don't understand why :-( */
317 0 eof = SvTRUE(sv); /* eof = SvTRUE(POPs); # I don't understand why :-( */
317 0 eof = SvTRUE(sv); /* eof = SvTRUE(POPs); # I don't understand why :-( */
72 245 eof = SvTRUE(sv); /* eof = SvTRUE(POPs); # I don't understand why :-( */
72 0 eof = SvTRUE(sv); /* eof = SvTRUE(POPs); # I don't understand why :-( */
72 245 eof = SvTRUE(sv); /* eof = SvTRUE(POPs); # I don't understand why :-( */
0 0 eof = SvTRUE(sv); /* eof = SvTRUE(POPs); # I don't understand why :-( */
0 0 eof = SvTRUE(sv); /* eof = SvTRUE(POPs); # I don't understand why :-( */
0 0 eof = SvTRUE(sv); /* eof = SvTRUE(POPs); # I don't understand why :-( */
0 0 eof = SvTRUE(sv); /* eof = SvTRUE(POPs); # I don't understand why :-( */
0 0 eof = SvTRUE(sv); /* eof = SvTRUE(POPs); # I don't understand why :-( */
0 0 eof = SvTRUE(sv); /* eof = SvTRUE(POPs); # I don't understand why :-( */
0 0 eof = SvTRUE(sv); /* eof = SvTRUE(POPs); # I don't understand why :-( */
509 317 0 FREETMPS;
528 0 958 PUSHMARK(SP);
529 0 958 XPUSHs(((perl_vtab_cursor *) pVtabCursor)->perl_cursor_obj);
530 0 958 XPUSHs(sv_2mortal(newSViv(col)));
534 0 958 if (count != 1) {
546 958 0 FREETMPS;
563 0 88 PUSHMARK(SP);
564 0 88 XPUSHs(((perl_vtab_cursor *) pVtabCursor)->perl_cursor_obj);
568 0 88 if (count != 1) {
573 88 0 *pRowid =POPi;
578 88 0 FREETMPS;
599 0 5 PUSHMARK(SP);
600 0 5 XPUSHs(((perl_vtab *) pVTab)->perl_vtab_obj);
601 17 5 for(i = 0; i < argc; i++) {
602 0 17 XPUSHs(stacked_sv_from_sqlite3_value(aTHX_ argv[i], string_mode));
607 0 5 if (count != 1) {
612 5 0 if (argc > 1 && sqlite3_value_type(argv[0]) == SQLITE_NULL
5 0 if (argc > 1 && sqlite3_value_type(argv[0]) == SQLITE_NULL
613 5 0 && sqlite3_value_type(argv[1]) == SQLITE_NULL) {
617 0 5 if (!SvOK(rowidsv))
0 0 if (!SvOK(rowidsv))
0 0 if (!SvOK(rowidsv))
619 0 5 else if (SvUOK(rowidsv))
620 0 0 *pRowid = SvUV(rowidsv);
621 5 0 else if (SvIOK(rowidsv))
622 5 0 *pRowid = SvIV(rowidsv);
624 0 0 *pRowid = (sqlite3_int64)SvNV(rowidsv);
631 5 0 FREETMPS;
673 6 7 if (hv_exists(functions, func_name, len)) {
675 6 0 if (val && SvOK(*val)) {
1 5 if (val && SvOK(*val)) {
1 0 if (val && SvOK(*val)) {
0 1 if (val && SvOK(*val)) {
681 0 7 PUSHMARK(SP);
682 0 7 XPUSHs(((perl_vtab *) pVTab)->perl_vtab_obj);
683 0 7 XPUSHs(sv_2mortal(newSViv(nArg)));
684 0 7 XPUSHs(sv_2mortal(newSVpv(zName, 0)));
688 0 7 if (count != 1) {
694 7 0 if (SvTRUE(result)) {
0 7 if (SvTRUE(result)) {
2 5 if (SvTRUE(result)) {
2 0 if (SvTRUE(result)) {
0 2 if (SvTRUE(result)) {
0 5 if (SvTRUE(result)) {
0 0 if (SvTRUE(result)) {
0 0 if (SvTRUE(result)) {
0 0 if (SvTRUE(result)) {
0 0 if (SvTRUE(result)) {
1 4 if (SvTRUE(result)) {
1 0 if (SvTRUE(result)) {
1 0 if (SvTRUE(result)) {
0 1 if (SvTRUE(result)) {
0 0 if (SvTRUE(result)) {
4 3 if (SvTRUE(result)) {
701 4 3 hv_store(functions, func_name, len, coderef ? coderef : &PL_sv_undef, 0);
705 9 4 is_overloaded = coderef && SvTRUE(coderef);
9 0 is_overloaded = coderef && SvTRUE(coderef);
0 9 is_overloaded = coderef && SvTRUE(coderef);
0 0 is_overloaded = coderef && SvTRUE(coderef);
0 9 is_overloaded = coderef && SvTRUE(coderef);
0 0 is_overloaded = coderef && SvTRUE(coderef);
0 0 is_overloaded = coderef && SvTRUE(coderef);
0 9 is_overloaded = coderef && SvTRUE(coderef);
0 0 is_overloaded = coderef && SvTRUE(coderef);
0 0 is_overloaded = coderef && SvTRUE(coderef);
0 0 is_overloaded = coderef && SvTRUE(coderef);
0 0 is_overloaded = coderef && SvTRUE(coderef);
0 0 is_overloaded = coderef && SvTRUE(coderef);
0 9 is_overloaded = coderef && SvTRUE(coderef);
0 0 is_overloaded = coderef && SvTRUE(coderef);
0 0 is_overloaded = coderef && SvTRUE(coderef);
0 0 is_overloaded = coderef && SvTRUE(coderef);
0 0 is_overloaded = coderef && SvTRUE(coderef);
0 0 is_overloaded = coderef && SvTRUE(coderef);
9 0 is_overloaded = coderef && SvTRUE(coderef);
706 9 4 if (is_overloaded) {
715 7 6 FREETMPS;
731 0 0 PUSHMARK(SP);
732 0 0 XPUSHs(((perl_vtab *) pVTab)->perl_vtab_obj);
733 0 0 XPUSHs(sv_2mortal(newSVpv(zNew, 0)));
737 0 0 if (count != 1) {
742 0 0 rc = POPi;
746 0 0 FREETMPS;
808 0 13 PUSHMARK(SP);
809 0 13 XPUSHs(sv_2mortal(newSVpv(init_data->perl_class, 0)));
821 13 0 FREETMPS;
840 0 13 if (!DBIc_ACTIVE(imp_dbh)) {
847 7 6 if (!get_av(module_ISA, 0)) {
867 0 13 if ( rc != SQLITE_OK ) {
875 0 13 PUSHMARK(SP);
876 0 13 XPUSHs(sv_2mortal(newSVpv(perl_class, 0)));
877 0 13 XPUSHs(sv_2mortal(newSVpv(name, 0)));
884 13 0 FREETMPS;