1 | #include "duckdb/verification/deserialized_statement_verifier.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" |
5 | namespace duckdb { |
6 | |
7 | DeserializedStatementVerifier::DeserializedStatementVerifier(unique_ptr<SQLStatement> statement_p) |
8 | : StatementVerifier(VerificationType::DESERIALIZED, "Deserialized", std::move(statement_p)) { |
9 | } |
10 | |
11 | unique_ptr<StatementVerifier> DeserializedStatementVerifier::Create(const SQLStatement &statement) { |
12 | auto &select_stmt = statement.Cast<SelectStatement>(); |
13 | BufferedSerializer serializer; |
14 | select_stmt.Serialize(serializer); |
15 | BufferedDeserializer source(serializer); |
16 | return make_uniq<DeserializedStatementVerifier>(args: SelectStatement::Deserialize(source)); |
17 | } |
18 | |
19 | } // namespace duckdb |
20 |