mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-07-30 07:23:07 +03:00
Added is_empty() method to transaction class
Method is_empty() can be determined if there have no been changes to the transaction.
This commit is contained in:
@ -38,6 +38,7 @@ BOOST_FIXTURE_TEST_CASE(transaction_append_key_data,
|
||||
{
|
||||
cc.start_transaction(wsrep::transaction_id(1));
|
||||
BOOST_REQUIRE(tc.active());
|
||||
BOOST_REQUIRE(tc.is_empty());
|
||||
int vals[3] = {1, 2, 3};
|
||||
wsrep::key key(wsrep::key::exclusive);
|
||||
for (int i(0); i < 3; ++i)
|
||||
@ -45,6 +46,7 @@ BOOST_FIXTURE_TEST_CASE(transaction_append_key_data,
|
||||
key.append_key_part(&vals[i], sizeof(vals[i]));
|
||||
}
|
||||
BOOST_REQUIRE(cc.append_key(key) == 0);
|
||||
BOOST_REQUIRE(tc.is_empty() == false);
|
||||
wsrep::const_buffer data(&vals[2], sizeof(vals[2]));
|
||||
BOOST_REQUIRE(cc.append_data(data) == 0);
|
||||
BOOST_REQUIRE(cc.before_commit() == 0);
|
||||
|
Reference in New Issue
Block a user