static int parse_tree_anr_present(struct ldb_parse_tree *tree, void *private_context)
{
	struct anr_present_ctx *ctx = private_context;
	switch (tree->operation) {
	case LDB_OP_EQUALITY:
	case LDB_OP_GREATER:
	case LDB_OP_LESS:
	case LDB_OP_APPROX:
		if (ldb_attr_cmp(tree->u.equality.attr, ctx->attr) == 0) {
			ctx->found_anr = true;
		}
		break;
	case LDB_OP_SUBSTRING:
		if (ldb_attr_cmp(tree->u.substring.attr, ctx->attr) == 0) {
			ctx->found_anr = true;
		}
		break;
	case LDB_OP_PRESENT:
		if (ldb_attr_cmp(tree->u.present.attr, ctx->attr) == 0) {
			ctx->found_anr = true;
		}
		break;
	case LDB_OP_EXTENDED:
		if (tree->u.extended.attr &&
		    ldb_attr_cmp(tree->u.extended.attr, ctx->attr) == 0) {
			ctx->found_anr = true;
		}
		break;
	default:
		break;
	}
	return LDB_SUCCESS;
}
static int parse_tree_anr_present(struct ldb_parse_tree *tree, void *private_context)
{
	struct anr_present_ctx *ctx = private_context;
	switch (tree->operation) {
	case LDB_OP_EQUALITY:
	case LDB_OP_GREATER:
	case LDB_OP_LESS:
	case LDB_OP_APPROX:
		if (ldb_attr_cmp(tree->u.equality.attr, ctx->attr) == 0) {
			ctx->found_anr = true;
		}
		break;
	case LDB_OP_SUBSTRING:
		if (ldb_attr_cmp(tree->u.substring.attr, ctx->attr) == 0) {
			ctx->found_anr = true;
		}
		break;
	case LDB_OP_PRESENT:
		if (ldb_attr_cmp(tree->u.present.attr, ctx->attr) == 0) {
			ctx->found_anr = true;
		}
		break;
	case LDB_OP_EXTENDED:
		if (tree->u.extended.attr &&
		    ldb_attr_cmp(tree->u.extended.attr, ctx->attr) == 0) {
			ctx->found_anr = true;
		}
		break;
	default:
		break;
	}
	return LDB_SUCCESS;
}