| 2971 | } |
| 2972 | |
| 2973 | static cyp_partial_t eval_where_partial(const cbm_where_clause_t *w, binding_t *b) { |
| 2974 | if (!w) { |
| 2975 | return CYP_PARTIAL_TRUE; |
| 2976 | } |
| 2977 | if (w->root) { |
| 2978 | return eval_expr_partial(w->root, b); |
| 2979 | } |
| 2980 | /* Legacy flat evaluation */ |
| 2981 | if (w->count == 0) { |
| 2982 | return CYP_PARTIAL_TRUE; |
| 2983 | } |
| 2984 | bool is_and = (w->op && strcmp(w->op, "AND") == 0) != 0; |
| 2985 | cyp_partial_t result = is_and ? CYP_PARTIAL_TRUE : CYP_PARTIAL_FALSE; |
| 2986 | for (int i = 0; i < w->count; i++) { |
| 2987 | cyp_partial_t r = eval_condition_partial(&w->conditions[i], b); |
| 2988 | result = is_and ? partial_and(result, r) : partial_or(result, r); |
| 2989 | } |
| 2990 | return result; |
| 2991 | } |
| 2992 | |
| 2993 | /* Check if a string value looks like a regex pattern. */ |
| 2994 | static bool looks_like_regex(const char *s) { |
no test coverage detected