True when every chunk size reproduces the single-pass result, which is * left in *ref for the caller's own checks (caller frees). */
| 5879 | /* True when every chunk size reproduces the single-pass result, which is |
| 5880 | * left in *ref for the caller's own checks (caller frees). */ |
| 5881 | static bool stream_matches_single_pass(cbm_store_t *s, const char *query, int max_rows, |
| 5882 | cbm_cypher_result_t *ref) { |
| 5883 | static const int chunks[] = {1, 7, 64, 0 /* production default */}; |
| 5884 | int ref_rc = stream_run(s, query, max_rows, INT_MAX, ref); |
| 5885 | bool same = ref_rc == 0; |
| 5886 | for (size_t i = 0; same && i < sizeof(chunks) / sizeof(chunks[0]); i++) { |
| 5887 | cbm_cypher_result_t got; |
| 5888 | int rc = stream_run(s, query, max_rows, chunks[i], &got); |
| 5889 | same = rc == ref_rc && stream_results_equal(ref, &got); |
| 5890 | if (!same) { |
| 5891 | printf(" chunk %d differs from the single pass: %s\n", chunks[i], query); |
| 5892 | } |
| 5893 | cbm_cypher_result_free(&got); |
| 5894 | } |
| 5895 | return same; |
| 5896 | } |
| 5897 | |
| 5898 | /* Every pipeline consumer across chunk boundaries: unsorted rows, global and |
| 5899 | * grouped aggregates (groups fed from many chunks), DISTINCT, late WHERE, |
no test coverage detected