Branch Coverage

src/parser.c
Criterion Covered Total %
branch 224 396 56.5


line true false branch
11 389 182 while (*p != '\0') {
12 468 0 SKIP_WSPACE(p);
79 389 SKIP_WSPACE(p);
13 389 0 if (*p == '\0') break;
39 9 0 if (! ret) {
53 494 142 while (*p != '\0') {
55 66 428 if (*p == '/') {
57 66 0 if (*(p + 1) == '*') {
66 36 392 else if (*p == '-' && *(p + 1) == '-') {
36 0 else if (*p == '-' && *(p + 1) == '-') {
68 1144 36 while (*p != '\0' && *p != '\n') p++;
70 20 372 else if (IS_WSPACE(p)) {
71 40 0 SKIP_WSPACE(p);
20 20 SKIP_WSPACE(p);
73 8 364 else if (*p == 'C') {
75 8 0 if (IS_CREATE(p)) {
2 6 if (IS_CREATE(p)) {
2 0 if (IS_CREATE(p)) {
2 0 if (IS_CREATE(p)) {
2 0 if (IS_CREATE(p)) {
2 0 if (IS_CREATE(p)) {
77 4 0 SKIP_WSPACE(p);
2 2 SKIP_WSPACE(p);
78 2 0 if (*p == '\0') break;
79 2 0 if (IS_TABLE(p)) {
2 0 if (IS_TABLE(p)) {
2 0 if (IS_TABLE(p)) {
2 0 if (IS_TABLE(p)) {
2 0 if (IS_TABLE(p)) {
81 4 0 SKIP_WSPACE(p);
2 2 SKIP_WSPACE(p);
86 0 2 if (*p == '`') {
88 8 2 while (*p != '\0' && *p != '`') p++;
92 0 0 SKIP_UNTIL_WSPACE(p);
0 0 SKIP_UNTIL_WSPACE(p);
94 2 0 if (*p == '\0') break;
97 4 0 SKIP_WSPACE(p);
2 2 SKIP_WSPACE(p);
106 16 348 else if (*p == 'I') {
108 16 0 if (IS_INSERT(p)) {
9 7 if (IS_INSERT(p)) {
9 0 if (IS_INSERT(p)) {
9 0 if (IS_INSERT(p)) {
9 0 if (IS_INSERT(p)) {
9 0 if (IS_INSERT(p)) {
110 18 0 SKIP_WSPACE(p);
9 9 SKIP_WSPACE(p);
111 9 0 if (*p == '\0') break;
112 9 0 if (IS_INTO(p)) {
9 0 if (IS_INTO(p)) {
9 0 if (IS_INTO(p)) {
9 0 if (IS_INTO(p)) {
114 18 0 SKIP_WSPACE(p);
9 9 SKIP_WSPACE(p);
119 0 9 if (*p == '`') {
121 35 9 while (*p != '\0' && *p != '`') p++;
125 0 0 SKIP_UNTIL_WSPACE(p);
0 0 SKIP_UNTIL_WSPACE(p);
127 9 0 if (*p == '\0') break;
130 18 0 SKIP_WSPACE(p);
9 9 SKIP_WSPACE(p);
147 4859 16 while (*p != '\0') {
149 4791 68 if (*p++ == '*') {
150 68 0 if (*p++ == '/') {
162 48 2 while (*p != '\0') {
164 2 46 if (*p == '/') {
166 2 0 if (*(p + 1) == '*') {
172 0 46 else if (*p == '-' && *(p + 1) == '-') {
0 0 else if (*p == '-' && *(p + 1) == '-') {
174 0 0 while (*p != '\0' && *p != '\n') p++;
176 0 46 else if (IS_WSPACE(p)) {
177 0 0 SKIP_WSPACE(p);
0 0 SKIP_WSPACE(p);
179 2 44 else if (*p == '(') {
183 0 44 else if (*p == ')') {
190 4 40 if (nest == 0) {
191 106 2 while (*p != '\0' && *p != '(' && *p != ';' && *p != '/') p++;
104 2 while (*p != '\0' && *p != '(' && *p != ';' && *p != '/') p++;
104 0 while (*p != '\0' && *p != '(' && *p != ';' && *p != '/') p++;
192 2 2 if (*p == ';') {
201 40 0 else if (nest == 1) {
202 4 36 if (! IS_MAYBE_KEY(p)) {
4 0 if (! IS_MAYBE_KEY(p)) {
0 4 if (! IS_MAYBE_KEY(p)) {
0 36 if (! IS_MAYBE_KEY(p)) {
0 0 if (! IS_MAYBE_KEY(p)) {
0 0 if (! IS_MAYBE_KEY(p)) {
0 0 if (! IS_MAYBE_KEY(p)) {
0 0 if (! IS_MAYBE_KEY(p)) {
0 36 if (! IS_MAYBE_KEY(p)) {
0 0 if (! IS_MAYBE_KEY(p)) {
0 0 if (! IS_MAYBE_KEY(p)) {
0 0 if (! IS_MAYBE_KEY(p)) {
0 0 if (! IS_MAYBE_KEY(p)) {
0 0 if (! IS_MAYBE_KEY(p)) {
2 34 if (! IS_MAYBE_KEY(p)) {
2 0 if (! IS_MAYBE_KEY(p)) {
2 0 if (! IS_MAYBE_KEY(p)) {
2 0 if (! IS_MAYBE_KEY(p)) {
2 0 if (! IS_MAYBE_KEY(p)) {
2 0 if (! IS_MAYBE_KEY(p)) {
0 2 if (! IS_MAYBE_KEY(p)) {
204 20 14 if (*p == '`') {
206 88 14 while (*p != '\0' && *p != '`') p++;
210 20 20 SKIP_UNTIL_WSPACE(p);
20 0 SKIP_UNTIL_WSPACE(p);
212 14 20 if (*p == '\0') break;
231 774 2 if (*p == '\0') {
234 0 774 else if (*p == '/') {
236 0 0 if (*(p + 1) == '*') {
242 0 774 else if (*p == '-' && *(p + 1) == '-') {
0 0 else if (*p == '-' && *(p + 1) == '-') {
244 0 0 while (*p != '\0' && *p != '\n') p++;
246 80 694 else if (IS_WSPACE(p)) {
247 0 160 SKIP_WSPACE(p);
80 80 SKIP_WSPACE(p);
249 16 678 else if (*p == '(') {
253 18 660 else if (*p == ')') {
255 16 2 if (nest == 0) break;
259 14 646 else if (*p == '\'' || *p == '"') {
261 70 0 while (*p != '\0' && *p != symbol) {
56 14 while (*p != '\0' && *p != symbol) {
262 4 52 if (*p == '\\') p++;
265 0 14 if (*p != '\0') p++;
270 526 120 if (nest == 0 && *p == ',') {
508 18 if (nest == 0 && *p == ',') {
280 18 2 if (*p != ')') incr_nest(aTHX_ state); /* XXX: fix nest to 1 */
286 21 0 while (*p != '\0') {
288 0 21 if (*p == '/') {
290 0 0 if (*(p + 1) == '*') {
296 0 21 else if (*p == '-' && *(p + 1) == '-') {
0 0 else if (*p == '-' && *(p + 1) == '-') {
298 0 0 while (*p != '\0' && *p != '\n') p++;
300 6 15 else if (IS_WSPACE(p)) {
301 12 0 SKIP_WSPACE(p);
6 6 SKIP_WSPACE(p);
303 6 9 else if (*p == '(') {
311 42 6 while (*p != '\0' && *p != ')') {
312 42 0 SKIP_WSPACE(p);
0 42 SKIP_WSPACE(p);
313 0 42 if (*p == '`') {
315 264 42 while (*p != '\0' && *p != '`') p++;
319 0 0 while (*p != '\0' && *p != ',' && *p != ')') p++;
0 0 while (*p != '\0' && *p != ',' && *p != ')') p++;
321 42 0 if (*p == '\0') break;
324 36 6 if (*++p == ',') p++;
326 6 0 if (*p == '\0') break;
329 9 0 else if (IS_VALUES(p)) {
9 0 else if (IS_VALUES(p)) {
9 0 else if (IS_VALUES(p)) {
9 0 else if (IS_VALUES(p)) {
9 0 else if (IS_VALUES(p)) {
9 0 else if (IS_VALUES(p)) {
344 54 0 while (*p != '\0') {
346 0 54 if (*p == '/') {
348 0 0 if (*(p + 1) == '*') {
354 0 54 else if (*p == '-' && *(p + 1) == '-') {
0 0 else if (*p == '-' && *(p + 1) == '-') {
356 0 0 while (*p != '\0' && *p != '\n') p++;
358 0 54 else if (IS_WSPACE(p)) {
359 0 0 SKIP_WSPACE(p);
0 0 SKIP_WSPACE(p);
361 18 36 else if (*p == '(') {
368 126 18 while (*p != '\0' && *p != ')') {
371 0 126 if (! column_ref) croak("Cannot fetch columns[%d]", column_id);
377 12 114 if (IS_NULL_STR(p)) {
12 0 if (IS_NULL_STR(p)) {
12 0 if (IS_NULL_STR(p)) {
12 0 if (IS_NULL_STR(p)) {
378 0 12 if (have_binary_literal)
386 0 114 else if (IS__binary(p)) {
0 0 else if (IS__binary(p)) {
0 0 else if (IS__binary(p)) {
0 0 else if (IS__binary(p)) {
0 0 else if (IS__binary(p)) {
0 0 else if (IS__binary(p)) {
0 0 else if (IS__binary(p)) {
387 0 0 if (have_binary_literal)
392 0 0 SKIP_WSPACE(p);
0 0 SKIP_WSPACE(p);
396 54 60 else if (*p == '\'' || *p == '"') {
401 796 0 while (*p != '\0' && *p != symbol) {
742 54 while (*p != '\0' && *p != symbol) {
403 2 740 if (*p == '\\') {
406 2 0 if (value == NULL) {
442 52 2 if (value == NULL) {
455 60 0 if (have_binary_literal)
460 63 60 while (*p != '\0' && *p != ',' && *p != ')') p++;
63 0 while (*p != '\0' && *p != ',' && *p != ')') p++;
469 72 108 while (*p != '\0' && *p != ',' && *p != ')') p++;
54 18 while (*p != '\0' && *p != ',' && *p != ')') p++;
470 126 0 if (*p == '\0') return p;
471 126 0 SKIP_WSPACE(p);
0 126 SKIP_WSPACE(p);
472 108 18 if (*p == ',') {
476 126 0 SKIP_WSPACE(p);
0 126 SKIP_WSPACE(p);
481 9 27 else if (*p == ';') {