File indexing completed on 2025-01-18 09:42:42
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_MYSQL_IMPL_EXECUTION_STATE_IMPL_IPP
0009 #define BOOST_MYSQL_IMPL_EXECUTION_STATE_IMPL_IPP
0010
0011 #pragma once
0012
0013 #include <boost/mysql/detail/execution_processor/execution_state_impl.hpp>
0014 #include <boost/mysql/detail/row_impl.hpp>
0015
0016 #include <boost/mysql/impl/internal/protocol/protocol.hpp>
0017
0018 void boost::mysql::detail::execution_state_impl::on_ok_packet_impl(const ok_view& pack)
0019 {
0020 eof_data_.has_value = true;
0021 eof_data_.affected_rows = pack.affected_rows;
0022 eof_data_.last_insert_id = pack.last_insert_id;
0023 eof_data_.warnings = pack.warnings;
0024 eof_data_.is_out_params = pack.is_out_params();
0025 info_.assign(pack.info.begin(), pack.info.end());
0026 }
0027
0028 void boost::mysql::detail::execution_state_impl::reset_impl() noexcept
0029 {
0030 meta_.clear();
0031 eof_data_ = ok_data();
0032 info_.clear();
0033 }
0034
0035 boost::mysql::error_code boost::mysql::detail::execution_state_impl::
0036 on_head_ok_packet_impl(const ok_view& pack, diagnostics&)
0037 {
0038 on_new_resultset();
0039 on_ok_packet_impl(pack);
0040 return error_code();
0041 }
0042
0043 void boost::mysql::detail::execution_state_impl::on_num_meta_impl(std::size_t num_columns)
0044 {
0045 on_new_resultset();
0046 meta_.reserve(num_columns);
0047 }
0048
0049 boost::mysql::error_code boost::mysql::detail::execution_state_impl::
0050 on_meta_impl(const coldef_view& coldef, bool, diagnostics&)
0051 {
0052 meta_.push_back(create_meta(coldef));
0053 return error_code();
0054 }
0055
0056 boost::mysql::error_code boost::mysql::detail::execution_state_impl::on_row_impl(
0057 span<const std::uint8_t> msg,
0058 const output_ref&,
0059 std::vector<field_view>& fields
0060 )
0061
0062 {
0063
0064 span<field_view> storage = add_fields(fields, meta_.size());
0065
0066
0067 return deserialize_row(encoding(), msg, meta_, storage);
0068 }
0069
0070 boost::mysql::error_code boost::mysql::detail::execution_state_impl::on_row_ok_packet_impl(const ok_view& pack
0071 )
0072 {
0073 on_ok_packet_impl(pack);
0074 return error_code();
0075 }
0076
0077 #endif