diff --git a/cql3/expr/expression.cc b/cql3/expr/expression.cc index 7c7d5260d1..ab5e1bd1c4 100644 --- a/cql3/expr/expression.cc +++ b/cql3/expr/expression.cc @@ -1031,7 +1031,7 @@ expression search_and_replace(const expression& e, return cast{c.style, recurse(c.arg), c.type}; }, [&] (const field_selection& fs) -> expression { - return field_selection{recurse(fs.structure), fs.field}; + return field_selection{recurse(fs.structure), fs.field, fs.field_idx, fs.type}; }, [&] (const subscript& s) -> expression { return subscript { diff --git a/cql3/expr/prepare_expr.cc b/cql3/expr/prepare_expr.cc index 8b057bef01..b34f6f6f4b 100644 --- a/cql3/expr/prepare_expr.cc +++ b/cql3/expr/prepare_expr.cc @@ -1688,6 +1688,12 @@ static lw_shared_ptr get_lhs_receiver(const expression& pr return list_value_spec_of(*sub_col.col->column_specification); } }, + [&](const field_selection& fs) -> lw_shared_ptr { + return make_lw_shared( + schema.ks_name(), schema.cf_name(), + ::make_shared(fs.field->text(), true), + fs.type); + }, [&](const tuple_constructor& tup) -> lw_shared_ptr { std::ostringstream tuple_name; tuple_name << "("; diff --git a/test/cqlpy/cassandra_tests/validation/operations/insert_update_if_condition_collections_test.py b/test/cqlpy/cassandra_tests/validation/operations/insert_update_if_condition_collections_test.py index af3aa8baa4..f6ed5dc3fa 100644 --- a/test/cqlpy/cassandra_tests/validation/operations/insert_update_if_condition_collections_test.py +++ b/test/cqlpy/cassandra_tests/validation/operations/insert_update_if_condition_collections_test.py @@ -266,7 +266,7 @@ def checkInvalidUDT(cql, table, condition, value, expected): assertInvalidThrow(cql, table, expected, "DELETE FROM %s WHERE k = 0 IF " + condition) assertRows(execute(cql, table, "SELECT * FROM %s"), row(0, value)) -@pytest.mark.xfail(reason="Issue #13624") +# Reproduces #13624 def testUDTField(cql, test_keyspace): with create_type(cql, test_keyspace, "(a int, b text)") as typename: for frozen in [False, True]: