| line |
true |
false |
branch |
|
49
|
0 |
0 |
for (lex = 0; lex < JSON_LEX_SLOTS; lex++) { |
|
50
|
0 |
0 |
if (lex == JSON_SHAREDVARIANT_LEX_POS) { slots[n++] = -1; continue; } |
|
52
|
0 |
0 |
for (k = 0; k < JV_KIND_COUNT; k++) { |
|
53
|
0 |
0 |
if (json_kind_to_lex_pos[k] == lex && (mask & (1u << k))) { |
|
|
0 |
0 |
if (json_kind_to_lex_pos[k] == lex && (mask & (1u << k))) { |
|
64
|
0 |
0 |
for (i = 0; i < n; i++) if (slots[i] == kind) return i; |
|
|
0 |
0 |
for (i = 0; i < n; i++) if (slots[i] == kind) return i; |
|
69
|
0 |
0 |
return pkg && (strcmp(pkg, "JSON::PP::Boolean") == 0 |
|
|
0 |
0 |
return pkg && (strcmp(pkg, "JSON::PP::Boolean") == 0 |
|
70
|
0 |
0 |
|| strcmp(pkg, "Types::Serialiser::Boolean") == 0 |
|
71
|
0 |
0 |
|| strcmp(pkg, "JSON::XS::Boolean") == 0 |
|
72
|
0 |
0 |
|| strcmp(pkg, "Cpanel::JSON::XS::Boolean") == 0 |
|
73
|
0 |
0 |
|| strcmp(pkg, "boolean") == 0); |
|
77
|
0 |
0 |
if (!(SvROK(val) && sv_isobject(val))) return 0; |
|
|
0 |
0 |
if (!(SvROK(val) && sv_isobject(val))) return 0; |
|
79
|
0 |
0 |
return stash && json_pkg_is_bool(HvNAME(stash)); |
|
|
0 |
0 |
return stash && json_pkg_is_bool(HvNAME(stash)); |
|
|
0 |
0 |
return stash && json_pkg_is_bool(HvNAME(stash)); |
|
|
0 |
0 |
return stash && json_pkg_is_bool(HvNAME(stash)); |
|
|
0 |
0 |
return stash && json_pkg_is_bool(HvNAME(stash)); |
|
|
0 |
0 |
return stash && json_pkg_is_bool(HvNAME(stash)); |
|
|
0 |
0 |
return stash && json_pkg_is_bool(HvNAME(stash)); |
|
|
0 |
0 |
return stash && json_pkg_is_bool(HvNAME(stash)); |
|
87
|
0 |
0 |
for (i = 0; i < n; i++) { |
|
89
|
0 |
0 |
if (!e || !SvOK(*e)) continue; |
|
|
0 |
0 |
if (!e || !SvOK(*e)) continue; |
|
91
|
0 |
0 |
if (SvROK(*e)) { |
|
92
|
0 |
0 |
if (json_is_bool_ref(aTHX_ *e)) leaf = JV_BOOL; |
|
96
|
0 |
0 |
else if (SvIsBOOL(*e)) leaf = JV_BOOL; |
|
98
|
0 |
0 |
else if (SvIOK(*e) && !SvNOK(*e)) leaf = JV_INT64; |
|
|
0 |
0 |
else if (SvIOK(*e) && !SvNOK(*e)) leaf = JV_INT64; |
|
99
|
0 |
0 |
else if (SvNOK(*e)) { |
|
102
|
0 |
0 |
&& nv >= (NV)INT64_MIN && nv <= (NV)INT64_MAX) |
|
|
0 |
0 |
&& nv >= (NV)INT64_MIN && nv <= (NV)INT64_MAX) |
|
103
|
0 |
0 |
? JV_INT64 : JV_FLOAT64; |
|
107
|
0 |
0 |
if (seen_kind == -1) seen_kind = leaf; |
|
108
|
0 |
0 |
else if (seen_kind != leaf) return -1; |
|
110
|
0 |
0 |
if (seen_kind == -1) return JV_ARRAY_INT64; /* empty/all-null */ |
|
121
|
0 |
0 |
if (json_is_bool_ref(aTHX_ val)) return JV_BOOL; |
|
123
|
0 |
0 |
if (SvIsBOOL(val)) return JV_BOOL; |
|
125
|
0 |
0 |
if (SvIOK(val) && !SvNOK(val)) return JV_INT64; |
|
|
0 |
0 |
if (SvIOK(val) && !SvNOK(val)) return JV_INT64; |
|
126
|
0 |
0 |
if (SvNOK(val)) { |
|
128
|
0 |
0 |
if (n == (NV)(int64_t)n && n >= (NV)INT64_MIN && n <= (NV)INT64_MAX) |
|
|
0 |
0 |
if (n == (NV)(int64_t)n && n >= (NV)INT64_MIN && n <= (NV)INT64_MAX) |
|
|
0 |
0 |
if (n == (NV)(int64_t)n && n >= (NV)INT64_MIN && n <= (NV)INT64_MAX) |
|
140
|
0 |
0 |
if (SvROK(val) && !json_is_bool_ref(aTHX_ val)) { |
|
|
0 |
0 |
if (SvROK(val) && !json_is_bool_ref(aTHX_ val)) { |
|
141
|
0 |
0 |
if (SvTYPE(SvRV(val)) != SVt_PVAV) return -1; |
|
148
|
0 |
0 |
if (tl == 4 && memcmp(ts, "Bool", 4) == 0) return JV_BOOL; |
|
|
0 |
0 |
if (tl == 4 && memcmp(ts, "Bool", 4) == 0) return JV_BOOL; |
|
149
|
0 |
0 |
if (tl == 7 && memcmp(ts, "Float64", 7) == 0) return JV_FLOAT64; |
|
|
0 |
0 |
if (tl == 7 && memcmp(ts, "Float64", 7) == 0) return JV_FLOAT64; |
|
150
|
0 |
0 |
if (tl == 5 && memcmp(ts, "Int64", 5) == 0) return JV_INT64; |
|
|
0 |
0 |
if (tl == 5 && memcmp(ts, "Int64", 5) == 0) return JV_INT64; |
|
151
|
0 |
0 |
if (tl == 6 && memcmp(ts, "String", 6) == 0) return JV_STRING; |
|
|
0 |
0 |
if (tl == 6 && memcmp(ts, "String", 6) == 0) return JV_STRING; |
|
152
|
0 |
0 |
if (tl == 11 && memcmp(ts, "Array(Bool)", 11) == 0) return JV_ARRAY_BOOL; |
|
|
0 |
0 |
if (tl == 11 && memcmp(ts, "Array(Bool)", 11) == 0) return JV_ARRAY_BOOL; |
|
153
|
0 |
0 |
if (tl == 14 && memcmp(ts, "Array(Float64)", 14) == 0) return JV_ARRAY_FLOAT64; |
|
|
0 |
0 |
if (tl == 14 && memcmp(ts, "Array(Float64)", 14) == 0) return JV_ARRAY_FLOAT64; |
|
154
|
0 |
0 |
if (tl == 12 && memcmp(ts, "Array(Int64)", 12) == 0) return JV_ARRAY_INT64; |
|
|
0 |
0 |
if (tl == 12 && memcmp(ts, "Array(Int64)", 12) == 0) return JV_ARRAY_INT64; |
|
155
|
0 |
0 |
if (tl == 13 && memcmp(ts, "Array(String)", 13) == 0) return JV_ARRAY_STRING; |
|
|
0 |
0 |
if (tl == 13 && memcmp(ts, "Array(String)", 13) == 0) return JV_ARRAY_STRING; |
|
165
|
0 |
0 |
while ((he = hv_iternext(src))) { |
|
169
|
0 |
0 |
STRLEN new_len = prefix_len + (prefix_len ? 1 : 0) + klen; |
|
173
|
0 |
0 |
if (prefix_len) { |
|
182
|
0 |
0 |
if (SvROK(vsv) && SvTYPE(SvRV(vsv)) == SVt_PVHV |
|
|
0 |
0 |
if (SvROK(vsv) && SvTYPE(SvRV(vsv)) == SVt_PVHV |
|
183
|
0 |
0 |
&& !json_is_bool_ref(aTHX_ vsv)) { |
|
184
|
0 |
0 |
if (sv_isobject(vsv)) |
|
185
|
0 |
0 |
croak("JSON column: opaque blessed hashref (package '%s') " |
|
|
0 |
0 |
croak("JSON column: opaque blessed hashref (package '%s') " |
|
|
0 |
0 |
croak("JSON column: opaque blessed hashref (package '%s') " |
|
|
0 |
0 |
croak("JSON column: opaque blessed hashref (package '%s') " |
|
|
0 |
0 |
croak("JSON column: opaque blessed hashref (package '%s') " |
|
|
0 |
0 |
croak("JSON column: opaque blessed hashref (package '%s') " |
|
206
|
0 |
0 |
if (r) return r; |
|
207
|
0 |
0 |
if (pa->len < pb->len) return -1; |
|
208
|
0 |
0 |
if (pa->len > pb->len) return 1; |
|
216
|
0 |
0 |
if (!SvOK(ev)) { nbuf_u8(b, 0); break; } |
|
217
|
0 |
0 |
{ SV *bv = SvROK(ev) ? SvRV(ev) : ev; |
|
220
|
0 |
0 |
nbuf_le64(b, SvOK(ev) ? (uint64_t)(int64_t)SvIV(ev) : 0); |
|
223
|
0 |
0 |
nbuf_ledouble(b, SvOK(ev) ? SvNV(ev) : 0.0); |
|
226
|
0 |
0 |
if (!SvOK(ev)) { nbuf_varuint(b, 0); break; } |
|
238
|
0 |
0 |
SV *bv = SvROK(val) ? SvRV(val) : val; |
|
295
|
0 |
0 |
if (!t) return; |
|
296
|
0 |
0 |
if (t->inner) free_col_type(t->inner); |
|
297
|
0 |
0 |
if (t->inners) { |
|
298
|
0 |
0 |
for (i = 0; i < t->num_inners; i++) |
|
302
|
0 |
0 |
if (t->inner_names) { |
|
303
|
0 |
0 |
for (i = 0; i < t->num_inners; i++) |
|
304
|
0 |
0 |
if (t->inner_names[i]) Safefree(t->inner_names[i]); |
|
307
|
0 |
0 |
if (t->type_str) Safefree(t->type_str); |
|
308
|
0 |
0 |
if (t->tz) Safefree(t->tz); |
|
324
|
0 |
0 |
for (i = 0; i <= inner_len; i++) { |
|
325
|
0 |
0 |
if (i < inner_len && inner[i] == '(') depth++; |
|
|
0 |
0 |
if (i < inner_len && inner[i] == '(') depth++; |
|
326
|
0 |
0 |
else if (i < inner_len && inner[i] == ')') depth--; |
|
|
0 |
0 |
else if (i < inner_len && inner[i] == ')') depth--; |
|
327
|
0 |
0 |
else if (i == inner_len || (inner[i] == ',' && depth == 0)) |
|
|
0 |
0 |
else if (i == inner_len || (inner[i] == ',' && depth == 0)) |
|
|
0 |
0 |
else if (i == inner_len || (inner[i] == ',' && depth == 0)) |
|
338
|
0 |
0 |
for (i = 0; i <= inner_len; i++) { |
|
339
|
0 |
0 |
if (i < inner_len && inner[i] == '(') depth++; |
|
|
0 |
0 |
if (i < inner_len && inner[i] == '(') depth++; |
|
340
|
0 |
0 |
else if (i < inner_len && inner[i] == ')') depth--; |
|
|
0 |
0 |
else if (i < inner_len && inner[i] == ')') depth--; |
|
341
|
0 |
0 |
else if (i == inner_len || (inner[i] == ',' && depth == 0)) { |
|
|
0 |
0 |
else if (i == inner_len || (inner[i] == ',' && depth == 0)) { |
|
|
0 |
0 |
else if (i == inner_len || (inner[i] == ',' && depth == 0)) { |
|
343
|
0 |
0 |
while (s < e && inner[s] == ' ') s++; |
|
|
0 |
0 |
while (s < e && inner[s] == ' ') s++; |
|
344
|
0 |
0 |
while (e > s && inner[e-1] == ' ') e--; |
|
|
0 |
0 |
while (e > s && inner[e-1] == ' ') e--; |
|
348
|
0 |
0 |
for (sp = s; sp < e; sp++) { |
|
349
|
0 |
0 |
if (inner[sp] == '(') break; /* type with parens, stop */ |
|
350
|
0 |
0 |
if (inner[sp] == ' ') { s = sp + 1; break; } |
|
363
|
0 |
0 |
if (len == 4 && memcmp(type, "Int8", 4) == 0) t->code = CT_INT8; |
|
|
0 |
0 |
if (len == 4 && memcmp(type, "Int8", 4) == 0) t->code = CT_INT8; |
|
364
|
0 |
0 |
else if (len == 5 && memcmp(type, "Int16", 5) == 0) t->code = CT_INT16; |
|
|
0 |
0 |
else if (len == 5 && memcmp(type, "Int16", 5) == 0) t->code = CT_INT16; |
|
365
|
0 |
0 |
else if (len == 5 && memcmp(type, "Int32", 5) == 0) t->code = CT_INT32; |
|
|
0 |
0 |
else if (len == 5 && memcmp(type, "Int32", 5) == 0) t->code = CT_INT32; |
|
366
|
0 |
0 |
else if (len == 5 && memcmp(type, "Int64", 5) == 0) t->code = CT_INT64; |
|
|
0 |
0 |
else if (len == 5 && memcmp(type, "Int64", 5) == 0) t->code = CT_INT64; |
|
367
|
0 |
0 |
else if (len > 8 && memcmp(type, "Interval", 8) == 0) t->code = CT_INT64; |
|
|
0 |
0 |
else if (len > 8 && memcmp(type, "Interval", 8) == 0) t->code = CT_INT64; |
|
368
|
0 |
0 |
else if (len == 5 && memcmp(type, "UInt8", 5) == 0) t->code = CT_UINT8; |
|
|
0 |
0 |
else if (len == 5 && memcmp(type, "UInt8", 5) == 0) t->code = CT_UINT8; |
|
369
|
0 |
0 |
else if (len == 6 && memcmp(type, "UInt16", 6) == 0) t->code = CT_UINT16; |
|
|
0 |
0 |
else if (len == 6 && memcmp(type, "UInt16", 6) == 0) t->code = CT_UINT16; |
|
370
|
0 |
0 |
else if (len == 6 && memcmp(type, "UInt32", 6) == 0) t->code = CT_UINT32; |
|
|
0 |
0 |
else if (len == 6 && memcmp(type, "UInt32", 6) == 0) t->code = CT_UINT32; |
|
371
|
0 |
0 |
else if (len == 6 && memcmp(type, "UInt64", 6) == 0) t->code = CT_UINT64; |
|
|
0 |
0 |
else if (len == 6 && memcmp(type, "UInt64", 6) == 0) t->code = CT_UINT64; |
|
372
|
0 |
0 |
else if (len == 7 && memcmp(type, "Float32", 7) == 0) t->code = CT_FLOAT32; |
|
|
0 |
0 |
else if (len == 7 && memcmp(type, "Float32", 7) == 0) t->code = CT_FLOAT32; |
|
373
|
0 |
0 |
else if (len == 7 && memcmp(type, "Float64", 7) == 0) t->code = CT_FLOAT64; |
|
|
0 |
0 |
else if (len == 7 && memcmp(type, "Float64", 7) == 0) t->code = CT_FLOAT64; |
|
374
|
0 |
0 |
else if (len == 6 && memcmp(type, "String", 6) == 0) t->code = CT_STRING; |
|
|
0 |
0 |
else if (len == 6 && memcmp(type, "String", 6) == 0) t->code = CT_STRING; |
|
375
|
0 |
0 |
else if (len > 12 && memcmp(type, "FixedString(", 12) == 0) { |
|
|
0 |
0 |
else if (len > 12 && memcmp(type, "FixedString(", 12) == 0) { |
|
379
|
0 |
0 |
else if (len > 6 && memcmp(type, "Array(", 6) == 0) { |
|
|
0 |
0 |
else if (len > 6 && memcmp(type, "Array(", 6) == 0) { |
|
383
|
0 |
0 |
else if (len > 9 && memcmp(type, "Nullable(", 9) == 0) { |
|
|
0 |
0 |
else if (len > 9 && memcmp(type, "Nullable(", 9) == 0) { |
|
387
|
0 |
0 |
else if (len > 15 && memcmp(type, "LowCardinality(", 15) == 0) { |
|
|
0 |
0 |
else if (len > 15 && memcmp(type, "LowCardinality(", 15) == 0) { |
|
391
|
0 |
0 |
else if (len == 4 && memcmp(type, "Date", 4) == 0) t->code = CT_DATE; |
|
|
0 |
0 |
else if (len == 4 && memcmp(type, "Date", 4) == 0) t->code = CT_DATE; |
|
392
|
0 |
0 |
else if (len == 6 && memcmp(type, "Date32", 6) == 0) t->code = CT_DATE32; |
|
|
0 |
0 |
else if (len == 6 && memcmp(type, "Date32", 6) == 0) t->code = CT_DATE32; |
|
393
|
0 |
0 |
else if (len == 8 && memcmp(type, "DateTime", 8) == 0) t->code = CT_DATETIME; |
|
|
0 |
0 |
else if (len == 8 && memcmp(type, "DateTime", 8) == 0) t->code = CT_DATETIME; |
|
394
|
0 |
0 |
else if (len > 9 && memcmp(type, "DateTime(", 9) == 0) { |
|
|
0 |
0 |
else if (len > 9 && memcmp(type, "DateTime(", 9) == 0) { |
|
399
|
0 |
0 |
if (q) { |
|
401
|
0 |
0 |
if (qe && qe > q + 1) { |
|
|
0 |
0 |
if (qe && qe > q + 1) { |
|
410
|
0 |
0 |
else if (len > 11 && memcmp(type, "DateTime64(", 11) == 0) { |
|
|
0 |
0 |
else if (len > 11 && memcmp(type, "DateTime64(", 11) == 0) { |
|
416
|
0 |
0 |
if (comma) { |
|
418
|
0 |
0 |
if (q) { |
|
420
|
0 |
0 |
if (qe && qe > q + 1) { |
|
|
0 |
0 |
if (qe && qe > q + 1) { |
|
430
|
0 |
0 |
else if (len == 4 && memcmp(type, "UUID", 4) == 0) t->code = CT_UUID; |
|
|
0 |
0 |
else if (len == 4 && memcmp(type, "UUID", 4) == 0) t->code = CT_UUID; |
|
431
|
0 |
0 |
else if (len > 6 && memcmp(type, "Enum8(", 6) == 0) { |
|
|
0 |
0 |
else if (len > 6 && memcmp(type, "Enum8(", 6) == 0) { |
|
438
|
0 |
0 |
else if (len > 7 && memcmp(type, "Enum16(", 7) == 0) { |
|
|
0 |
0 |
else if (len > 7 && memcmp(type, "Enum16(", 7) == 0) { |
|
445
|
0 |
0 |
else if (len > 10 && memcmp(type, "Decimal32(", 10) == 0) { |
|
|
0 |
0 |
else if (len > 10 && memcmp(type, "Decimal32(", 10) == 0) { |
|
449
|
0 |
0 |
else if (len > 10 && memcmp(type, "Decimal64(", 10) == 0) { |
|
|
0 |
0 |
else if (len > 10 && memcmp(type, "Decimal64(", 10) == 0) { |
|
453
|
0 |
0 |
else if (len > 11 && memcmp(type, "Decimal128(", 11) == 0) { |
|
|
0 |
0 |
else if (len > 11 && memcmp(type, "Decimal128(", 11) == 0) { |
|
457
|
0 |
0 |
else if (len > 11 && memcmp(type, "Decimal256(", 11) == 0) { |
|
|
0 |
0 |
else if (len > 11 && memcmp(type, "Decimal256(", 11) == 0) { |
|
461
|
0 |
0 |
else if (len > 8 && memcmp(type, "Decimal(", 8) == 0) { |
|
|
0 |
0 |
else if (len > 8 && memcmp(type, "Decimal(", 8) == 0) { |
|
464
|
0 |
0 |
t->param = comma ? atoi(comma + 1) : 0; |
|
465
|
0 |
0 |
if (precision <= 9) t->code = CT_DECIMAL32; |
|
466
|
0 |
0 |
else if (precision <= 18) t->code = CT_DECIMAL64; |
|
467
|
0 |
0 |
else if (precision <= 38) t->code = CT_DECIMAL128; |
|
470
|
0 |
0 |
else if (len == 8 && memcmp(type, "BFloat16", 8) == 0) t->code = CT_BFLOAT16; |
|
|
0 |
0 |
else if (len == 8 && memcmp(type, "BFloat16", 8) == 0) t->code = CT_BFLOAT16; |
|
477
|
0 |
0 |
else if (len > 8 && memcmp(type, "Variant(", 8) == 0) { |
|
|
0 |
0 |
else if (len > 8 && memcmp(type, "Variant(", 8) == 0) { |
|
480
|
0 |
0 |
else if (len == 7 && memcmp(type, "Dynamic", 7) == 0) { |
|
|
0 |
0 |
else if (len == 7 && memcmp(type, "Dynamic", 7) == 0) { |
|
483
|
0 |
0 |
else if (len == 7 && memcmp(type, "Nothing", 7) == 0) t->code = CT_NOTHING; |
|
|
0 |
0 |
else if (len == 7 && memcmp(type, "Nothing", 7) == 0) t->code = CT_NOTHING; |
|
484
|
0 |
0 |
else if (len == 4 && memcmp(type, "Bool", 4) == 0) t->code = CT_BOOL; |
|
|
0 |
0 |
else if (len == 4 && memcmp(type, "Bool", 4) == 0) t->code = CT_BOOL; |
|
485
|
0 |
0 |
else if (len == 4 && memcmp(type, "IPv4", 4) == 0) t->code = CT_IPV4; |
|
|
0 |
0 |
else if (len == 4 && memcmp(type, "IPv4", 4) == 0) t->code = CT_IPV4; |
|
486
|
0 |
0 |
else if (len == 4 && memcmp(type, "IPv6", 4) == 0) t->code = CT_IPV6; |
|
|
0 |
0 |
else if (len == 4 && memcmp(type, "IPv6", 4) == 0) t->code = CT_IPV6; |
|
487
|
0 |
0 |
else if (len == 6 && memcmp(type, "Int128", 6) == 0) t->code = CT_INT128; |
|
|
0 |
0 |
else if (len == 6 && memcmp(type, "Int128", 6) == 0) t->code = CT_INT128; |
|
488
|
0 |
0 |
else if (len == 7 && memcmp(type, "UInt128", 7) == 0) t->code = CT_UINT128; |
|
|
0 |
0 |
else if (len == 7 && memcmp(type, "UInt128", 7) == 0) t->code = CT_UINT128; |
|
489
|
0 |
0 |
else if (len == 6 && memcmp(type, "Int256", 6) == 0) t->code = CT_INT256; |
|
|
0 |
0 |
else if (len == 6 && memcmp(type, "Int256", 6) == 0) t->code = CT_INT256; |
|
490
|
0 |
0 |
else if (len == 7 && memcmp(type, "UInt256", 7) == 0) t->code = CT_UINT256; |
|
|
0 |
0 |
else if (len == 7 && memcmp(type, "UInt256", 7) == 0) t->code = CT_UINT256; |
|
491
|
0 |
0 |
else if (len > 6 && memcmp(type, "Tuple(", 6) == 0) { |
|
|
0 |
0 |
else if (len > 6 && memcmp(type, "Tuple(", 6) == 0) { |
|
495
|
0 |
0 |
else if (len > 4 && memcmp(type, "Map(", 4) == 0) { |
|
|
0 |
0 |
else if (len > 4 && memcmp(type, "Map(", 4) == 0) { |
|
499
|
0 |
0 |
else if (len > 7 && memcmp(type, "Nested(", 7) == 0) { |
|
|
0 |
0 |
else if (len > 7 && memcmp(type, "Nested(", 7) == 0) { |
|
508
|
0 |
0 |
else if ((len == 4 && memcmp(type, "JSON", 4) == 0) |
|
|
0 |
0 |
else if ((len == 4 && memcmp(type, "JSON", 4) == 0) |
|
509
|
0 |
0 |
|| (len > 5 && memcmp(type, "JSON(", 5) == 0 && type[len-1] == ')') |
|
|
0 |
0 |
|| (len > 5 && memcmp(type, "JSON(", 5) == 0 && type[len-1] == ')') |
|
|
0 |
0 |
|| (len > 5 && memcmp(type, "JSON(", 5) == 0 && type[len-1] == ')') |
|
510
|
0 |
0 |
|| (len > 7 && memcmp(type, "Object(", 7) == 0)) { |
|
|
0 |
0 |
|| (len > 7 && memcmp(type, "Object(", 7) == 0)) { |
|
516
|
0 |
0 |
if (len > 5 && type[4] == '(') { |
|
|
0 |
0 |
if (len > 5 && type[4] == '(') { |
|
525
|
0 |
0 |
for (i = 0; i <= blen; i++) { |
|
526
|
0 |
0 |
char c = (i < blen) ? body[i] : ','; |
|
527
|
0 |
0 |
if (c == '(') depth++; |
|
528
|
0 |
0 |
else if (c == ')') depth--; |
|
529
|
0 |
0 |
else if ((c == ',' && depth == 0) || i == blen) { |
|
|
0 |
0 |
else if ((c == ',' && depth == 0) || i == blen) { |
|
|
0 |
0 |
else if ((c == ',' && depth == 0) || i == blen) { |
|
531
|
0 |
0 |
while (ts < te && (body[ts]==' '||body[ts]=='\t')) ts++; |
|
|
0 |
0 |
while (ts < te && (body[ts]==' '||body[ts]=='\t')) ts++; |
|
|
0 |
0 |
while (ts < te && (body[ts]==' '||body[ts]=='\t')) ts++; |
|
532
|
0 |
0 |
while (te > ts && (body[te-1]==' '||body[te-1]=='\t')) te--; |
|
|
0 |
0 |
while (te > ts && (body[te-1]==' '||body[te-1]=='\t')) te--; |
|
|
0 |
0 |
while (te > ts && (body[te-1]==' '||body[te-1]=='\t')) te--; |
|
533
|
0 |
0 |
if (te > ts && idx < 64) { |
|
|
0 |
0 |
if (te > ts && idx < 64) { |
|
535
|
0 |
0 |
while (id < te && body[id] != ' ' && body[id] != '\t') id++; |
|
|
0 |
0 |
while (id < te && body[id] != ' ' && body[id] != '\t') id++; |
|
|
0 |
0 |
while (id < te && body[id] != ' ' && body[id] != '\t') id++; |
|
537
|
0 |
0 |
while (ws < te && (body[ws]==' '||body[ws]=='\t')) ws++; |
|
|
0 |
0 |
while (ws < te && (body[ws]==' '||body[ws]=='\t')) ws++; |
|
|
0 |
0 |
while (ws < te && (body[ws]==' '||body[ws]=='\t')) ws++; |
|
538
|
0 |
0 |
if (id > ts && ws < te) { |
|
|
0 |
0 |
if (id > ts && ws < te) { |
|
549
|
0 |
0 |
if (idx > 0) { |
|
552
|
0 |
0 |
for (j = 1; j < idx; j++) { |
|
554
|
0 |
0 |
while (z > 0) { |
|
559
|
0 |
0 |
if (cmp == 0) cmp = (int)la - (int)lb; |
|
560
|
0 |
0 |
if (cmp <= 0) break; |
|
570
|
0 |
0 |
for (j = 0; j < idx; j++) { |
|
582
|
0 |
0 |
else if (len == 5 && memcmp(type, "Point", 5) == 0) { |
|
|
0 |
0 |
else if (len == 5 && memcmp(type, "Point", 5) == 0) { |
|
587
|
0 |
0 |
else if (len == 4 && memcmp(type, "Ring", 4) == 0) { |
|
|
0 |
0 |
else if (len == 4 && memcmp(type, "Ring", 4) == 0) { |
|
592
|
0 |
0 |
else if (len == 10 && memcmp(type, "LineString", 10) == 0) { |
|
|
0 |
0 |
else if (len == 10 && memcmp(type, "LineString", 10) == 0) { |
|
597
|
0 |
0 |
else if (len == 15 && memcmp(type, "MultiLineString", 15) == 0) { |
|
|
0 |
0 |
else if (len == 15 && memcmp(type, "MultiLineString", 15) == 0) { |
|
602
|
0 |
0 |
else if (len == 7 && memcmp(type, "Polygon", 7) == 0) { |
|
|
0 |
0 |
else if (len == 7 && memcmp(type, "Polygon", 7) == 0) { |
|
607
|
0 |
0 |
else if (len == 12 && memcmp(type, "MultiPolygon", 12) == 0) { |
|
|
0 |
0 |
else if (len == 12 && memcmp(type, "MultiPolygon", 12) == 0) { |
|
612
|
0 |
0 |
else if ((len > 25 && memcmp(type, "SimpleAggregateFunction(", 24) == 0) |
|
|
0 |
0 |
else if ((len > 25 && memcmp(type, "SimpleAggregateFunction(", 24) == 0) |
|
613
|
0 |
0 |
|| (len > 19 && memcmp(type, "AggregateFunction(", 18) == 0)) { |
|
|
0 |
0 |
|| (len > 19 && memcmp(type, "AggregateFunction(", 18) == 0)) { |
|
619
|
0 |
0 |
size_t off = (memcmp(type, "Simple", 6) == 0) ? 24 : 18; |
|
624
|
0 |
0 |
for (ci = 0; ci < inner_len; ci++) { |
|
625
|
0 |
0 |
if (inner[ci] == '(') depth++; |
|
626
|
0 |
0 |
else if (inner[ci] == ')') depth--; |
|
627
|
0 |
0 |
else if (inner[ci] == ',' && depth == 0) break; |
|
|
0 |
0 |
else if (inner[ci] == ',' && depth == 0) break; |
|
629
|
0 |
0 |
if (ci < inner_len) { |
|
631
|
0 |
0 |
while (ci < inner_len && inner[ci] == ' ') ci++; |
|
|
0 |
0 |
while (ci < inner_len && inner[ci] == ' ') ci++; |
|
674
|
0 |
0 |
if (!gmtime_r(&t, &tm)) return newSVpvn("0000-00-00", 10); |
|
685
|
0 |
0 |
if (!gmtime_r(&t, &tm)) return newSVpvn("0000-00-00 00:00:00", 19); |
|
697
|
0 |
0 |
if (!localtime_r(&t, &tm)) return newSVpvn("0000-00-00 00:00:00", 19); |
|
714
|
0 |
0 |
for (p = 0; p < precision; p++) scale *= 10; |
|
717
|
0 |
0 |
if (frac < 0) { epoch--; frac += scale; } |
|
720
|
0 |
0 |
if (use_local) { |
|
721
|
0 |
0 |
if (!localtime_r(&t, &tm)) return newSVpvn("0000-00-00 00:00:00", 19); |
|
723
|
0 |
0 |
if (!gmtime_r(&t, &tm)) return newSVpvn("0000-00-00 00:00:00", 19); |
|
728
|
0 |
0 |
if (precision > 0 && n < 30) { |
|
|
0 |
0 |
if (precision > 0 && n < 30) { |
|
733
|
0 |
0 |
for (fi = 0; fi < precision && n < 31; fi++) |
|
|
0 |
0 |
for (fi = 0; fi < precision && n < 31; fi++) |
|
751
|
0 |
0 |
if (saved) { |
|
764
|
0 |
0 |
for (i = 0; i < n; i++) r *= 10.0; |
|
773
|
0 |
0 |
if (!p) return newSViv(code); |
|
777
|
0 |
0 |
while (p < end) { |
|
779
|
0 |
0 |
while (p < end && *p == ' ') p++; |
|
|
0 |
0 |
while (p < end && *p == ' ') p++; |
|
780
|
0 |
0 |
if (p >= end || *p != '\'') break; |
|
|
0 |
0 |
if (p >= end || *p != '\'') break; |
|
789
|
0 |
0 |
while (p < end && !(*p == '\'' && (p + 1 >= end || *(p+1) != '\''))) { |
|
|
0 |
0 |
while (p < end && !(*p == '\'' && (p + 1 >= end || *(p+1) != '\''))) { |
|
|
0 |
0 |
while (p < end && !(*p == '\'' && (p + 1 >= end || *(p+1) != '\''))) { |
|
|
0 |
0 |
while (p < end && !(*p == '\'' && (p + 1 >= end || *(p+1) != '\''))) { |
|
790
|
0 |
0 |
if (*p == '\'' && p + 1 < end && *(p+1) == '\'') { p += 2; continue; } |
|
|
0 |
0 |
if (*p == '\'' && p + 1 < end && *(p+1) == '\'') { p += 2; continue; } |
|
|
0 |
0 |
if (*p == '\'' && p + 1 < end && *(p+1) == '\'') { p += 2; continue; } |
|
794
|
0 |
0 |
if (p < end) p++; /* skip closing quote */ |
|
797
|
0 |
0 |
while (p < end && (*p == ' ' || *p == '=')) p++; |
|
|
0 |
0 |
while (p < end && (*p == ' ' || *p == '=')) p++; |
|
|
0 |
0 |
while (p < end && (*p == ' ' || *p == '=')) p++; |
|
802
|
0 |
0 |
if (val == code) return newSVpvn(label_start, label_len); |
|
805
|
0 |
0 |
while (p < end && *p != ',') p++; |
|
|
0 |
0 |
while (p < end && *p != ',') p++; |
|
806
|
0 |
0 |
if (p < end) p++; /* skip comma */ |
|
825
|
0 |
0 |
if (is_signed) { |
|
829
|
0 |
0 |
uv = neg ? -(unsigned __int128)sv : (unsigned __int128)sv; |
|
836
|
0 |
0 |
} while (uv); |
|
837
|
0 |
0 |
if (neg) dbuf[dlen++] = '-'; |
|
838
|
0 |
0 |
for (k = 0; k < dlen/2; k++) { |
|
856
|
0 |
0 |
if (v[0] == 0 && v[1] == 0 && v[2] == 0 && v[3] == 0) |
|
|
0 |
0 |
if (v[0] == 0 && v[1] == 0 && v[2] == 0 && v[3] == 0) |
|
|
0 |
0 |
if (v[0] == 0 && v[1] == 0 && v[2] == 0 && v[3] == 0) |
|
|
0 |
0 |
if (v[0] == 0 && v[1] == 0 && v[2] == 0 && v[3] == 0) |
|
860
|
0 |
0 |
while (v[0] || v[1] || v[2] || v[3]) { |
|
|
0 |
0 |
while (v[0] || v[1] || v[2] || v[3]) { |
|
|
0 |
0 |
while (v[0] || v[1] || v[2] || v[3]) { |
|
|
0 |
0 |
while (v[0] || v[1] || v[2] || v[3]) { |
|
863
|
0 |
0 |
for (i = 3; i >= 0; i--) { |
|
881
|
0 |
0 |
for (k = 0; k < dlen/2; k++) { |
|
888
|
0 |
0 |
if (is_signed && ((unsigned char)p[31] & 0x80)) { |
|
|
0 |
0 |
if (is_signed && ((unsigned char)p[31] & 0x80)) { |
|
895
|
0 |
0 |
for (i = 0; i < 32; i++) { |
|
936
|
0 |
0 |
Newxz(out, nrows ? nrows : 1, SV*); |
|
|
0 |
0 |
Newxz(out, nrows ? nrows : 1, SV*); |
|
|
0 |
0 |
Newxz(out, nrows ? nrows : 1, SV*); |
|
938
|
0 |
0 |
if (ct->code == CT_NOTHING) { |
|
940
|
0 |
0 |
if (*pos > len || nrows > len - *pos) goto fail; |
|
|
0 |
0 |
if (*pos > len || nrows > len - *pos) goto fail; |
|
942
|
0 |
0 |
for (i = 0; i < nrows; i++) |
|
947
|
0 |
0 |
if (ct->code == CT_VARIANT || ct->code == CT_DYNAMIC) { |
|
|
0 |
0 |
if (ct->code == CT_VARIANT || ct->code == CT_DYNAMIC) { |
|
953
|
0 |
0 |
if (decode_err) *decode_err = 1; |
|
957
|
0 |
0 |
if (ct->code == CT_NULLABLE) { |
|
961
|
0 |
0 |
if (*pos > len || nrows > len - *pos) goto fail; |
|
|
0 |
0 |
if (*pos > len || nrows > len - *pos) goto fail; |
|
968
|
0 |
0 |
if (!inner) { Safefree(nulls); goto fail; } |
|
970
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
971
|
0 |
0 |
if (nulls[i]) { |
|
983
|
0 |
0 |
if (ct->code == CT_LOWCARDINALITY) { |
|
1001
|
0 |
0 |
if (*pos + 8 > len) goto lc_fail; |
|
1005
|
0 |
0 |
if (*pos + 8 > len) goto lc_fail; |
|
1012
|
0 |
0 |
if (ser_type & (1ULL << 10)) { |
|
1013
|
0 |
0 |
if (*pos + 8 > len) goto lc_fail; |
|
1017
|
0 |
0 |
if (!dict) goto lc_fail; |
|
1020
|
0 |
0 |
if (lc_self && lc_col_idx >= 0 && lc_col_idx < lc_self->lc_num_cols |
|
|
0 |
0 |
if (lc_self && lc_col_idx >= 0 && lc_col_idx < lc_self->lc_num_cols |
|
|
0 |
0 |
if (lc_self && lc_col_idx >= 0 && lc_col_idx < lc_self->lc_num_cols |
|
1021
|
0 |
0 |
&& lc_self->lc_dicts[lc_col_idx]) { |
|
1026
|
0 |
0 |
if (decode_err) *decode_err = 1; |
|
1032
|
0 |
0 |
if (*pos + 8 > len) goto lc_fail; |
|
1035
|
0 |
0 |
idx_size = (key_type == 0) ? 1 : (key_type == 1) ? 2 : |
|
|
0 |
0 |
idx_size = (key_type == 0) ? 1 : (key_type == 1) ? 2 : |
|
|
0 |
0 |
idx_size = (key_type == 0) ? 1 : (key_type == 1) ? 2 : |
|
1037
|
0 |
0 |
if (num_indices != nrows) { |
|
1038
|
0 |
0 |
if (decode_err) *decode_err = 1; |
|
1041
|
0 |
0 |
if (*pos > len || num_indices > (len - *pos) / idx_size) goto lc_fail; |
|
|
0 |
0 |
if (*pos > len || num_indices > (len - *pos) / idx_size) goto lc_fail; |
|
1044
|
0 |
0 |
if (!dict_borrowed && lc_self && lc_col_idx >= 0 && lc_col_idx < lc_self->lc_num_cols) { |
|
|
0 |
0 |
if (!dict_borrowed && lc_self && lc_col_idx >= 0 && lc_col_idx < lc_self->lc_num_cols) { |
|
|
0 |
0 |
if (!dict_borrowed && lc_self && lc_col_idx >= 0 && lc_col_idx < lc_self->lc_num_cols) { |
|
|
0 |
0 |
if (!dict_borrowed && lc_self && lc_col_idx >= 0 && lc_col_idx < lc_self->lc_num_cols) { |
|
1045
|
0 |
0 |
if (lc_self->lc_dicts[lc_col_idx]) { |
|
1047
|
0 |
0 |
for (di = 0; di < lc_self->lc_dict_sizes[lc_col_idx]; di++) |
|
1052
|
0 |
0 |
Newx(dcopy, num_keys > 0 ? num_keys : 1, SV*); |
|
|
0 |
0 |
Newx(dcopy, num_keys > 0 ? num_keys : 1, SV*); |
|
|
0 |
0 |
Newx(dcopy, num_keys > 0 ? num_keys : 1, SV*); |
|
1053
|
0 |
0 |
for (i = 0; i < num_keys; i++) |
|
1059
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
1062
|
0 |
0 |
if (dict && idx < num_keys) { |
|
|
0 |
0 |
if (dict && idx < num_keys) { |
|
1070
|
0 |
0 |
if (dict && !dict_borrowed) { |
|
|
0 |
0 |
if (dict && !dict_borrowed) { |
|
1071
|
0 |
0 |
for (i = 0; i < num_keys; i++) SvREFCNT_dec(dict[i]); |
|
1077
|
0 |
0 |
if (dict && !dict_borrowed) { |
|
|
0 |
0 |
if (dict && !dict_borrowed) { |
|
1078
|
0 |
0 |
for (i = 0; i < num_keys; i++) SvREFCNT_dec(dict[i]); |
|
1085
|
0 |
0 |
if (ct->code == CT_STRING) { |
|
1086
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
1089
|
0 |
0 |
if (read_native_string_ref(buf, len, pos, &s, &slen) <= 0) { |
|
1092
|
0 |
0 |
for (j = 0; j < i; j++) SvREFCNT_dec(out[j]); |
|
1100
|
0 |
0 |
if (ct->code == CT_ARRAY) { |
|
1106
|
0 |
0 |
if (*pos > len || nrows > (len - *pos) / 8) goto fail; |
|
|
0 |
0 |
if (*pos > len || nrows > (len - *pos) / 8) goto fail; |
|
1107
|
0 |
0 |
Newx(offsets, nrows, uint64_t); |
|
1108
|
0 |
0 |
Copy(buf + *pos, offsets, nrows, uint64_t); |
|
1113
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
1114
|
0 |
0 |
if (offsets[i] < prev) { Safefree(offsets); goto fail; } |
|
1118
|
0 |
0 |
total = nrows > 0 ? offsets[nrows - 1] : 0; |
|
1122
|
0 |
0 |
if (!elems) { Safefree(offsets); goto fail; } |
|
1126
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
1130
|
0 |
0 |
if (count > 0) av_extend(av, count - 1); |
|
1131
|
0 |
0 |
for (j = 0; j < count; j++) { |
|
1143
|
0 |
0 |
if (ct->code == CT_TUPLE) { |
|
1149
|
0 |
0 |
for (j = 0; j < ct->num_inners; j++) { |
|
1151
|
0 |
0 |
if (!cols[j]) { |
|
1153
|
0 |
0 |
for (k = 0; k < j; k++) { |
|
1154
|
0 |
0 |
for (i = 0; i < nrows; i++) SvREFCNT_dec(cols[k][i]); |
|
1162
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
1165
|
0 |
0 |
for (j = 0; j < ct->num_inners; j++) |
|
1170
|
0 |
0 |
for (j = 0; j < ct->num_inners; j++) Safefree(cols[j]); |
|
1175
|
0 |
0 |
if (ct->code == CT_JSON) { |
|
1189
|
0 |
0 |
if (*pos > len || len - *pos < 8) goto json_fail; |
|
|
0 |
0 |
if (*pos > len || len - *pos < 8) goto json_fail; |
|
1191
|
0 |
0 |
if (obj_ver != 0 && obj_ver != 2 && obj_ver != 4) goto json_fail; |
|
|
0 |
0 |
if (obj_ver != 0 && obj_ver != 2 && obj_ver != 4) goto json_fail; |
|
|
0 |
0 |
if (obj_ver != 0 && obj_ver != 2 && obj_ver != 4) goto json_fail; |
|
1192
|
0 |
0 |
if (obj_ver == 0) { |
|
1194
|
0 |
0 |
if (read_varuint(buf, len, pos, &dummy) <= 0) goto json_fail; |
|
1196
|
0 |
0 |
if (read_varuint(buf, len, pos, &num_paths64) <= 0) goto json_fail; |
|
1197
|
0 |
0 |
if (num_paths64 > (uint64_t)INT_MAX) goto json_fail; |
|
1200
|
0 |
0 |
if (num_paths > 0) { |
|
1205
|
0 |
0 |
for (p = 0; p < num_paths; p++) { |
|
1207
|
0 |
0 |
if (read_native_string_ref(buf, len, pos, &ps, &pl) <= 0) goto json_fail; |
|
1211
|
0 |
0 |
if (obj_ver == 4) { |
|
1213
|
0 |
0 |
if (read_varuint(buf, len, pos, &shared_ver) <= 0) goto json_fail; |
|
1214
|
0 |
0 |
if (shared_ver == 1 || shared_ver == 2) |
|
|
0 |
0 |
if (shared_ver == 1 || shared_ver == 2) |
|
1215
|
0 |
0 |
if (read_varuint(buf, len, pos, &dummy) <= 0) goto json_fail; |
|
1218
|
0 |
0 |
for (p = 0; p < num_paths; p++) { |
|
1220
|
0 |
0 |
if (*pos > len || len - *pos < 8) goto json_fail; |
|
|
0 |
0 |
if (*pos > len || len - *pos < 8) goto json_fail; |
|
1222
|
0 |
0 |
if (dyn_ver != 1 && dyn_ver != 2 && dyn_ver != 4) goto json_fail; |
|
|
0 |
0 |
if (dyn_ver != 1 && dyn_ver != 2 && dyn_ver != 4) goto json_fail; |
|
|
0 |
0 |
if (dyn_ver != 1 && dyn_ver != 2 && dyn_ver != 4) goto json_fail; |
|
1223
|
0 |
0 |
if (dyn_ver == 1) { |
|
1225
|
0 |
0 |
if (read_varuint(buf, len, pos, &dummy) <= 0) goto json_fail; |
|
1227
|
0 |
0 |
if (read_varuint(buf, len, pos, &ntypes) <= 0) goto json_fail; |
|
1228
|
0 |
0 |
if (ntypes > (uint64_t)JSON_LEX_SLOTS) goto json_fail; |
|
1231
|
0 |
0 |
for (ti = 0; ti < ntypes; ti++) { |
|
1233
|
0 |
0 |
if (read_native_string_ref(buf, len, pos, &ts, &tl) <= 0) goto json_fail; |
|
1235
|
0 |
0 |
if (k < 0) goto json_fail; |
|
1239
|
0 |
0 |
if (*pos > len || len - *pos < 8) goto json_fail; |
|
|
0 |
0 |
if (*pos > len || len - *pos < 8) goto json_fail; |
|
1241
|
0 |
0 |
if (var_mode != 0) goto json_fail; |
|
1245
|
0 |
0 |
for (i = 0; i < nrows; i++) out[i] = newRV_noinc((SV*)newHV()); |
|
1250
|
0 |
0 |
if (ct->num_inners > 0) { |
|
1252
|
0 |
0 |
for (tp = 0; tp < ct->num_inners; tp++) { |
|
1255
|
0 |
0 |
if (!tpcol) goto json_fail; |
|
1257
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
1259
|
0 |
0 |
if (!hv_store(row_hv, ct->inner_names[tp], (I32)nlen, |
|
1267
|
0 |
0 |
for (p = 0; p < num_paths; p++) { |
|
1268
|
0 |
0 |
if (*pos > len || len - *pos < (size_t)nrows) goto json_fail; |
|
|
0 |
0 |
if (*pos > len || len - *pos < (size_t)nrows) goto json_fail; |
|
1278
|
0 |
0 |
for (kk = 0; kk < nv; kk++) mask |= 1u << kinds[kk]; |
|
1283
|
0 |
0 |
for (r2 = 0; r2 < (uint64_t)nrows; r2++) { |
|
1285
|
0 |
0 |
if (d == 0xff) continue; |
|
1286
|
0 |
0 |
if (d >= wire_slots) goto json_fail; |
|
1293
|
0 |
0 |
for (s = 0; s < wire_slots; s++) { |
|
1298
|
0 |
0 |
if (kind < 0 || kind == JV_STRING) { |
|
|
0 |
0 |
if (kind < 0 || kind == JV_STRING) { |
|
1303
|
0 |
0 |
for (k = 0; k < nv_rows; k++) { |
|
1305
|
0 |
0 |
if (read_native_string_ref(buf, len, pos, &vs, &vl) <= 0) |
|
1309
|
0 |
0 |
} else if (kind == JV_INT64) { |
|
1310
|
0 |
0 |
if (*pos > len || len - *pos < 8 * nv_rows) goto json_fail; |
|
|
0 |
0 |
if (*pos > len || len - *pos < 8 * nv_rows) goto json_fail; |
|
1312
|
0 |
0 |
for (k = 0; k < nv_rows; k++) { |
|
1316
|
0 |
0 |
} else if (kind == JV_FLOAT64) { |
|
1317
|
0 |
0 |
if (*pos > len || len - *pos < 8 * nv_rows) goto json_fail; |
|
|
0 |
0 |
if (*pos > len || len - *pos < 8 * nv_rows) goto json_fail; |
|
1319
|
0 |
0 |
for (k = 0; k < nv_rows; k++) { |
|
1323
|
0 |
0 |
} else if (kind == JV_BOOL) { |
|
1324
|
0 |
0 |
if (*pos > len || len - *pos < nv_rows) goto json_fail; |
|
|
0 |
0 |
if (*pos > len || len - *pos < nv_rows) goto json_fail; |
|
1326
|
0 |
0 |
for (k = 0; k < nv_rows; k++) { |
|
1330
|
0 |
0 |
} else if (kind >= JV_ARRAY_BOOL && kind <= JV_ARRAY_STRING) { |
|
|
0 |
0 |
} else if (kind >= JV_ARRAY_BOOL && kind <= JV_ARRAY_STRING) { |
|
1331
|
0 |
0 |
if (nv_rows == 0) continue; |
|
1332
|
0 |
0 |
if (*pos > len || len - *pos < 8 * nv_rows) goto json_fail; |
|
|
0 |
0 |
if (*pos > len || len - *pos < 8 * nv_rows) goto json_fail; |
|
1333
|
0 |
0 |
Newx(offs, nv_rows, uint64_t); |
|
1335
|
0 |
0 |
for (k = 0; k < nv_rows; k++) { |
|
1339
|
0 |
0 |
for (k = 0; k < nv_rows; k++) { |
|
1342
|
0 |
0 |
if (cnt > 0) av_extend(pending_inner, (SSize_t)cnt - 1); |
|
1344
|
0 |
0 |
for (j = 0; j < cnt; j++) { |
|
1347
|
0 |
0 |
if (*pos >= len) goto json_fail; |
|
1352
|
0 |
0 |
if (*pos > len || len - *pos < 8) goto json_fail; |
|
|
0 |
0 |
if (*pos > len || len - *pos < 8) goto json_fail; |
|
1358
|
0 |
0 |
if (*pos > len || len - *pos < 8) goto json_fail; |
|
|
0 |
0 |
if (*pos > len || len - *pos < 8) goto json_fail; |
|
1365
|
0 |
0 |
if (read_native_string_ref(buf, len, pos, &vs, &vl) <= 0) |
|
1385
|
0 |
0 |
for (r3 = 0; r3 < (uint64_t)nrows; r3++) { |
|
1387
|
0 |
0 |
if (d == 0xff) continue; |
|
1389
|
0 |
0 |
if (!e) continue; |
|
1392
|
0 |
0 |
if (!hv_store(row_hv, jpe[p].path, (I32)jpe[p].len, vsv, 0)) |
|
1395
|
0 |
0 |
for (s = 0; s < wire_slots; s++) |
|
1396
|
0 |
0 |
if (var_avs[s]) SvREFCNT_dec((SV*)var_avs[s]); |
|
1402
|
0 |
0 |
if (nrows > 0) { |
|
1403
|
0 |
0 |
if (*pos > len || len - *pos < 8 * (size_t)nrows) goto json_fail; |
|
|
0 |
0 |
if (*pos > len || len - *pos < 8 * (size_t)nrows) goto json_fail; |
|
1407
|
0 |
0 |
if (last_offset > 0) { |
|
1409
|
0 |
0 |
for (k = 0; k < 2 * last_offset; k++) { |
|
1411
|
0 |
0 |
if (read_native_string_ref(buf, len, pos, &s, &l) <= 0) goto json_fail; |
|
1417
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
1422
|
0 |
0 |
while ((he = hv_iternext(row_hv))) { |
|
1425
|
0 |
0 |
if (memchr(kstr, '.', klen)) |
|
1429
|
0 |
0 |
for (ki = 0; ki < nk; ki++) { |
|
1436
|
0 |
0 |
for (off = 0; off <= klen; off++) { |
|
1437
|
0 |
0 |
if (off == klen || kstr[off] == '.') { |
|
|
0 |
0 |
if (off == klen || kstr[off] == '.') { |
|
1440
|
0 |
0 |
if (off == klen) { |
|
1442
|
0 |
0 |
if (!leaf) { conflict = 1; break; } |
|
1444
|
0 |
0 |
if (!hv_store(cur, seg, (I32)slen, val, 0)) { |
|
1450
|
0 |
0 |
if (next && SvROK(*next) && SvTYPE(SvRV(*next)) == SVt_PVHV) { |
|
|
0 |
0 |
if (next && SvROK(*next) && SvTYPE(SvRV(*next)) == SVt_PVHV) { |
|
|
0 |
0 |
if (next && SvROK(*next) && SvTYPE(SvRV(*next)) == SVt_PVHV) { |
|
1452
|
0 |
0 |
} else if (next) { |
|
1464
|
0 |
0 |
if (!conflict) |
|
1469
|
0 |
0 |
if (jpe) Safefree(jpe); |
|
1470
|
0 |
0 |
if (path_kinds_buf) Safefree(path_kinds_buf); |
|
1471
|
0 |
0 |
if (path_kind_count) Safefree(path_kind_count); |
|
1475
|
0 |
0 |
if (pending_inner) SvREFCNT_dec((SV*)pending_inner); |
|
1476
|
0 |
0 |
if (offs) Safefree(offs); |
|
1477
|
0 |
0 |
if (var_avs) { |
|
1479
|
0 |
0 |
for (sx = 0; sx < wire_slots_cleanup; sx++) |
|
1480
|
0 |
0 |
if (var_avs[sx]) SvREFCNT_dec((SV*)var_avs[sx]); |
|
1483
|
0 |
0 |
if (jpe) Safefree(jpe); |
|
1484
|
0 |
0 |
if (path_kinds_buf) Safefree(path_kinds_buf); |
|
1485
|
0 |
0 |
if (path_kind_count) Safefree(path_kind_count); |
|
1486
|
0 |
0 |
for (i = 0; i < nrows; i++) if (out[i]) SvREFCNT_dec(out[i]); |
|
|
0 |
0 |
for (i = 0; i < nrows; i++) if (out[i]) SvREFCNT_dec(out[i]); |
|
1488
|
0 |
0 |
if (decode_err) *decode_err = 1; |
|
1492
|
0 |
0 |
if (ct->code == CT_MAP) { |
|
1493
|
0 |
0 |
if (ct->num_inners != 2) { if (decode_err) *decode_err = 1; goto fail; } |
|
|
0 |
0 |
if (ct->num_inners != 2) { if (decode_err) *decode_err = 1; goto fail; } |
|
1498
|
0 |
0 |
if (*pos > len || nrows > (len - *pos) / 8) goto fail; |
|
|
0 |
0 |
if (*pos > len || nrows > (len - *pos) / 8) goto fail; |
|
1499
|
0 |
0 |
Newx(offsets, nrows, uint64_t); |
|
1500
|
0 |
0 |
Copy(buf + *pos, offsets, nrows, uint64_t); |
|
1505
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
1506
|
0 |
0 |
if (offsets[i] < prev) { Safefree(offsets); goto fail; } |
|
1510
|
0 |
0 |
total = nrows > 0 ? offsets[nrows - 1] : 0; |
|
1513
|
0 |
0 |
if (!keys_col) { Safefree(offsets); goto fail; } |
|
1516
|
0 |
0 |
if (!vals_col) { |
|
1517
|
0 |
0 |
for (i = 0; i < total; i++) SvREFCNT_dec(keys_col[i]); |
|
1524
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
1528
|
0 |
0 |
for (j = 0; j < count; j++) { |
|
1533
|
0 |
0 |
if (!hv_store(hv, kstr, klen, val_sv, 0)) |
|
1541
|
0 |
0 |
for (i = 0; i < total; i++) { |
|
1553
|
0 |
0 |
if (ct->code == CT_FIXEDSTRING && fsz == 0) { |
|
|
0 |
0 |
if (ct->code == CT_FIXEDSTRING && fsz == 0) { |
|
1555
|
0 |
0 |
for (i = 0; i < nrows; i++) |
|
1559
|
0 |
0 |
if (fsz > 0) { |
|
1563
|
0 |
0 |
if (*pos > len || nrows > (len - *pos) / fsz) goto fail; |
|
|
0 |
0 |
if (*pos > len || nrows > (len - *pos) / fsz) goto fail; |
|
1566
|
0 |
0 |
if (ct->tz && (decode_flags & DECODE_DT_STR) && |
|
|
0 |
0 |
if (ct->tz && (decode_flags & DECODE_DT_STR) && |
|
1567
|
0 |
0 |
(ct->code == CT_DATETIME || ct->code == CT_DATETIME64)) { |
|
|
0 |
0 |
(ct->code == CT_DATETIME || ct->code == CT_DATETIME64)) { |
|
1572
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
1587
|
0 |
0 |
if (decode_flags & DECODE_ENUM_STR) |
|
1594
|
0 |
0 |
if (decode_flags & DECODE_ENUM_STR) |
|
1602
|
0 |
0 |
if (decode_flags & DECODE_DT_STR) |
|
1610
|
0 |
0 |
if (decode_flags & DECODE_DT_STR) |
|
1618
|
0 |
0 |
if (decode_flags & DECODE_DT_STR) |
|
1620
|
0 |
0 |
: epoch_to_datetime_sv(v); |
|
1627
|
0 |
0 |
if (decode_flags & DECODE_DT_STR) |
|
1635
|
0 |
0 |
if (decode_flags & DECODE_DEC_SCALE) |
|
1643
|
0 |
0 |
if (decode_flags & DECODE_DEC_SCALE) |
|
1651
|
0 |
0 |
if (decode_flags & DECODE_DEC_SCALE) { |
|
1731
|
0 |
0 |
if (tz_set) restore_tz(saved_tz); |
|
1737
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
1740
|
0 |
0 |
if (read_native_string_ref(buf, len, pos, &s, &slen) <= 0) { |
|
1742
|
0 |
0 |
for (j = 0; j < i; j++) SvREFCNT_dec(out[j]); |
|
1772
|
0 |
0 |
if (inet_pton(AF_INET, tmp, &addr) == 1) |
|
1793
|
0 |
0 |
if (nrows <= 0xFF) { key_type = 0; idx_size = 1; } |
|
1794
|
0 |
0 |
else if (nrows <= 0xFFFF) { key_type = 1; idx_size = 2; } |
|
1809
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
1810
|
0 |
0 |
if (idx_size == 1) { uint8_t idx = (uint8_t)i; nbuf_append(b, (const char *)&idx, 1); } |
|
1811
|
0 |
0 |
else if (idx_size == 2) { uint16_t idx = (uint16_t)i; nbuf_append(b, (const char *)&idx, 2); } |
|
1823
|
0 |
0 |
for (sc = 0; sc < precision; sc++) v *= 10; |
|
1824
|
0 |
0 |
if (len >= 20 && s[19] == '.') { |
|
|
0 |
0 |
if (len >= 20 && s[19] == '.') { |
|
1829
|
0 |
0 |
while (fp < fe && digits < precision) { |
|
|
0 |
0 |
while (fp < fe && digits < precision) { |
|
1834
|
0 |
0 |
while (digits < precision) { frac *= 10; digits++; } |
|
1851
|
0 |
0 |
if (*p == '-') { neg = 1; p++; } |
|
1852
|
0 |
0 |
else if (*p == '+') p++; |
|
1853
|
0 |
0 |
while (*p >= '0' && *p <= '9') { integer_part = integer_part * 10 + (uint64_t)(*p - '0'); p++; } |
|
|
0 |
0 |
while (*p >= '0' && *p <= '9') { integer_part = integer_part * 10 + (uint64_t)(*p - '0'); p++; } |
|
1854
|
0 |
0 |
if (*p == '.') { |
|
1856
|
0 |
0 |
while (*p >= '0' && *p <= '9' && frac_digits < scale) { |
|
|
0 |
0 |
while (*p >= '0' && *p <= '9' && frac_digits < scale) { |
|
|
0 |
0 |
while (*p >= '0' && *p <= '9' && frac_digits < scale) { |
|
1862
|
0 |
0 |
for (s = frac_digits; s < scale; s++) frac_part *= 10; |
|
1863
|
0 |
0 |
for (s = 0; s < scale; s++) integer_part *= 10; |
|
1865
|
0 |
0 |
return (int64_t)(neg ? (uint64_t)0 - raw : raw); |
|
1871
|
0 |
0 |
if (slen < 36) { |
|
1878
|
0 |
0 |
for (j = 0; j < (int)slen && k < 32; j++) { |
|
|
0 |
0 |
for (j = 0; j < (int)slen && k < 32; j++) { |
|
1881
|
0 |
0 |
if (c == '-') continue; |
|
1882
|
0 |
0 |
if (c >= '0' && c <= '9') nibble = c - '0'; |
|
|
0 |
0 |
if (c >= '0' && c <= '9') nibble = c - '0'; |
|
1883
|
0 |
0 |
else if (c >= 'a' && c <= 'f') nibble = 10 + c - 'a'; |
|
|
0 |
0 |
else if (c >= 'a' && c <= 'f') nibble = 10 + c - 'a'; |
|
1884
|
0 |
0 |
else if (c >= 'A' && c <= 'F') nibble = 10 + c - 'A'; |
|
|
0 |
0 |
else if (c >= 'A' && c <= 'F') nibble = 10 + c - 'A'; |
|
1886
|
0 |
0 |
if (k % 2 == 0) raw[k/2] = nibble << 4; |
|
1891
|
0 |
0 |
for (k = 0; k < 8; k++) ubytes[k] = raw[7 - k]; |
|
1892
|
0 |
0 |
for (k = 0; k < 8; k++) ubytes[8 + k] = raw[15 - k]; |
|
1899
|
0 |
0 |
for (i = 0; i < src_len; i++) { |
|
1900
|
0 |
0 |
if (src[i] == '\\' && i + 1 < src_len) { |
|
|
0 |
0 |
if (src[i] == '\\' && i + 1 < src_len) { |
|
1921
|
0 |
0 |
return len == 2 && s[0] == '\\' && s[1] == 'N'; |
|
|
0 |
0 |
return len == 2 && s[0] == '\\' && s[1] == 'N'; |
|
|
0 |
0 |
return len == 2 && s[0] == '\\' && s[1] == 'N'; |
|
1927
|
0 |
0 |
for (i = 0; i < len; i++) { |
|
1939
|
0 |
0 |
if (esc) { |
|
1940
|
0 |
0 |
if (i > start) |
|
1948
|
0 |
0 |
if (start < len) |
|
1961
|
0 |
0 |
for (r = 0; r < nrows; r++) { |
|
1966
|
0 |
0 |
if (!row_svp || !SvROK(*row_svp) || |
|
|
0 |
0 |
if (!row_svp || !SvROK(*row_svp) || |
|
1967
|
0 |
0 |
SvTYPE(SvRV(*row_svp)) != SVt_PVAV) { |
|
1974
|
0 |
0 |
for (c = 0; c < ncols; c++) { |
|
1976
|
0 |
0 |
if (c > 0) |
|
1979
|
0 |
0 |
if (!val_svp || !SvOK(*val_svp)) { |
|
|
0 |
0 |
if (!val_svp || !SvOK(*val_svp)) { |
|
1981
|
0 |
0 |
} else if (SvROK(*val_svp)) { |
|
2014
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2021
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2028
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2030
|
0 |
0 |
if (ct->code == CT_DATE32 && value_lens[i] >= 10 |
|
|
0 |
0 |
if (ct->code == CT_DATE32 && value_lens[i] >= 10 |
|
2031
|
0 |
0 |
&& values[i][4] == '-') |
|
2040
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2047
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2054
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2056
|
0 |
0 |
if (ct->code == CT_DATE && value_lens[i] >= 10 |
|
|
0 |
0 |
if (ct->code == CT_DATE && value_lens[i] >= 10 |
|
2057
|
0 |
0 |
&& values[i][4] == '-') |
|
2066
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2068
|
0 |
0 |
if (ct->code == CT_DATETIME && value_lens[i] >= 10 |
|
|
0 |
0 |
if (ct->code == CT_DATETIME && value_lens[i] >= 10 |
|
2069
|
0 |
0 |
&& values[i][4] == '-') |
|
2078
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2085
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2092
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2099
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2101
|
0 |
0 |
if (value_lens[i] >= 10 && values[i][4] == '-') |
|
|
0 |
0 |
if (value_lens[i] >= 10 && values[i][4] == '-') |
|
2110
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2117
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2129
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2131
|
0 |
0 |
if (memchr(values[i], '\\', value_lens[i])) { |
|
2133
|
0 |
0 |
Newx(tmp, value_lens[i] ? value_lens[i] : 1, char); |
|
2145
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2153
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2154
|
0 |
0 |
if (memchr(values[i], '\\', value_lens[i])) { |
|
2169
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2170
|
0 |
0 |
if (memchr(values[i], '\\', value_lens[i])) { |
|
2182
|
0 |
0 |
if (cplen < fsz) |
|
2191
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2199
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2206
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2222
|
0 |
0 |
Newxz(inner_vals, nrows, const char *); |
|
2223
|
0 |
0 |
Newx(inner_lens, nrows, size_t); |
|
2225
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2226
|
0 |
0 |
if (is_tsv_null(values[i], value_lens[i])) { |
|
2229
|
0 |
0 |
if (ct->inner->code == CT_STRING || ct->inner->code == CT_FIXEDSTRING) { |
|
|
0 |
0 |
if (ct->inner->code == CT_STRING || ct->inner->code == CT_FIXEDSTRING) { |
|
2261
|
0 |
0 |
if (!rc) { Safefree(dict_buf.data); return 0; } |
|
2284
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2285
|
0 |
0 |
int8_t v = SvIOK(values[i]) ? (int8_t)SvIV(values[i]) |
|
2292
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2293
|
0 |
0 |
int16_t v = SvIOK(values[i]) ? (int16_t)SvIV(values[i]) |
|
2300
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2302
|
0 |
0 |
if (SvIOK(values[i])) { |
|
2307
|
0 |
0 |
if (ct->code == CT_DATE32 && vlen >= 10 && s[4] == '-') |
|
|
0 |
0 |
if (ct->code == CT_DATE32 && vlen >= 10 && s[4] == '-') |
|
|
0 |
0 |
if (ct->code == CT_DATE32 && vlen >= 10 && s[4] == '-') |
|
2317
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2319
|
0 |
0 |
: (int64_t)strtoll(SvPV_nolen(values[i]), NULL, 10); |
|
2325
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2326
|
0 |
0 |
uint8_t v = SvIOK(values[i]) ? (uint8_t)SvUV(values[i]) |
|
2333
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2335
|
0 |
0 |
if (SvIOK(values[i])) { |
|
2340
|
0 |
0 |
if (ct->code == CT_DATE && vlen >= 10 && s[4] == '-') |
|
|
0 |
0 |
if (ct->code == CT_DATE && vlen >= 10 && s[4] == '-') |
|
|
0 |
0 |
if (ct->code == CT_DATE && vlen >= 10 && s[4] == '-') |
|
2350
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2352
|
0 |
0 |
if (SvIOK(values[i])) { |
|
2357
|
0 |
0 |
if (ct->code == CT_DATETIME && vlen >= 10 && s[4] == '-') |
|
|
0 |
0 |
if (ct->code == CT_DATETIME && vlen >= 10 && s[4] == '-') |
|
|
0 |
0 |
if (ct->code == CT_DATETIME && vlen >= 10 && s[4] == '-') |
|
2367
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2369
|
0 |
0 |
: (uint64_t)strtoull(SvPV_nolen(values[i]), NULL, 10); |
|
2375
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2377
|
0 |
0 |
: strtof(SvPV_nolen(values[i]), NULL); |
|
2383
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2385
|
0 |
0 |
: strtod(SvPV_nolen(values[i]), NULL); |
|
2391
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2393
|
0 |
0 |
if (SvIOK(values[i])) { |
|
2398
|
0 |
0 |
if (vlen >= 10 && s[4] == '-') |
|
|
0 |
0 |
if (vlen >= 10 && s[4] == '-') |
|
2408
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2415
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2424
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2434
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2436
|
0 |
0 |
: (float)strtod(SvPV_nolen(values[i]), NULL); |
|
2444
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2453
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2459
|
0 |
0 |
if (cplen < fsz) |
|
2466
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2476
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2485
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2500
|
0 |
0 |
Newx(inner_vals, nrows ? nrows : 1, SV *); |
|
|
0 |
0 |
Newx(inner_vals, nrows ? nrows : 1, SV *); |
|
|
0 |
0 |
Newx(inner_vals, nrows ? nrows : 1, SV *); |
|
2503
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2504
|
0 |
0 |
if (!SvOK(values[i])) { |
|
2530
|
0 |
0 |
if (!rc) { Safefree(dict_buf.data); return 0; } |
|
2544
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2546
|
0 |
0 |
if (!SvROK(values[i]) || SvTYPE(SvRV(values[i])) != SVt_PVAV) |
|
|
0 |
0 |
if (!SvROK(values[i]) || SvTYPE(SvRV(values[i])) != SVt_PVAV) |
|
2549
|
0 |
0 |
{ SSize_t cnt = av_len(av) + 1; if (cnt > 0) total += (uint64_t)cnt; } |
|
2552
|
0 |
0 |
Newx(offsets, nrows, uint64_t); |
|
2553
|
0 |
0 |
Newx(all_elems, total ? total : 1, SV *); |
|
|
0 |
0 |
Newx(all_elems, total ? total : 1, SV *); |
|
|
0 |
0 |
Newx(all_elems, total ? total : 1, SV *); |
|
2555
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2558
|
0 |
0 |
for (j = 0; j < n; j++) { |
|
2560
|
0 |
0 |
all_elems[pos++] = ep ? *ep : &PL_sv_undef; |
|
2575
|
0 |
0 |
for (j = 0; j < ct->num_inners; j++) { |
|
2578
|
0 |
0 |
Newx(col_vals, nrows ? nrows : 1, SV *); |
|
|
0 |
0 |
Newx(col_vals, nrows ? nrows : 1, SV *); |
|
|
0 |
0 |
Newx(col_vals, nrows ? nrows : 1, SV *); |
|
2579
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2582
|
0 |
0 |
if (!SvROK(values[i]) || SvTYPE(SvRV(values[i])) != SVt_PVAV) { |
|
|
0 |
0 |
if (!SvROK(values[i]) || SvTYPE(SvRV(values[i])) != SVt_PVAV) { |
|
2588
|
0 |
0 |
col_vals[i] = ep ? *ep : &PL_sv_undef; |
|
2592
|
0 |
0 |
if (!rc) return 0; |
|
2604
|
0 |
0 |
if (ct->num_inners != 2) return 0; |
|
2606
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2608
|
0 |
0 |
if (!SvROK(values[i]) || SvTYPE(SvRV(values[i])) != SVt_PVHV) |
|
|
0 |
0 |
if (!SvROK(values[i]) || SvTYPE(SvRV(values[i])) != SVt_PVHV) |
|
2611
|
0 |
0 |
total += HvUSEDKEYS(hv); |
|
2614
|
0 |
0 |
Newx(offsets, nrows, uint64_t); |
|
2615
|
0 |
0 |
Newx(all_keys, total ? total : 1, SV *); |
|
|
0 |
0 |
Newx(all_keys, total ? total : 1, SV *); |
|
|
0 |
0 |
Newx(all_keys, total ? total : 1, SV *); |
|
2616
|
0 |
0 |
Newx(all_vals, total ? total : 1, SV *); |
|
|
0 |
0 |
Newx(all_vals, total ? total : 1, SV *); |
|
|
0 |
0 |
Newx(all_vals, total ? total : 1, SV *); |
|
2618
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2622
|
0 |
0 |
while ((he = hv_iternext(hv))) { |
|
2632
|
0 |
0 |
if (rc) rc = encode_column_sv(aTHX_ b, all_vals, total, ct->inners[1]); |
|
2650
|
0 |
0 |
if (nrows > 0) { |
|
2651
|
0 |
0 |
Newxz(row_hvs, nrows, HV*); |
|
2656
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2658
|
0 |
0 |
if (!SvOK(val)) { row_hvs[i] = NULL; continue; } |
|
2659
|
0 |
0 |
if (!SvROK(val) || SvTYPE(SvRV(val)) != SVt_PVHV) { |
|
|
0 |
0 |
if (!SvROK(val) || SvTYPE(SvRV(val)) != SVt_PVHV) { |
|
2660
|
0 |
0 |
FREETMPS; LEAVE; |
|
2672
|
0 |
0 |
int n_typed = (ct->code == CT_JSON) ? ct->num_inners : 0; |
|
2674
|
0 |
0 |
if (n_typed > 0 && nrows > 0) { |
|
|
0 |
0 |
if (n_typed > 0 && nrows > 0) { |
|
2678
|
0 |
0 |
for (tp = 0; tp < n_typed; tp++) { |
|
2679
|
0 |
0 |
Newxz(typed_vals[tp], nrows, SV *); |
|
2682
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2683
|
0 |
0 |
if (!row_hvs[i]) { |
|
2689
|
0 |
0 |
if (e && SvOK(*e)) { |
|
|
0 |
0 |
if (e && SvOK(*e)) { |
|
2702
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2703
|
0 |
0 |
if (!row_hvs[i]) continue; |
|
2706
|
0 |
0 |
while ((he = hv_iternext(row_hvs[i]))) { |
|
2713
|
0 |
0 |
int num_paths = (int)HvUSEDKEYS(all_paths); |
|
2715
|
0 |
0 |
if (num_paths > 0) { |
|
2721
|
0 |
0 |
while ((he = hv_iternext(all_paths))) { |
|
2728
|
0 |
0 |
if (num_paths > 1) |
|
2733
|
0 |
0 |
if (num_paths > 0) { |
|
2736
|
0 |
0 |
for (p = 0; p < num_paths; p++) { |
|
2737
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2738
|
0 |
0 |
if (!row_hvs[i]) continue; |
|
2740
|
0 |
0 |
if (!e || !SvOK(*e)) continue; |
|
|
0 |
0 |
if (!e || !SvOK(*e)) continue; |
|
2742
|
0 |
0 |
if (k < 0) { FREETMPS; LEAVE; return 0; } |
|
|
0 |
0 |
if (k < 0) { FREETMPS; LEAVE; return 0; } |
|
2752
|
0 |
0 |
for (p = 0; p < num_paths; p++) |
|
2757
|
0 |
0 |
if (num_paths > 0) { |
|
2762
|
0 |
0 |
for (p = 0; p < num_paths; p++) |
|
2768
|
0 |
0 |
for (p = 0; p < num_paths; p++) { |
|
2776
|
0 |
0 |
for (s = 0; s < wire_slots; s++) { |
|
2778
|
0 |
0 |
if (k < 0) continue; |
|
2788
|
0 |
0 |
if (n_typed > 0) { |
|
2790
|
0 |
0 |
for (tp = 0; tp < n_typed; tp++) { |
|
2793
|
0 |
0 |
if (rc != 1) { FREETMPS; LEAVE; return 0; } |
|
|
0 |
0 |
if (rc != 1) { FREETMPS; LEAVE; return 0; } |
|
2798
|
0 |
0 |
for (p = 0; p < num_paths; p++) { |
|
2803
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2804
|
0 |
0 |
if (!row_hvs[i]) { nbuf_u8(b, 0xff); continue; } |
|
2806
|
0 |
0 |
if (!e || !SvOK(*e)) { nbuf_u8(b, 0xff); continue; } |
|
|
0 |
0 |
if (!e || !SvOK(*e)) { nbuf_u8(b, 0xff); continue; } |
|
2813
|
0 |
0 |
for (s = 0; s < wire_slots; s++) { |
|
2815
|
0 |
0 |
if (k_match < 0) continue; |
|
2817
|
0 |
0 |
&& k_match <= JV_ARRAY_STRING); |
|
|
0 |
0 |
&& k_match <= JV_ARRAY_STRING); |
|
2818
|
0 |
0 |
if (is_array) { |
|
2820
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2821
|
0 |
0 |
if (!row_hvs[i]) continue; |
|
2824
|
0 |
0 |
if (!e || !SvOK(*e)) continue; |
|
|
0 |
0 |
if (!e || !SvOK(*e)) continue; |
|
2825
|
0 |
0 |
if (json_classify_value(aTHX_ *e) != k_match) continue; |
|
2832
|
0 |
0 |
for (i = 0; i < nrows; i++) { |
|
2833
|
0 |
0 |
if (!row_hvs[i]) continue; |
|
2836
|
0 |
0 |
if (!e || !SvOK(*e)) continue; |
|
|
0 |
0 |
if (!e || !SvOK(*e)) continue; |
|
2837
|
0 |
0 |
if (json_classify_value(aTHX_ *e) != k_match) continue; |
|
2838
|
0 |
0 |
if (is_array) { |
|
2841
|
0 |
0 |
for (j = 0; j < n; j++) { |
|
2843
|
0 |
0 |
SV *ev = (elem && SvOK(*elem)) |
|
2844
|
0 |
0 |
? *elem : &PL_sv_undef; |
|
2855
|
0 |
0 |
if (nrows > 0) { |
|
2861
|
0 |
0 |
FREETMPS; LEAVE; |
|
2931
|
0 |
0 |
while (p < end) { |
|
2933
|
0 |
0 |
const char *line_limit = line_end ? line_end : end; |
|
2937
|
0 |
0 |
if (p == line_limit) { p = line_limit + 1; continue; } |
|
2939
|
0 |
0 |
if (nrows >= max_rows) { |
|
2940
|
0 |
0 |
if (max_rows > INT_MAX / 2 || |
|
|
0 |
0 |
if (max_rows > INT_MAX / 2 || |
|
2941
|
0 |
0 |
(num_cols > 0 && max_rows * 2 > INT_MAX / num_cols)) { |
|
2955
|
0 |
0 |
for (col = 0; col < num_cols; col++) { |
|
2957
|
0 |
0 |
if (fp > line_limit) fp = line_limit; |
|
2958
|
0 |
0 |
if (col < num_cols - 1) { |
|
2960
|
0 |
0 |
if (!tab) tab = line_limit; |
|
2973
|
0 |
0 |
if (nrows == 0) { |
|
2991
|
0 |
0 |
for (col = 0; col < num_cols; col++) { |
|
3004
|
0 |
0 |
for (row = 0; row < nrows; row++) { |
|
3009
|
0 |
0 |
if (!encode_column_text(&body, col_vals, col_vlens, |
|
3045
|
0 |
0 |
if (nrows <= 0) { |
|
3056
|
0 |
0 |
for (col = 0; col < num_cols; col++) { |
|
3065
|
0 |
0 |
Newx(col_vals, nrows, SV *); |
|
3066
|
0 |
0 |
for (row = 0; row < nrows; row++) { |
|
3071
|
0 |
0 |
if (!row_svp || !SvROK(*row_svp) || SvTYPE(SvRV(*row_svp)) != SVt_PVAV) { |
|
|
0 |
0 |
if (!row_svp || !SvROK(*row_svp) || SvTYPE(SvRV(*row_svp)) != SVt_PVAV) { |
|
|
0 |
0 |
if (!row_svp || !SvROK(*row_svp) || SvTYPE(SvRV(*row_svp)) != SVt_PVAV) { |
|
3079
|
0 |
0 |
col_vals[row] = (val_svp && *val_svp) ? *val_svp : &PL_sv_undef; |
|
|
0 |
0 |
col_vals[row] = (val_svp && *val_svp) ? *val_svp : &PL_sv_undef; |
|
3082
|
0 |
0 |
if (!encode_column_sv(aTHX_ &body, col_vals, (uint64_t)nrows, col_types[col])) { |
|
3115
|
0 |
0 |
while ((he = hv_iternext(external))) { |
|
3127
|
0 |
0 |
if (!SvROK(spec_sv) || SvTYPE(SvRV(spec_sv)) != SVt_PVHV) { |
|
|
0 |
0 |
if (!SvROK(spec_sv) || SvTYPE(SvRV(spec_sv)) != SVt_PVHV) { |
|
3135
|
0 |
0 |
if (!st || !SvROK(*st) || SvTYPE(SvRV(*st)) != SVt_PVAV) { |
|
|
0 |
0 |
if (!st || !SvROK(*st) || SvTYPE(SvRV(*st)) != SVt_PVAV) { |
|
|
0 |
0 |
if (!st || !SvROK(*st) || SvTYPE(SvRV(*st)) != SVt_PVAV) { |
|
3140
|
0 |
0 |
if (!dt || !SvROK(*dt) || SvTYPE(SvRV(*dt)) != SVt_PVAV) { |
|
|
0 |
0 |
if (!dt || !SvROK(*dt) || SvTYPE(SvRV(*dt)) != SVt_PVAV) { |
|
|
0 |
0 |
if (!dt || !SvROK(*dt) || SvTYPE(SvRV(*dt)) != SVt_PVAV) { |
|
3148
|
0 |
0 |
if (sn < 2 || (sn & 1)) { |
|
|
0 |
0 |
if (sn < 2 || (sn & 1)) { |
|
3155
|
0 |
0 |
if (nrows < 0) nrows = 0; |
|
3163
|
0 |
0 |
for (col = 0; col < ncols; col++) { |
|
3172
|
0 |
0 |
if (!nm || !ty || !SvOK(*nm) || !SvOK(*ty)) { |
|
|
0 |
0 |
if (!nm || !ty || !SvOK(*nm) || !SvOK(*ty)) { |
|
|
0 |
0 |
if (!nm || !ty || !SvOK(*nm) || !SvOK(*ty)) { |
|
|
0 |
0 |
if (!nm || !ty || !SvOK(*nm) || !SvOK(*ty)) { |
|
3187
|
0 |
0 |
Newx(col_vals, nrows > 0 ? nrows : 1, SV *); |
|
|
0 |
0 |
Newx(col_vals, nrows > 0 ? nrows : 1, SV *); |
|
|
0 |
0 |
Newx(col_vals, nrows > 0 ? nrows : 1, SV *); |
|
3188
|
0 |
0 |
for (row = 0; row < nrows; row++) { |
|
3192
|
0 |
0 |
if (!rsv || !SvROK(*rsv) || SvTYPE(SvRV(*rsv)) != SVt_PVAV) { |
|
|
0 |
0 |
if (!rsv || !SvROK(*rsv) || SvTYPE(SvRV(*rsv)) != SVt_PVAV) { |
|
|
0 |
0 |
if (!rsv || !SvROK(*rsv) || SvTYPE(SvRV(*rsv)) != SVt_PVAV) { |
|
3202
|
0 |
0 |
col_vals[row] = (vsv && *vsv) ? *vsv : &PL_sv_undef; |
|
|
0 |
0 |
col_vals[row] = (vsv && *vsv) ? *vsv : &PL_sv_undef; |
|
3209
|
0 |
0 |
if (!enc) { |