| line |
true |
false |
branch |
|
30
|
6 |
96 |
if (*off >= buf_len) |
|
34
|
80 |
16 |
if (!(b & 0x80)) break; |
|
36
|
0 |
16 |
if (shift >= 64) croak("varint exceeds 64 bits"); |
|
53
|
0 |
1521 |
if (items % 2 == 0) |
|
56
|
1520 |
1521 |
for (i = 1; i < items; i += 2) { |
|
59
|
1520 |
0 |
if (klen == 7 && memcmp(key, "columns", 7) == 0) |
|
|
1520 |
0 |
if (klen == 7 && memcmp(key, "columns", 7) == 0) |
|
63
|
1520 |
1 |
if (!cols_sv || !SvROK(cols_sv) || SvTYPE(SvRV(cols_sv)) != SVt_PVAV) |
|
|
1519 |
1 |
if (!cols_sv || !SvROK(cols_sv) || SvTYPE(SvRV(cols_sv)) != SVt_PVAV) |
|
|
0 |
1519 |
if (!cols_sv || !SvROK(cols_sv) || SvTYPE(SvRV(cols_sv)) != SVt_PVAV) |
|
75
|
0 |
1519 |
Newxz(enc->columns, n, Column); |
|
78
|
4205 |
1491 |
for (i = 0; i < n; i++) { |
|
85
|
4205 |
0 |
if (!col_sv || !SvROK(*col_sv) || SvTYPE(SvRV(*col_sv)) != SVt_PVAV) |
|
|
4205 |
0 |
if (!col_sv || !SvROK(*col_sv) || SvTYPE(SvRV(*col_sv)) != SVt_PVAV) |
|
|
0 |
4205 |
if (!col_sv || !SvROK(*col_sv) || SvTYPE(SvRV(*col_sv)) != SVt_PVAV) |
|
92
|
4205 |
0 |
if (!name_sv || !type_sv) |
|
|
2 |
4203 |
if (!name_sv || !type_sv) |
|
127
|
0 |
2053 |
if (!sv_isobject(self)) croak("Not an object"); |
|
128
|
2051 |
2 |
if (!SvROK(rows) || SvTYPE(SvRV(rows)) != SVt_PVAV) |
|
|
0 |
2051 |
if (!SvROK(rows) || SvTYPE(SvRV(rows)) != SVt_PVAV) |
|
150
|
0 |
4 |
if (!sv_isobject(self)) croak("Not an object"); |
|
151
|
2 |
2 |
if (!SvROK(target_ref)) |
|
153
|
2 |
0 |
if (!SvROK(rows) || SvTYPE(SvRV(rows)) != SVt_PVAV) |
|
|
0 |
2 |
if (!SvROK(rows) || SvTYPE(SvRV(rows)) != SVt_PVAV) |
|
162
|
0 |
2 |
if (!SvOK(target)) sv_setpvn(target, "", 0); |
|
178
|
0 |
5 |
if (!sv_isobject(self)) croak("Not an object"); |
|
179
|
5 |
0 |
if (!SvROK(rows) || SvTYPE(SvRV(rows)) != SVt_PVAV) |
|
|
0 |
5 |
if (!SvROK(rows) || SvTYPE(SvRV(rows)) != SVt_PVAV) |
|
182
|
0 |
5 |
if (!io) croak("encode_to_handle: not a filehandle"); |
|
184
|
1 |
4 |
if (!pio) croak("encode_to_handle: filehandle not open for writing"); |
|
190
|
1 |
3 |
if (PerlIO_write(pio, buf.ptr, buf.len) != (SSize_t)buf.len) |
|
209
|
0 |
8 |
if (!sv_isobject(self)) croak("Not an object"); |
|
210
|
7 |
1 |
if (!SvROK(cols_hv) || SvTYPE(SvRV(cols_hv)) != SVt_PVHV) |
|
|
0 |
7 |
if (!SvROK(cols_hv) || SvTYPE(SvRV(cols_hv)) != SVt_PVHV) |
|
217
|
14 |
2 |
for (c = 0; c < enc->num_columns; c++) { |
|
220
|
12 |
2 |
if (!slot || !SvOK(*slot)) |
|
|
0 |
12 |
if (!slot || !SvOK(*slot)) |
|
223
|
11 |
1 |
if (!SvROK(*slot) || SvTYPE(SvRV(*slot)) != SVt_PVAV) |
|
|
0 |
11 |
if (!SvROK(*slot) || SvTYPE(SvRV(*slot)) != SVt_PVAV) |
|
228
|
6 |
5 |
if (num_rows == -1) num_rows = n; |
|
229
|
2 |
3 |
else if (n != num_rows) |
|
234
|
0 |
2 |
if (num_rows == -1) num_rows = 0; |
|
241
|
5 |
2 |
for (c = 0; c < enc->num_columns; c++) { |
|
250
|
15 |
5 |
for (r = 0; r < num_rows; r++) { |
|
252
|
15 |
0 |
if (e) { |
|
285
|
0 |
2 |
if (!sv_isobject(self)) croak("Not an object"); |
|
286
|
2 |
0 |
if (!SvROK(iter) || SvTYPE(SvRV(iter)) != SVt_PVCV) |
|
|
0 |
2 |
if (!SvROK(iter) || SvTYPE(SvRV(iter)) != SVt_PVCV) |
|
288
|
2 |
0 |
if (!SvROK(writer) || SvTYPE(SvRV(writer)) != SVt_PVCV) |
|
|
0 |
2 |
if (!SvROK(writer) || SvTYPE(SvRV(writer)) != SVt_PVCV) |
|
292
|
2 |
0 |
if (items > 3) { |
|
294
|
2 |
2 |
for (i = 3; i < items - 1; i += 2) { |
|
297
|
2 |
0 |
if (klen == 10 && memcmp(key, "batch_size", 10) == 0) |
|
|
2 |
0 |
if (klen == 10 && memcmp(key, "batch_size", 10) == 0) |
|
300
|
0 |
2 |
if (batch_size < 1) batch_size = 1; |
|
309
|
0 |
50027 |
PUSHMARK(SP); PUTBACK; |
|
312
|
50027 |
0 |
SV *row = (n > 0) ? POPs : &PL_sv_undef; |
|
314
|
50025 |
2 |
if (got) SvREFCNT_inc(row); |
|
316
|
50027 |
0 |
FREETMPS; LEAVE; |
|
318
|
2 |
50025 |
if (!got) break; |
|
320
|
52 |
49973 |
if (av_len(batch) + 1 >= batch_size) { |
|
326
|
1 |
1 |
if (av_len(batch) >= 0) |
|
343
|
0 |
19 |
if (!sv_isobject(self)) croak("Not an object"); |
|
344
|
19 |
0 |
if (!SvROK(writer) || SvTYPE(SvRV(writer)) != SVt_PVCV) |
|
|
0 |
19 |
if (!SvROK(writer) || SvTYPE(SvRV(writer)) != SVt_PVCV) |
|
347
|
19 |
0 |
if (items > 2) { |
|
349
|
23 |
19 |
for (i = 2; i < items - 1; i += 2) { |
|
352
|
19 |
4 |
if (klen == 10 && memcmp(key, "batch_size", 10) == 0) { |
|
|
19 |
0 |
if (klen == 10 && memcmp(key, "batch_size", 10) == 0) { |
|
355
|
3 |
1 |
else if (klen == 8 && memcmp(key, "compress", 8) == 0 |
|
|
3 |
0 |
else if (klen == 8 && memcmp(key, "compress", 8) == 0 |
|
356
|
3 |
0 |
&& SvOK(ST(i+1))) { |
|
359
|
1 |
0 |
else if (klen == 6 && memcmp(key, "hasher", 6) == 0 |
|
|
1 |
0 |
else if (klen == 6 && memcmp(key, "hasher", 6) == 0 |
|
360
|
1 |
0 |
&& SvROK(ST(i+1)) |
|
361
|
1 |
0 |
&& SvTYPE(SvRV(ST(i+1))) == SVt_PVCV) { |
|
365
|
0 |
19 |
if (batch_size < 1) batch_size = 1; |
|
384
|
3 |
16 |
if (compress_mode |
|
385
|
3 |
0 |
&& !(compress_mode_len == 0) |
|
386
|
1 |
2 |
&& !(compress_mode_len == 4 && memcmp(compress_mode, "none", 4) == 0) |
|
|
0 |
1 |
&& !(compress_mode_len == 4 && memcmp(compress_mode, "none", 4) == 0) |
|
387
|
2 |
0 |
&& !(compress_mode_len == 3 && memcmp(compress_mode, "raw", 3) == 0)) { |
|
|
2 |
0 |
&& !(compress_mode_len == 3 && memcmp(compress_mode, "raw", 3) == 0)) { |
|
392
|
1 |
18 |
if (hasher_sv) s->hasher_sv = newSVsv(hasher_sv); |
|
411
|
0 |
40 |
if (!sv_isobject(self)) |
|
417
|
78 |
40 |
for (i = 0; i < enc->num_columns; i++) { |
|
435
|
0 |
1491 |
if (!sv_isobject(self)) return; |
|
459
|
71 |
156 |
if (items >= 3) { |
|
461
|
1 |
70 |
if (signed_off < 0) |
|
466
|
67 |
159 |
if (items >= 4 && SvOK(ST(3))) { |
|
|
25 |
42 |
if (items >= 4 && SvOK(ST(3))) { |
|
467
|
24 |
1 |
if (!SvROK(ST(3)) || SvTYPE(SvRV(ST(3))) != SVt_PVHV) |
|
|
1 |
23 |
if (!SvROK(ST(3)) || SvTYPE(SvRV(ST(3))) != SVt_PVHV) |
|
468
|
1 |
1 |
croak("decode_block: columns filter must be a hashref " |
|
483
|
220 |
0 |
if (ncols > 0) av_extend(cols, ncols - 1); |
|
485
|
1330 |
190 |
for (c = 0; c < ncols; c++) { |
|
497
|
559 |
761 |
if (keep_set && !hv_exists(keep_set, name, name_len)) |
|
|
524 |
35 |
if (keep_set && !hv_exists(keep_set, name, name_len)) |
|
501
|
796 |
524 |
if (keep) { |
|
511
|
515 |
0 |
if (nrows > 0) { |
|
514
|
49545 |
515 |
for (r = 0; r < (SSize_t)nrows; r++) |
|
527
|
515 |
785 |
if (!keep) (void)hv_stores(col_hv, "skipped", newSViv(1)); |
|
557
|
5 |
1 |
if (items >= 3) { |
|
559
|
0 |
5 |
if (signed_off < 0) |
|
576
|
5 |
0 |
if (ncols > 0) { av_extend(names, ncols - 1); av_extend(types, ncols - 1); } |
|
577
|
5 |
0 |
if (nrows > 0) av_extend(rows, nrows - 1); |
|
582
|
5 |
0 |
if (nrows > 0) { |
|
583
|
0 |
5 |
Newx(row_avs, nrows, AV *); |
|
586
|
12 |
5 |
for (r = 0; r < nrows; r++) { |
|
588
|
12 |
0 |
if (ncols > 0) av_extend(row_av, ncols - 1); |
|
595
|
22 |
5 |
for (c = 0; c < ncols; c++) { |
|
606
|
47 |
22 |
for (r = 0; r < nrows; r++) { |
|
608
|
47 |
0 |
av_store(row_avs[r], c, e ? SvREFCNT_inc(*e) : newSV(0)); |
|
647
|
0 |
40 |
if (items >= 2 && SvPOK(class_or_bytes) && !SvROK(class_or_bytes)) { |
|
|
0 |
0 |
if (items >= 2 && SvPOK(class_or_bytes) && !SvROK(class_or_bytes)) { |
|
|
0 |
0 |
if (items >= 2 && SvPOK(class_or_bytes) && !SvROK(class_or_bytes)) { |
|
669
|
0 |
98 |
if (!sv_isobject(self)) croak("Not an object"); |
|
672
|
16 |
82 |
if (av_len(s->buffer) + 1 >= s->batch_size) |
|
682
|
0 |
18 |
if (!sv_isobject(self)) croak("Not an object"); |
|
695
|
0 |
3 |
if (!sv_isobject(self)) croak("Not an object"); |
|
697
|
3 |
0 |
if (av_len(s->buffer) >= 0) av_clear(s->buffer); |
|
706
|
0 |
10 |
if (!sv_isobject(self)) croak("Not an object"); |
|
708
|
0 |
10 |
RETVAL = (UV)(av_len(s->buffer) + 1); |
|
719
|
0 |
6 |
if (!sv_isobject(self)) croak("Not an object"); |
|
721
|
4 |
2 |
RETVAL = (av_len(s->buffer) < 0); |
|
732
|
0 |
19 |
if (!sv_isobject(self)) return; |
|
751
|
32 |
122 |
while (v >= 0x80) { |
|
773
|
0 |
62 |
EXTEND(SP, 2); |
|
788
|
0 |
205 |
if (!SvOK(s)) { |
|
798
|
0 |
205 |
while (vv >= 0x80) { |
|
825
|
1 |
17 |
if (slen > (UV)buf_len - offset) |
|
829
|
0 |
17 |
EXTEND(SP, 2); |