File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -35,10 +35,12 @@ google::bigtable::v2::ExecuteQueryRequest BoundQuery::ToRequestProto() const {
3535
3636 google::protobuf::Map<std::string, google::bigtable::v2::Value> parameters;
3737 for (auto const & kv : parameters_) {
38- parameters[kv.first ] =
39- bigtable_internal::ValueInternals::ToProto (kv.second ).second ;
38+ auto type_value = bigtable_internal::ValueInternals::ToProto (kv.second );
39+ google::bigtable::v2::Value v = std::move (type_value.second );
40+ *v.mutable_type () = std::move (type_value.first );
41+ parameters[kv.first ] = std::move (v);
4042 }
41- *result.mutable_params () = parameters;
43+ *result.mutable_params () = std::move ( parameters) ;
4244 return result;
4345}
4446
Original file line number Diff line number Diff line change @@ -97,12 +97,14 @@ TEST(BoundQuery, ToRequestProto) {
9797 auto val1 = proto.params ().find (" val1" )->second ;
9898 EXPECT_TRUE (val1.has_bool_value ());
9999 EXPECT_EQ (true , val1.bool_value ());
100+ EXPECT_TRUE (val1.type ().has_bool_type ());
100101
101102 // The second parameter is a double.
102103 EXPECT_TRUE (proto.params ().contains (" val2" ));
103104 auto val2 = proto.params ().find (" val2" )->second ;
104105 EXPECT_TRUE (val2.has_float_value ());
105106 EXPECT_EQ (2.0 , val2.float_value ());
107+ EXPECT_TRUE (val2.type ().has_float64_type ());
106108
107109 // Cancel all pending operations, satisfying any remaining futures.
108110 fake_cq_impl->SimulateCompletion (false );
You can’t perform that action at this time.
0 commit comments