1#include "duckdb/verification/deserialized_statement_verifier_v2.hpp"
2#include "duckdb/common/serializer/buffered_deserializer.hpp"
3#include "duckdb/common/serializer/binary_serializer.hpp"
4#include "duckdb/common/serializer/binary_deserializer.hpp"
5namespace duckdb {
6
7DeserializedStatementVerifierV2::DeserializedStatementVerifierV2(unique_ptr<SQLStatement> statement_p)
8 : StatementVerifier(VerificationType::DESERIALIZED_V2, "Deserialized V2", std::move(statement_p)) {
9}
10
11unique_ptr<StatementVerifier> DeserializedStatementVerifierV2::Create(const SQLStatement &statement) {
12 auto &select_stmt = statement.Cast<SelectStatement>();
13
14 auto blob = BinarySerializer::Serialize(obj: select_stmt);
15 auto result = BinaryDeserializer::Deserialize<SelectStatement>(ptr: blob.data(), length: blob.size());
16
17 return make_uniq<DeserializedStatementVerifierV2>(args: std::move(result));
18}
19
20} // namespace duckdb
21