diff --git a/distr/flecs.c b/distr/flecs.c index 8e2b3fffb..e84275286 100644 --- a/distr/flecs.c +++ b/distr/flecs.c @@ -1532,6 +1532,7 @@ typedef struct { /* *From operator iterator context */ typedef struct { ecs_query_and_ctx_t and; + ecs_entity_t type_id; ecs_type_t *type; int32_t first_id_index; int32_t cur_id_index; @@ -70614,13 +70615,15 @@ bool flecs_query_x_from( ecs_query_xfrom_ctx_t *op_ctx = flecs_op_ctx(ctx, xfrom); ecs_world_t *world = ctx->world; ecs_type_t *type; + ecs_entity_t type_id; int32_t i; if (!redo) { /* Find entity that acts as the template from which we match the ids */ - ecs_id_t id = flecs_query_op_get_id(op, ctx); - ecs_assert(ecs_is_alive(world, id), ECS_INTERNAL_ERROR, NULL); - ecs_record_t *r = flecs_entities_get(world, id); + type_id = flecs_query_op_get_id(op, ctx); + op_ctx->type_id = type_id; + ecs_assert(ecs_is_alive(world, type_id), ECS_INTERNAL_ERROR, NULL); + ecs_record_t *r = flecs_entities_get(world, type_id); ecs_table_t *table; if (!r || !(table = r->table)) { /* Nothing to match */ @@ -70637,6 +70640,7 @@ bool flecs_query_x_from( return false; /* No ids to filter on */ } } else { + type_id = op_ctx->type_id; type = op_ctx->type; } @@ -70682,7 +70686,7 @@ bool flecs_query_x_from( if (!src_table) { continue; } - + redo = true; if (!src_written && oper == EcsOrFrom) { @@ -70708,7 +70712,7 @@ bool flecs_query_x_from( continue; } } - return true; + goto match; } if (oper == EcsAndFrom || oper == EcsNotFrom || src_written) { @@ -70734,7 +70738,7 @@ bool flecs_query_x_from( if (oper == EcsNotFrom) { break; /* Must have none of the ids */ } else if (oper == EcsOrFrom) { - return true; /* Single match is enough */ + goto match; /* Single match is enough */ } } } @@ -70747,6 +70751,8 @@ bool flecs_query_x_from( } } while (true); +match: + ctx->it->ids[op->field_index] = type_id; return true; } diff --git a/src/query/engine/eval.c b/src/query/engine/eval.c index b600801d2..b104d3c26 100644 --- a/src/query/engine/eval.c +++ b/src/query/engine/eval.c @@ -398,13 +398,15 @@ bool flecs_query_x_from( ecs_query_xfrom_ctx_t *op_ctx = flecs_op_ctx(ctx, xfrom); ecs_world_t *world = ctx->world; ecs_type_t *type; + ecs_entity_t type_id; int32_t i; if (!redo) { /* Find entity that acts as the template from which we match the ids */ - ecs_id_t id = flecs_query_op_get_id(op, ctx); - ecs_assert(ecs_is_alive(world, id), ECS_INTERNAL_ERROR, NULL); - ecs_record_t *r = flecs_entities_get(world, id); + type_id = flecs_query_op_get_id(op, ctx); + op_ctx->type_id = type_id; + ecs_assert(ecs_is_alive(world, type_id), ECS_INTERNAL_ERROR, NULL); + ecs_record_t *r = flecs_entities_get(world, type_id); ecs_table_t *table; if (!r || !(table = r->table)) { /* Nothing to match */ @@ -421,6 +423,7 @@ bool flecs_query_x_from( return false; /* No ids to filter on */ } } else { + type_id = op_ctx->type_id; type = op_ctx->type; } @@ -466,7 +469,7 @@ bool flecs_query_x_from( if (!src_table) { continue; } - + redo = true; if (!src_written && oper == EcsOrFrom) { @@ -492,7 +495,7 @@ bool flecs_query_x_from( continue; } } - return true; + goto match; } if (oper == EcsAndFrom || oper == EcsNotFrom || src_written) { @@ -518,7 +521,7 @@ bool flecs_query_x_from( if (oper == EcsNotFrom) { break; /* Must have none of the ids */ } else if (oper == EcsOrFrom) { - return true; /* Single match is enough */ + goto match; /* Single match is enough */ } } } @@ -531,6 +534,8 @@ bool flecs_query_x_from( } } while (true); +match: + ctx->it->ids[op->field_index] = type_id; return true; } diff --git a/src/query/types.h b/src/query/types.h index 51b923dd7..fc6c4199d 100644 --- a/src/query/types.h +++ b/src/query/types.h @@ -258,6 +258,7 @@ typedef struct { /* *From operator iterator context */ typedef struct { ecs_query_and_ctx_t and; + ecs_entity_t type_id; ecs_type_t *type; int32_t first_id_index; int32_t cur_id_index; diff --git a/test/query/project.json b/test/query/project.json index 7289c8460..7d06b2e66 100644 --- a/test/query/project.json +++ b/test/query/project.json @@ -1152,6 +1152,9 @@ "and_from_empty_w_tag", "not_from_empty_w_tag", "or_from_empty_w_tag", + "and_from_existing_and_new_table", + "not_from_existing_and_new_table", + "or_from_existing_and_new_table", "or_w_wildcard", "or_w_component_and_tag", "or_w_tag_and_component" diff --git a/test/query/src/Operators.c b/test/query/src/Operators.c index 7e7f92998..e061ea087 100644 --- a/test/query/src/Operators.c +++ b/test/query/src/Operators.c @@ -8428,6 +8428,7 @@ void Operators_and_from_fixed_src(void) { test_bool(true, ecs_query_next(&it)); test_int(0, it.count); test_uint(e, ecs_field_src(&it, 0)); + test_uint(Type, ecs_field_id(&it, 0)); test_bool(false, ecs_query_next(&it)); } @@ -8457,6 +8458,7 @@ void Operators_not_from_fixed_src(void) { test_bool(true, ecs_query_next(&it)); test_int(0, it.count); test_uint(e, ecs_field_src(&it, 0)); + test_uint(Type, ecs_field_id(&it, 0)); test_bool(false, ecs_query_next(&it)); } @@ -8524,6 +8526,7 @@ void Operators_or_from_fixed_src(void) { test_bool(true, ecs_query_next(&it)); test_int(0, it.count); test_uint(e, ecs_field_src(&it, 0)); + test_uint(Type, ecs_field_id(&it, 0)); test_bool(false, ecs_query_next(&it)); } @@ -8534,6 +8537,7 @@ void Operators_or_from_fixed_src(void) { test_bool(true, ecs_query_next(&it)); test_int(0, it.count); test_uint(e, ecs_field_src(&it, 0)); + test_uint(Type, ecs_field_id(&it, 0)); test_bool(false, ecs_query_next(&it)); } @@ -8544,6 +8548,7 @@ void Operators_or_from_fixed_src(void) { test_bool(true, ecs_query_next(&it)); test_int(0, it.count); test_uint(e, ecs_field_src(&it, 0)); + test_uint(Type, ecs_field_id(&it, 0)); test_bool(false, ecs_query_next(&it)); } @@ -8599,11 +8604,13 @@ void Operators_and_from_this(void) { test_bool(true, ecs_query_next(&it)); test_int(1, it.count); test_uint(e1, it.entities[0]); + test_uint(Type, ecs_field_id(&it, 0)); test_uint(0, ecs_field_src(&it, 0)); test_bool(true, ecs_query_next(&it)); test_int(1, it.count); test_uint(e2, it.entities[0]); + test_uint(Type, ecs_field_id(&it, 0)); test_uint(0, ecs_field_src(&it, 0)); test_bool(false, ecs_query_next(&it)); } @@ -8649,6 +8656,7 @@ void Operators_not_from_this(void) { e1_found |= it.entities[i] == e1; e2_found |= it.entities[i] == e2; } + test_uint(Type, ecs_field_id(&it, 0)); test_uint(0, ecs_field_src(&it, 0)); } test_assert(e1_found == true); @@ -8667,6 +8675,7 @@ void Operators_not_from_this(void) { e1_found |= it.entities[i] == e1; e2_found |= it.entities[i] == e2; } + test_uint(Type, ecs_field_id(&it, 0)); test_uint(0, ecs_field_src(&it, 0)); } test_assert(e1_found == false); @@ -8686,6 +8695,7 @@ void Operators_not_from_this(void) { e1_found |= it.entities[i] == e1; e2_found |= it.entities[i] == e2; } + test_uint(Type, ecs_field_id(&it, 0)); test_uint(0, ecs_field_src(&it, 0)); } test_assert(e1_found == false); @@ -8704,6 +8714,7 @@ void Operators_not_from_this(void) { e1_found |= it.entities[i] == e1; e2_found |= it.entities[i] == e2; } + test_uint(Type, ecs_field_id(&it, 0)); test_uint(0, ecs_field_src(&it, 0)); } test_assert(e1_found == false); @@ -8722,6 +8733,7 @@ void Operators_not_from_this(void) { e1_found |= it.entities[i] == e1; e2_found |= it.entities[i] == e2; } + test_uint(Type, ecs_field_id(&it, 0)); test_uint(0, ecs_field_src(&it, 0)); } test_assert(e1_found == true); @@ -8765,11 +8777,13 @@ void Operators_or_from_this(void) { test_bool(true, ecs_query_next(&it)); test_int(1, it.count); test_uint(e1, it.entities[0]); + test_uint(Type, ecs_field_id(&it, 0)); test_uint(0, ecs_field_src(&it, 0)); test_bool(true, ecs_query_next(&it)); test_int(1, it.count); test_uint(e2, it.entities[0]); + test_uint(Type, ecs_field_id(&it, 0)); test_uint(0, ecs_field_src(&it, 0)); test_bool(false, ecs_query_next(&it)); } @@ -8787,6 +8801,7 @@ void Operators_or_from_this(void) { test_bool(true, ecs_query_next(&it)); test_int(1, it.count); test_uint(e2, it.entities[0]); + test_uint(Type, ecs_field_id(&it, 0)); test_uint(0, ecs_field_src(&it, 0)); test_bool(false, ecs_query_next(&it)); } @@ -8798,11 +8813,13 @@ void Operators_or_from_this(void) { test_bool(true, ecs_query_next(&it)); test_int(1, it.count); test_uint(e1, it.entities[0]); + test_uint(Type, ecs_field_id(&it, 0)); test_uint(0, ecs_field_src(&it, 0)); test_bool(true, ecs_query_next(&it)); test_int(1, it.count); test_uint(e2, it.entities[0]); + test_uint(Type, ecs_field_id(&it, 0)); test_uint(0, ecs_field_src(&it, 0)); test_bool(false, ecs_query_next(&it)); } @@ -8814,11 +8831,13 @@ void Operators_or_from_this(void) { test_bool(true, ecs_query_next(&it)); test_int(1, it.count); test_uint(e2, it.entities[0]); + test_uint(Type, ecs_field_id(&it, 0)); test_uint(0, ecs_field_src(&it, 0)); test_bool(true, ecs_query_next(&it)); test_int(1, it.count); test_uint(e1, it.entities[0]); + test_uint(Type, ecs_field_id(&it, 0)); test_uint(0, ecs_field_src(&it, 0)); test_bool(false, ecs_query_next(&it)); @@ -8880,12 +8899,16 @@ void Operators_and_from_this_written(void) { test_bool(true, ecs_query_next(&it)); test_int(1, it.count); test_uint(e1, it.entities[0]); + test_uint(TagD, ecs_field_id(&it, 0)); + test_uint(Type, ecs_field_id(&it, 1)); test_uint(0, ecs_field_src(&it, 0)); test_uint(0, ecs_field_src(&it, 1)); test_bool(true, ecs_query_next(&it)); test_int(1, it.count); test_uint(e2, it.entities[0]); + test_uint(TagD, ecs_field_id(&it, 0)); + test_uint(Type, ecs_field_id(&it, 1)); test_uint(0, ecs_field_src(&it, 0)); test_uint(0, ecs_field_src(&it, 1)); test_bool(false, ecs_query_next(&it)); @@ -8935,6 +8958,9 @@ void Operators_not_from_this_written(void) { e1_found |= it.entities[i] == e1; e2_found |= it.entities[i] == e2; } + + test_uint(TagD, ecs_field_id(&it, 0)); + test_uint(Type, ecs_field_id(&it, 1)); test_uint(0, ecs_field_src(&it, 0)); test_uint(0, ecs_field_src(&it, 0)); test_bool(true, ecs_field_is_set(&it, 0)); @@ -8956,6 +8982,9 @@ void Operators_not_from_this_written(void) { e1_found |= it.entities[i] == e1; e2_found |= it.entities[i] == e2; } + + test_uint(TagD, ecs_field_id(&it, 0)); + test_uint(Type, ecs_field_id(&it, 1)); test_uint(0, ecs_field_src(&it, 0)); test_uint(0, ecs_field_src(&it, 0)); test_bool(true, ecs_field_is_set(&it, 0)); @@ -8978,6 +9007,9 @@ void Operators_not_from_this_written(void) { e1_found |= it.entities[i] == e1; e2_found |= it.entities[i] == e2; } + + test_uint(TagD, ecs_field_id(&it, 0)); + test_uint(Type, ecs_field_id(&it, 1)); test_uint(0, ecs_field_src(&it, 0)); test_uint(0, ecs_field_src(&it, 0)); test_bool(true, ecs_field_is_set(&it, 0)); @@ -8999,6 +9031,9 @@ void Operators_not_from_this_written(void) { e1_found |= it.entities[i] == e1; e2_found |= it.entities[i] == e2; } + + test_uint(TagD, ecs_field_id(&it, 0)); + test_uint(Type, ecs_field_id(&it, 1)); test_uint(0, ecs_field_src(&it, 0)); test_uint(0, ecs_field_src(&it, 0)); test_bool(true, ecs_field_is_set(&it, 0)); @@ -9020,6 +9055,9 @@ void Operators_not_from_this_written(void) { e1_found |= it.entities[i] == e1; e2_found |= it.entities[i] == e2; } + + test_uint(TagD, ecs_field_id(&it, 0)); + test_uint(Type, ecs_field_id(&it, 1)); test_uint(0, ecs_field_src(&it, 0)); test_uint(0, ecs_field_src(&it, 0)); test_bool(true, ecs_field_is_set(&it, 0)); @@ -9069,12 +9107,16 @@ void Operators_or_from_this_written(void) { test_bool(true, ecs_query_next(&it)); test_int(1, it.count); test_uint(e1, it.entities[0]); + test_uint(TagD, ecs_field_id(&it, 0)); + test_uint(Type, ecs_field_id(&it, 1)); test_uint(0, ecs_field_src(&it, 0)); test_uint(0, ecs_field_src(&it, 1)); test_bool(true, ecs_query_next(&it)); test_int(1, it.count); test_uint(e2, it.entities[0]); + test_uint(TagD, ecs_field_id(&it, 0)); + test_uint(Type, ecs_field_id(&it, 1)); test_uint(0, ecs_field_src(&it, 0)); test_uint(0, ecs_field_src(&it, 1)); test_bool(false, ecs_query_next(&it)); @@ -9088,12 +9130,16 @@ void Operators_or_from_this_written(void) { test_bool(true, ecs_query_next(&it)); test_int(1, it.count); test_uint(e1, it.entities[0]); + test_uint(TagD, ecs_field_id(&it, 0)); + test_uint(Type, ecs_field_id(&it, 1)); test_uint(0, ecs_field_src(&it, 0)); test_uint(0, ecs_field_src(&it, 1)); test_bool(true, ecs_query_next(&it)); test_int(1, it.count); test_uint(e2, it.entities[0]); + test_uint(TagD, ecs_field_id(&it, 0)); + test_uint(Type, ecs_field_id(&it, 1)); test_uint(0, ecs_field_src(&it, 0)); test_uint(0, ecs_field_src(&it, 1)); test_bool(false, ecs_query_next(&it)); @@ -9106,12 +9152,16 @@ void Operators_or_from_this_written(void) { test_bool(true, ecs_query_next(&it)); test_int(1, it.count); test_uint(e1, it.entities[0]); + test_uint(TagD, ecs_field_id(&it, 0)); + test_uint(Type, ecs_field_id(&it, 1)); test_uint(0, ecs_field_src(&it, 0)); test_uint(0, ecs_field_src(&it, 1)); test_bool(true, ecs_query_next(&it)); test_int(1, it.count); test_uint(e2, it.entities[0]); + test_uint(TagD, ecs_field_id(&it, 0)); + test_uint(Type, ecs_field_id(&it, 1)); test_uint(0, ecs_field_src(&it, 0)); test_uint(0, ecs_field_src(&it, 1)); test_bool(false, ecs_query_next(&it)); @@ -9124,12 +9174,16 @@ void Operators_or_from_this_written(void) { test_bool(true, ecs_query_next(&it)); test_int(1, it.count); test_uint(e2, it.entities[0]); + test_uint(TagD, ecs_field_id(&it, 0)); + test_uint(Type, ecs_field_id(&it, 1)); test_uint(0, ecs_field_src(&it, 0)); test_uint(0, ecs_field_src(&it, 1)); test_bool(true, ecs_query_next(&it)); test_int(1, it.count); test_uint(e1, it.entities[0]); + test_uint(TagD, ecs_field_id(&it, 0)); + test_uint(Type, ecs_field_id(&it, 1)); test_uint(0, ecs_field_src(&it, 0)); test_uint(0, ecs_field_src(&it, 1)); @@ -9214,7 +9268,7 @@ void Operators_and_from_empty_w_tag(void) { ECS_TAG(world, TagA); - ecs_entity(world, { .name = "Type" }); + ecs_entity_t Type = ecs_entity(world, { .name = "Type" }); ecs_entity_t e = ecs_new_w(world, TagA); @@ -9229,6 +9283,8 @@ void Operators_and_from_empty_w_tag(void) { test_bool(true, ecs_query_next(&it)); test_int(1, it.count); test_uint(e, it.entities[0]); + test_uint(Type, ecs_field_id(&it, 0)); + test_uint(TagA, ecs_field_id(&it, 1)); test_uint(0, ecs_field_src(&it, 0)); test_uint(0, ecs_field_src(&it, 1)); test_uint(TagA, ecs_field_id(&it, 1)); @@ -9244,7 +9300,7 @@ void Operators_not_from_empty_w_tag(void) { ECS_TAG(world, TagA); - ecs_entity(world, { .name = "Type" }); + ecs_entity_t Type = ecs_entity(world, { .name = "Type" }); ecs_entity_t e = ecs_new_w(world, TagA); @@ -9259,6 +9315,8 @@ void Operators_not_from_empty_w_tag(void) { test_bool(true, ecs_query_next(&it)); test_int(1, it.count); test_uint(e, it.entities[0]); + test_uint(Type, ecs_field_id(&it, 0)); + test_uint(TagA, ecs_field_id(&it, 1)); test_uint(0, ecs_field_src(&it, 0)); test_uint(0, ecs_field_src(&it, 1)); test_uint(TagA, ecs_field_id(&it, 1)); @@ -9269,12 +9327,144 @@ void Operators_not_from_empty_w_tag(void) { ecs_fini(world); } +void Operators_and_from_existing_and_new_table(void) { + ecs_world_t *world = ecs_mini(); + + ECS_COMPONENT(world, Position); + ECS_COMPONENT(world, Velocity); + ECS_TAG(world, Foo); + + ecs_entity_t e1 = ecs_new_w(world, Position); + ecs_add(world, e1, Velocity); + + ECS_PREFAB(world, Type, Position, Velocity); + + ecs_query_t *q = ecs_query(world, { + .terms = {{ .id = Type, .oper = EcsAndFrom }}, + .cache_kind = cache_kind + }); + + test_assert(q != NULL); + + ecs_entity_t e2 = ecs_new_w(world, Velocity); + ecs_add(world, e2, Position); + ecs_add(world, e2, Foo); + + ecs_iter_t it = ecs_query_iter(world, q); + test_bool(true, ecs_query_next(&it)); + test_int(1, it.count); + test_uint(e1, it.entities[0]); + test_uint(Type, ecs_field_id(&it, 0)); + test_bool(true, ecs_field_is_set(&it, 0)); + + test_bool(true, ecs_query_next(&it)); + test_int(1, it.count); + test_uint(e2, it.entities[0]); + test_uint(Type, ecs_field_id(&it, 0)); + test_bool(true, ecs_field_is_set(&it, 0)); + + test_bool(false, ecs_query_next(&it)); + + ecs_fini(world); +} + +void Operators_not_from_existing_and_new_table(void) { + ecs_world_t *world = ecs_mini(); + + ECS_COMPONENT(world, Position); + ECS_COMPONENT(world, Velocity); + ECS_TAG(world, Foo); + ECS_TAG(world, Bar); + + ecs_entity_t e1 = ecs_new_w(world, Foo); + ecs_add(world, e1, Position); + + ecs_entity_t e2 = ecs_new_w(world, Foo); + + ECS_PREFAB(world, Type, Position, Velocity); + + ecs_query_t *q = ecs_query(world, { + .terms = { + { .id = Foo }, + { .id = Type, .oper = EcsNotFrom } + }, + .cache_kind = cache_kind + }); + + test_assert(q != NULL); + + ecs_entity_t e3 = ecs_new_w(world, Foo); + ecs_add(world, e3, Position); + + ecs_entity_t e4 = ecs_new_w(world, Foo); + ecs_add(world, e4, Bar); + + ecs_iter_t it = ecs_query_iter(world, q); + test_bool(true, ecs_query_next(&it)); + test_int(1, it.count); + test_uint(e2, it.entities[0]); + test_uint(Foo, ecs_field_id(&it, 0)); + test_uint(Type, ecs_field_id(&it, 1)); + test_bool(true, ecs_field_is_set(&it, 0)); + test_bool(false, ecs_field_is_set(&it, 1)); + + test_bool(true, ecs_query_next(&it)); + test_int(1, it.count); + test_uint(e4, it.entities[0]); + test_uint(Foo, ecs_field_id(&it, 0)); + test_uint(Type, ecs_field_id(&it, 1)); + test_bool(true, ecs_field_is_set(&it, 0)); + test_bool(false, ecs_field_is_set(&it, 1)); + + test_bool(false, ecs_query_next(&it)); + + ecs_fini(world); +} + +void Operators_or_from_existing_and_new_table(void) { + ecs_world_t *world = ecs_mini(); + + ECS_COMPONENT(world, Position); + ECS_COMPONENT(world, Velocity); + + ecs_entity_t e1 = ecs_new_w(world, Position); + + ECS_PREFAB(world, Type, Position, Velocity); + + ecs_query_t *q = ecs_query(world, { + .terms = {{ .id = Type, .oper = EcsOrFrom }}, + .cache_kind = cache_kind + }); + + test_assert(q != NULL); + + ecs_entity_t e2 = ecs_new_w(world, Velocity); + ecs_add(world, e2, Position); + + ecs_iter_t it = ecs_query_iter(world, q); + test_bool(true, ecs_query_next(&it)); + test_int(1, it.count); + test_uint(e1, it.entities[0]); + test_uint(Type, ecs_field_id(&it, 0)); + test_bool(true, ecs_field_is_set(&it, 0)); + + test_bool(true, ecs_query_next(&it)); + test_int(1, it.count); + test_uint(e2, it.entities[0]); + test_uint(Type, ecs_field_id(&it, 0)); + test_bool(true, ecs_field_is_set(&it, 0)); + + test_bool(false, ecs_query_next(&it)); + + ecs_fini(world); +} + void Operators_or_from_empty_w_tag(void) { ecs_world_t *world = ecs_mini(); ECS_TAG(world, TagA); - ecs_entity(world, { .name = "Type" }); + ecs_entity_t Type = ecs_entity(world, { .name = "Type" }); ecs_entity_t e = ecs_new_w(world, TagA); @@ -9289,6 +9479,8 @@ void Operators_or_from_empty_w_tag(void) { test_bool(true, ecs_query_next(&it)); test_int(1, it.count); test_uint(e, it.entities[0]); + test_uint(Type, ecs_field_id(&it, 0)); + test_uint(TagA, ecs_field_id(&it, 1)); test_uint(0, ecs_field_src(&it, 0)); test_uint(0, ecs_field_src(&it, 1)); test_uint(TagA, ecs_field_id(&it, 1)); @@ -9313,7 +9505,8 @@ void Operators_or_w_wildcard(void) { { TagA, .oper = EcsOr }, { TagB }, { ecs_pair(Rel, EcsWildcard) } - } + }, + .cache_kind = cache_kind }); test_assert(q != NULL); @@ -9353,7 +9546,8 @@ void Operators_or_w_component_and_tag(void) { .terms = { { ecs_id(Position), .oper = EcsOr }, { TagA } - } + }, + .cache_kind = cache_kind }); test_assert(q != NULL); @@ -9384,7 +9578,8 @@ void Operators_or_w_tag_and_component(void) { .terms = { { TagA, .oper = EcsOr }, { ecs_id(Position) } - } + }, + .cache_kind = cache_kind }); test_assert(q != NULL); diff --git a/test/query/src/main.c b/test/query/src/main.c index 810942b5c..d4b2b4248 100644 --- a/test/query/src/main.c +++ b/test/query/src/main.c @@ -1122,6 +1122,9 @@ void Operators_or_from_empty(void); void Operators_and_from_empty_w_tag(void); void Operators_not_from_empty_w_tag(void); void Operators_or_from_empty_w_tag(void); +void Operators_and_from_existing_and_new_table(void); +void Operators_not_from_existing_and_new_table(void); +void Operators_or_from_existing_and_new_table(void); void Operators_or_w_wildcard(void); void Operators_or_w_component_and_tag(void); void Operators_or_w_tag_and_component(void); @@ -6530,6 +6533,18 @@ bake_test_case Operators_testcases[] = { "or_from_empty_w_tag", Operators_or_from_empty_w_tag }, + { + "and_from_existing_and_new_table", + Operators_and_from_existing_and_new_table + }, + { + "not_from_existing_and_new_table", + Operators_not_from_existing_and_new_table + }, + { + "or_from_existing_and_new_table", + Operators_or_from_existing_and_new_table + }, { "or_w_wildcard", Operators_or_w_wildcard @@ -10521,7 +10536,7 @@ static bake_test_suite suites[] = { "Operators", Operators_setup, NULL, - 149, + 152, Operators_testcases, 1, Operators_params