2
0
mirror of https://github.com/boostorg/mysql.git synced 2026-02-18 02:02:17 +00:00

Added stmt_prepare msg and serialization

This commit is contained in:
ruben
2020-01-26 12:49:52 +00:00
parent 328a923f3a
commit 4ef40c2bf1
3 changed files with 82 additions and 16 deletions

View File

@@ -493,5 +493,30 @@ INSTANTIATE_TEST_SUITE_P(ComQuery, SerializeTest, testing::Values(
})
));
INSTANTIATE_TEST_SUITE_P(ComStmtPrepare, SerializeTest, testing::Values(
SerializeParams(com_stmt_prepare_packet{
string_eof("SELECT * from three_rows_table WHERE id = ?")
}, {
0x16, 0x53, 0x45, 0x4c, 0x45, 0x43, 0x54, 0x20,
0x2a, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74,
0x68, 0x72, 0x65, 0x65, 0x5f, 0x72, 0x6f, 0x77,
0x73, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x20,
0x57, 0x48, 0x45, 0x52, 0x45, 0x20, 0x69, 0x64,
0x20, 0x3d, 0x20, 0x3f
})
));
INSTANTIATE_TEST_SUITE_P(ComStmtPrepareResponse, DeserializeSpaceTest, testing::Values(
SerializeParams(com_stmt_prepare_ok_packet{
int4(1), // statement id
int2(2), // number of fields
int2(3), // number of params
int2(0), // warnings
}, {
0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x03, 0x00,
0x00, 0x00, 0x00
})
));
} // anon namespace