Format protocol modules

Formatted the MariaDB protocol modules with Astyle.
This commit is contained in:
Markus Mäkelä
2018-01-24 11:20:11 +02:00
parent fe73458d65
commit dfbecc41e2
3 changed files with 127 additions and 126 deletions

View File

@ -116,7 +116,7 @@ static const uint8_t resultset2[] =
0x01, 0x00, 0x00, 0x15, 0x00, 0x01, 0x00, 0x00,
0x16, 0x00, 0x01, 0x00, 0x00, 0x17, 0x00, 0x01,
0x00, 0x00, 0x18, 0x00, 0x05, 0x00, 0x00, 0x19,
0xFE, 0x00, 0x00, 0x21, 0x40
0xFE, 0x00, 0x00, 0x21, 0x40
};
/**
@ -127,40 +127,40 @@ static const uint8_t resultset2[] =
**/
static const uint8_t resultset3[] =
{
0x28, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
0x40, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x0F, 0x0A,
0x61, 0x75, 0x74, 0x6F, 0x63, 0x6F, 0x6D, 0x6D,
0x69, 0x74, 0x03, 0x4F, 0x46, 0x46, 0x02, 0x01,
0x28, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01,
0x40, 0x00, 0x00, 0x00, 0x1F, 0x00, 0x0F, 0x0A,
0x61, 0x75, 0x74, 0x6F, 0x63, 0x6F, 0x6D, 0x6D,
0x69, 0x74, 0x03, 0x4F, 0x46, 0x46, 0x02, 0x01,
0x31, 0x05, 0x09, 0x08, 0x49, 0x5F, 0x52, 0x5F,
0x5F, 0x5F, 0x53, 0x5F, 0x1D, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
0x14, 0x00, 0x0F, 0x0A, 0x61, 0x75, 0x74, 0x6F,
0x63, 0x6F, 0x6D, 0x6D, 0x69, 0x74, 0x03, 0x4F,
0x46, 0x46, 0x02, 0x01, 0x31, 0x07, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x14, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
0x40, 0x00, 0x00, 0x00, 0x0B, 0x05, 0x09, 0x08,
0x49, 0x5F, 0x5F, 0x5F, 0x57, 0x5F, 0x5F, 0x5F,
0x01, 0x00, 0x00, 0x01, 0x04, 0x20, 0x00, 0x00,
0x02, 0x03, 0x64, 0x65, 0x66, 0x04, 0x74, 0x65,
0x73, 0x74, 0x02, 0x74, 0x31, 0x02, 0x74, 0x31,
0x01, 0x61, 0x01, 0x61, 0x0C, 0x21, 0x00, 0x3C,
0x00, 0x00, 0x00, 0xFD, 0x00, 0x00, 0x00, 0x00,
0x00, 0x20, 0x00, 0x00, 0x03, 0x03, 0x64, 0x65,
0x66, 0x04, 0x74, 0x65, 0x73, 0x74, 0x02, 0x74,
0x31, 0x02, 0x74, 0x31, 0x01, 0x62, 0x01, 0x62,
0x0C, 0x3F, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x03,
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
0x04, 0x03, 0x64, 0x65, 0x66, 0x04, 0x74, 0x65,
0x73, 0x74, 0x02, 0x74, 0x31, 0x02, 0x74, 0x31,
0x01, 0x63, 0x01, 0x63, 0x0C, 0x3F, 0x00, 0x0B,
0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
0x00, 0x20, 0x00, 0x00, 0x05, 0x03, 0x64, 0x65,
0x66, 0x04, 0x74, 0x65, 0x73, 0x74, 0x02, 0x74,
0x31, 0x02, 0x74, 0x31, 0x01, 0x64, 0x01, 0x64,
0x0C, 0x3F, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x03,
0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00,
0x06, 0xFE, 0x00, 0x00, 0x21, 0x00, 0x05, 0x00,
0x5F, 0x5F, 0x53, 0x5F, 0x1D, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
0x14, 0x00, 0x0F, 0x0A, 0x61, 0x75, 0x74, 0x6F,
0x63, 0x6F, 0x6D, 0x6D, 0x69, 0x74, 0x03, 0x4F,
0x46, 0x46, 0x02, 0x01, 0x31, 0x07, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x14, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
0x40, 0x00, 0x00, 0x00, 0x0B, 0x05, 0x09, 0x08,
0x49, 0x5F, 0x5F, 0x5F, 0x57, 0x5F, 0x5F, 0x5F,
0x01, 0x00, 0x00, 0x01, 0x04, 0x20, 0x00, 0x00,
0x02, 0x03, 0x64, 0x65, 0x66, 0x04, 0x74, 0x65,
0x73, 0x74, 0x02, 0x74, 0x31, 0x02, 0x74, 0x31,
0x01, 0x61, 0x01, 0x61, 0x0C, 0x21, 0x00, 0x3C,
0x00, 0x00, 0x00, 0xFD, 0x00, 0x00, 0x00, 0x00,
0x00, 0x20, 0x00, 0x00, 0x03, 0x03, 0x64, 0x65,
0x66, 0x04, 0x74, 0x65, 0x73, 0x74, 0x02, 0x74,
0x31, 0x02, 0x74, 0x31, 0x01, 0x62, 0x01, 0x62,
0x0C, 0x3F, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x03,
0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
0x04, 0x03, 0x64, 0x65, 0x66, 0x04, 0x74, 0x65,
0x73, 0x74, 0x02, 0x74, 0x31, 0x02, 0x74, 0x31,
0x01, 0x63, 0x01, 0x63, 0x0C, 0x3F, 0x00, 0x0B,
0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
0x00, 0x20, 0x00, 0x00, 0x05, 0x03, 0x64, 0x65,
0x66, 0x04, 0x74, 0x65, 0x73, 0x74, 0x02, 0x74,
0x31, 0x02, 0x74, 0x31, 0x01, 0x64, 0x01, 0x64,
0x0C, 0x3F, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x03,
0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00,
0x06, 0xFE, 0x00, 0x00, 0x21, 0x00, 0x05, 0x00,
0x00, 0x07, 0xFE, 0x00, 0x00, 0x21, 0x00
};
@ -170,46 +170,46 @@ void test1()
GWBUF *buffer;
proto.server_capabilities = GW_MYSQL_CAPABILITIES_SESSION_TRACK;
proto.num_eof_packets = 0;
ss_dfprintf(stderr,"test_session_track : Functional tests.\n");
ss_dfprintf(stderr, "test_session_track : Functional tests.\n");
//BEGIN
buffer = gwbuf_alloc_and_load(PACKET_1_LEN, resultset1+PACKET_1_IDX);
buffer = gwbuf_alloc_and_load(PACKET_1_LEN, resultset1 + PACKET_1_IDX);
mxs_mysql_get_session_track_info(buffer, &proto);
ss_dassert(strncmp(gwbuf_get_property(buffer, (char *)"trx_state"), "T_______", 8) == 0);
gwbuf_free(buffer);
//COMMIT
buffer = gwbuf_alloc_and_load(PACKET_2_LEN, resultset1+PACKET_2_IDX);
buffer = gwbuf_alloc_and_load(PACKET_2_LEN, resultset1 + PACKET_2_IDX);
mxs_mysql_get_session_track_info(buffer, &proto);
ss_dassert(strncmp(gwbuf_get_property(buffer, (char *)"trx_state"), "________", 8) == 0);
gwbuf_free(buffer);
//START TRANSACTION
buffer = gwbuf_alloc_and_load(PACKET_3_LEN, resultset1+PACKET_3_IDX);
buffer = gwbuf_alloc_and_load(PACKET_3_LEN, resultset1 + PACKET_3_IDX);
mxs_mysql_get_session_track_info(buffer, &proto);
ss_dassert(strncmp(gwbuf_get_property(buffer, (char *)"trx_state"), "T_______", 8) == 0);
gwbuf_free(buffer);
//START TRANSACTION READ ONLY
buffer = gwbuf_alloc_and_load(PACKET_4_LEN, resultset1+PACKET_4_IDX);
buffer = gwbuf_alloc_and_load(PACKET_4_LEN, resultset1 + PACKET_4_IDX);
mxs_mysql_get_session_track_info(buffer, &proto);
ss_dassert(strncmp(gwbuf_get_property(buffer, (char *)"trx_characteristics"),
"START TRANSACTION READ ONLY;", 28) == 0);
"START TRANSACTION READ ONLY;", 28) == 0);
gwbuf_free(buffer);
//COMMIT
buffer = gwbuf_alloc_and_load(PACKET_5_LEN, resultset1+PACKET_5_IDX);
buffer = gwbuf_alloc_and_load(PACKET_5_LEN, resultset1 + PACKET_5_IDX);
mxs_mysql_get_session_track_info(buffer, &proto);
ss_dassert(gwbuf_get_property(buffer, (char *)"trx_characteristics") == NULL);
ss_dassert(gwbuf_get_property(buffer, (char *)"trx_state") == NULL);
gwbuf_free(buffer);
//SET AUTOCOMMIT=0;
buffer = gwbuf_alloc_and_load(PACKET_6_LEN, resultset1+PACKET_6_IDX);
buffer = gwbuf_alloc_and_load(PACKET_6_LEN, resultset1 + PACKET_6_IDX);
mxs_mysql_get_session_track_info(buffer, &proto);
ss_dassert(strncmp(gwbuf_get_property(buffer, (char *)"autocommit"), "OFF", 3) == 0);
gwbuf_free(buffer);
//INSERT INTO t1 VALUES(1);
buffer = gwbuf_alloc_and_load(PACKET_7_LEN, resultset1+PACKET_7_IDX);
buffer = gwbuf_alloc_and_load(PACKET_7_LEN, resultset1 + PACKET_7_IDX);
mxs_mysql_get_session_track_info(buffer, &proto);
ss_dassert(strncmp(gwbuf_get_property(buffer, (char *)"trx_state"), "I___W___", 8) == 0);
gwbuf_free(buffer);
//COMMIT
buffer = gwbuf_alloc_and_load(PACKET_8_LEN, resultset1+PACKET_8_IDX);
buffer = gwbuf_alloc_and_load(PACKET_8_LEN, resultset1 + PACKET_8_IDX);
mxs_mysql_get_session_track_info(buffer, &proto);
ss_dassert(strncmp(gwbuf_get_property(buffer, (char *)"trx_state"), "________", 8) == 0);
gwbuf_free(buffer);