diff --git a/include/boost/mysql/detail/network_algorithms/close_connection.hpp b/include/boost/mysql/detail/network_algorithms/close_connection.hpp index 86b4dd28..e439e4e7 100644 --- a/include/boost/mysql/detail/network_algorithms/close_connection.hpp +++ b/include/boost/mysql/detail/network_algorithms/close_connection.hpp @@ -8,7 +8,9 @@ #ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_CLOSE_CONNECTION_HPP #define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_CLOSE_CONNECTION_HPP -#include +#include +#include + namespace boost { namespace mysql { diff --git a/include/boost/mysql/detail/network_algorithms/close_statement.hpp b/include/boost/mysql/detail/network_algorithms/close_statement.hpp index 4c244b0d..eebe6ce4 100644 --- a/include/boost/mysql/detail/network_algorithms/close_statement.hpp +++ b/include/boost/mysql/detail/network_algorithms/close_statement.hpp @@ -8,7 +8,9 @@ #ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_CLOSE_STATEMENT_HPP #define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_CLOSE_STATEMENT_HPP -#include +#include +#include + namespace boost { namespace mysql { diff --git a/include/boost/mysql/detail/network_algorithms/common.hpp b/include/boost/mysql/detail/network_algorithms/common.hpp deleted file mode 100644 index 9a6fcef2..00000000 --- a/include/boost/mysql/detail/network_algorithms/common.hpp +++ /dev/null @@ -1,31 +0,0 @@ -// -// Copyright (c) 2019-2022 Ruben Perez Hidalgo (rubenperez038 at gmail dot com) -// -// Distributed under the Boost Software License, Version 1.0. (See accompanying -// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// - -#ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_COMMON_HPP -#define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_COMMON_HPP - -#include -#include -#include -#include - -namespace boost { -namespace mysql { -namespace detail { - -using deserialize_row_fn = error_code (*)( - deserialization_context&, - const std::vector&, - std::vector& -); - -} // detail -} // mysql -} // boost - - -#endif /* INCLUDE_BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_COMMON_HPP_ */ diff --git a/include/boost/mysql/detail/network_algorithms/connect.hpp b/include/boost/mysql/detail/network_algorithms/connect.hpp index 222b3197..a472c00d 100644 --- a/include/boost/mysql/detail/network_algorithms/connect.hpp +++ b/include/boost/mysql/detail/network_algorithms/connect.hpp @@ -8,8 +8,9 @@ #ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_CONNECT_HPP #define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_CONNECT_HPP -#include #include +#include +#include namespace boost { namespace mysql { diff --git a/include/boost/mysql/detail/network_algorithms/execute_generic.hpp b/include/boost/mysql/detail/network_algorithms/execute_generic.hpp index a68824d6..1ce2f53f 100644 --- a/include/boost/mysql/detail/network_algorithms/execute_generic.hpp +++ b/include/boost/mysql/detail/network_algorithms/execute_generic.hpp @@ -8,9 +8,11 @@ #ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_EXECUTE_GENERIC_HPP #define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_EXECUTE_GENERIC_HPP -#include +#include #include -#include +#include +#include + namespace boost { namespace mysql { @@ -18,7 +20,7 @@ namespace detail { template void execute_generic( - deserialize_row_fn deserializer, + resultset_encoding encoding, channel& channel, const Serializable& request, resultset& output, @@ -29,7 +31,7 @@ void execute_generic( template BOOST_ASIO_INITFN_AUTO_RESULT_TYPE(CompletionToken, void(error_code)) async_execute_generic( - deserialize_row_fn deserializer, + resultset_encoding encoding, channel& chan, const Serializable& request, resultset& output, diff --git a/include/boost/mysql/detail/network_algorithms/execute_query.hpp b/include/boost/mysql/detail/network_algorithms/execute_query.hpp index befd6b4e..de0260a2 100644 --- a/include/boost/mysql/detail/network_algorithms/execute_query.hpp +++ b/include/boost/mysql/detail/network_algorithms/execute_query.hpp @@ -8,10 +8,12 @@ #ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_EXECUTE_QUERY_HPP #define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_EXECUTE_QUERY_HPP -#include +#include #include +#include #include + namespace boost { namespace mysql { namespace detail { diff --git a/include/boost/mysql/detail/network_algorithms/execute_statement.hpp b/include/boost/mysql/detail/network_algorithms/execute_statement.hpp index 2bf41631..5d881372 100644 --- a/include/boost/mysql/detail/network_algorithms/execute_statement.hpp +++ b/include/boost/mysql/detail/network_algorithms/execute_statement.hpp @@ -8,11 +8,10 @@ #ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_EXECUTE_STATEMENT_HPP #define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_EXECUTE_STATEMENT_HPP -#include +#include #include -#include -#include #include +#include namespace boost { namespace mysql { diff --git a/include/boost/mysql/detail/network_algorithms/handshake.hpp b/include/boost/mysql/detail/network_algorithms/handshake.hpp index ceea2123..fcc80313 100644 --- a/include/boost/mysql/detail/network_algorithms/handshake.hpp +++ b/include/boost/mysql/detail/network_algorithms/handshake.hpp @@ -8,12 +8,10 @@ #ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_HANDSHAKE_HPP #define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_HANDSHAKE_HPP -#include -#include +#include #include -#include #include -#include + namespace boost { namespace mysql { diff --git a/include/boost/mysql/detail/network_algorithms/impl/execute_generic.hpp b/include/boost/mysql/detail/network_algorithms/impl/execute_generic.hpp index 6ce971d1..5647aa77 100644 --- a/include/boost/mysql/detail/network_algorithms/impl/execute_generic.hpp +++ b/include/boost/mysql/detail/network_algorithms/impl/execute_generic.hpp @@ -10,11 +10,11 @@ #pragma once -#include #include #include #include #include +#include #include #include #include @@ -51,10 +51,10 @@ public: template void process_request( const Serializable& request, - deserialize_row_fn deserialize_fn + resultset_encoding encoding ) { - output_.reset(deserialize_fn); + output_.reset(encoding); serialize_message(request, caps_, write_buffer_); } @@ -221,7 +221,7 @@ struct execute_generic_op : boost::asio::coroutine template void boost::mysql::detail::execute_generic( - deserialize_row_fn deserializer, + resultset_encoding encoding, channel& channel, const Serializable& request, resultset& output, @@ -236,7 +236,7 @@ void boost::mysql::detail::execute_generic( channel.shared_buffer(), channel.current_capabilities() ); - processor.process_request(request, deserializer); + processor.process_request(request, encoding); // Send it channel.write(channel.shared_buffer(), processor.sequence_number(), err); @@ -282,7 +282,7 @@ BOOST_ASIO_INITFN_AUTO_RESULT_TYPE( void(boost::mysql::error_code) ) boost::mysql::detail::async_execute_generic( - deserialize_row_fn deserializer, + resultset_encoding encoding, channel& channel, const Serializable& request, resultset& output, @@ -296,7 +296,7 @@ boost::mysql::detail::async_execute_generic( channel.shared_buffer(), channel.current_capabilities() ); - processor.process_request(request, deserializer); + processor.process_request(request, encoding); return boost::asio::async_compose( execute_generic_op(channel, processor), token, diff --git a/include/boost/mysql/detail/network_algorithms/impl/execute_query.hpp b/include/boost/mysql/detail/network_algorithms/impl/execute_query.hpp index e65a259b..b87eef29 100644 --- a/include/boost/mysql/detail/network_algorithms/impl/execute_query.hpp +++ b/include/boost/mysql/detail/network_algorithms/impl/execute_query.hpp @@ -11,8 +11,8 @@ #pragma once #include -#include #include +#include #include template @@ -26,7 +26,7 @@ void boost::mysql::detail::execute_query( { com_query_packet request { string_eof(query) }; execute_generic( - &deserialize_text_row, + resultset_encoding::text, channel, request, output, @@ -51,7 +51,7 @@ boost::mysql::detail::async_execute_query( { com_query_packet request { string_eof(query) }; return async_execute_generic( - &deserialize_text_row, + resultset_encoding::text, chan, request, output, diff --git a/include/boost/mysql/detail/network_algorithms/impl/execute_statement.hpp b/include/boost/mysql/detail/network_algorithms/impl/execute_statement.hpp index e5cc3177..c0f506b3 100644 --- a/include/boost/mysql/detail/network_algorithms/impl/execute_statement.hpp +++ b/include/boost/mysql/detail/network_algorithms/impl/execute_statement.hpp @@ -13,8 +13,8 @@ #include #include #include -#include #include +#include #include namespace boost { @@ -51,7 +51,7 @@ void boost::mysql::detail::execute_statement( ) { execute_generic( - &deserialize_binary_row, + resultset_encoding::binary, chan, make_stmt_execute_packet(params), output, @@ -74,7 +74,7 @@ boost::mysql::detail::async_execute_statement( ) { return async_execute_generic( - &deserialize_binary_row, + resultset_encoding::binary, chan, make_stmt_execute_packet(params), output, diff --git a/include/boost/mysql/detail/network_algorithms/prepare_statement.hpp b/include/boost/mysql/detail/network_algorithms/prepare_statement.hpp index 9ab86e6b..735ed343 100644 --- a/include/boost/mysql/detail/network_algorithms/prepare_statement.hpp +++ b/include/boost/mysql/detail/network_algorithms/prepare_statement.hpp @@ -8,8 +8,11 @@ #ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_PREPARE_STATEMENT_HPP #define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_PREPARE_STATEMENT_HPP -#include +#include #include +#include +#include + namespace boost { namespace mysql { diff --git a/include/boost/mysql/detail/network_algorithms/quit_connection.hpp b/include/boost/mysql/detail/network_algorithms/quit_connection.hpp index 31d1f393..996e8717 100644 --- a/include/boost/mysql/detail/network_algorithms/quit_connection.hpp +++ b/include/boost/mysql/detail/network_algorithms/quit_connection.hpp @@ -8,7 +8,9 @@ #ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_QUIT_CONNECTION_HPP #define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_QUIT_CONNECTION_HPP -#include +#include +#include + namespace boost { namespace mysql { diff --git a/include/boost/mysql/detail/network_algorithms/read_all_rows.hpp b/include/boost/mysql/detail/network_algorithms/read_all_rows.hpp index 3e8165ac..c8070855 100644 --- a/include/boost/mysql/detail/network_algorithms/read_all_rows.hpp +++ b/include/boost/mysql/detail/network_algorithms/read_all_rows.hpp @@ -8,11 +8,11 @@ #ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_READ_ALL_ROWS_HPP #define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_READ_ALL_ROWS_HPP -#include +#include +#include #include #include -#include -#include + namespace boost { namespace mysql { diff --git a/include/boost/mysql/detail/network_algorithms/read_one_row.hpp b/include/boost/mysql/detail/network_algorithms/read_one_row.hpp index 3ebf1f15..25cc123d 100644 --- a/include/boost/mysql/detail/network_algorithms/read_one_row.hpp +++ b/include/boost/mysql/detail/network_algorithms/read_one_row.hpp @@ -8,11 +8,11 @@ #ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_READ_ONE_ROW_HPP #define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_READ_ONE_ROW_HPP -#include +#include +#include #include #include -#include -#include + namespace boost { namespace mysql { diff --git a/include/boost/mysql/detail/network_algorithms/read_some_rows.hpp b/include/boost/mysql/detail/network_algorithms/read_some_rows.hpp index 5a088c9f..3f4b65d4 100644 --- a/include/boost/mysql/detail/network_algorithms/read_some_rows.hpp +++ b/include/boost/mysql/detail/network_algorithms/read_some_rows.hpp @@ -8,10 +8,11 @@ #ifndef BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_READ_SOME_ROWS_HPP #define BOOST_MYSQL_DETAIL_NETWORK_ALGORITHMS_READ_SOME_ROWS_HPP -#include +#include +#include #include #include -#include + namespace boost { namespace mysql { diff --git a/test/unit/detail/protocol/row_deserialization.cpp b/test/unit/detail/protocol/row_deserialization.cpp index e360039f..5acffd60 100644 --- a/test/unit/detail/protocol/row_deserialization.cpp +++ b/test/unit/detail/protocol/row_deserialization.cpp @@ -9,7 +9,6 @@ #include #include -#include // for deserialize_row_fn #include "test_common.hpp" #include #include