`sorted` must hold the rows of `unsorted` in the reference order. */
| 5661 | |
| 5662 | /* `sorted` must hold the rows of `unsorted` in the reference order. */ |
| 5663 | static bool ref_rows_in_order(const cbm_cypher_result_t *sorted, |
| 5664 | const cbm_cypher_result_t *unsorted, ref_cmp_fn cmp) { |
| 5665 | if (sorted->row_count != unsorted->row_count || sorted->col_count != unsorted->col_count || |
| 5666 | unsorted->row_count < REF_NODES) { |
| 5667 | return false; |
| 5668 | } |
| 5669 | int order[REF_NODES * 4]; |
| 5670 | ref_stable_order(unsorted, order, cmp); |
| 5671 | for (int i = 0; i < sorted->row_count; i++) { |
| 5672 | for (int c = 0; c < sorted->col_count; c++) { |
| 5673 | if (strcmp(sorted->rows[i][c], unsorted->rows[order[i]][c]) != 0) { |
| 5674 | return false; |
| 5675 | } |
| 5676 | } |
| 5677 | } |
| 5678 | return true; |
| 5679 | } |
| 5680 | |
| 5681 | static bool ref_query(cbm_store_t *s, const char *query, cbm_cypher_result_t *out) { |
| 5682 | memset(out, 0, sizeof(*out)); |
no test coverage detected