[Fix]remove OBKV unstable test case which has been covered by other use cases in farm

This commit is contained in:
obdev
2023-02-24 14:02:44 +00:00
committed by ob-robot
parent 2c860eae57
commit 9d17af51fd
2 changed files with 0 additions and 173 deletions

View File

@ -9563,177 +9563,6 @@ TEST_F(TestBatchExecute, query_sync_multi_task)
}
}
// the table should be single partition for this case:
// create table if not exists batch_operation_with_same_keys_test
// (C1 bigint primary key, C2 bigint, C3 varchar(100))
TEST_F(TestBatchExecute, batch_operation_with_same_keys)
{
OB_LOG(INFO, "begin batch_operation_with_duplicated_keys");
// setup
ObTable *the_table = NULL;
int ret = service_client_->alloc_table(ObString::make_string("batch_operation_with_same_keys_test"), the_table);
ASSERT_EQ(OB_SUCCESS, ret);
// start case
ObTableEntityFactory<ObTableEntity> entity_factory;
ObTableBatchOperation batch_operation;
ObITableEntity *entity = NULL;
for (int64_t i = 0; i < BATCH_SIZE; ++i) {
entity = entity_factory.alloc();
ASSERT_TRUE(NULL != entity);
ObObj key;
key.set_int(i*2 % 10);
ObObj value;
value.set_int(100+i);
ASSERT_EQ(OB_SUCCESS, entity->add_rowkey_value(key));
ASSERT_EQ(OB_SUCCESS, entity->set_property(C2, value));
//fprintf(stderr, "put key=%ld value=%ld i=%ld\n", (i*2%10), value.get_int(), i);
ASSERT_EQ(OB_SUCCESS, batch_operation.insert_or_update(*entity));
}
ASSERT_TRUE(!batch_operation.is_readonly());
ASSERT_TRUE(batch_operation.is_same_type());
ASSERT_TRUE(batch_operation.is_same_properties_names());
ObTableBatchOperationResult result;
ASSERT_EQ(OB_SUCCESS, the_table->batch_execute(batch_operation, result));
OB_LOG(INFO, "batch execute result", K(result));
ASSERT_EQ(BATCH_SIZE, result.count());
for (int64_t i = 0; i < BATCH_SIZE; ++i)
{
const ObTableOperationResult &r = result.at(i);
ASSERT_EQ(OB_SUCCESS, r.get_errno());
ASSERT_EQ(1, r.get_affected_rows());
ASSERT_EQ(ObTableOperationType::INSERT_OR_UPDATE, r.type());
const ObITableEntity *result_entity = NULL;
ASSERT_EQ(OB_SUCCESS, r.get_entity(result_entity));
ASSERT_TRUE(result_entity->is_empty());
} // end for
// get and verify
const ObITableEntity *result_entity = NULL;
{
batch_operation.reset();
entity_factory.free_and_reuse();
ObObj null_obj;
for (int64_t i = 0; i < BATCH_SIZE; ++i) {
entity = entity_factory.alloc();
ASSERT_TRUE(NULL != entity);
ObObj key;
key.set_int(i*2%10);
ASSERT_EQ(OB_SUCCESS, entity->add_rowkey_value(key));
ASSERT_EQ(OB_SUCCESS, entity->set_property(C2, null_obj));
ASSERT_EQ(OB_SUCCESS, batch_operation.retrieve(*entity));
}
ASSERT_TRUE(batch_operation.is_readonly());
ASSERT_TRUE(batch_operation.is_same_type());
ASSERT_TRUE(batch_operation.is_same_properties_names());
ASSERT_EQ(OB_SUCCESS, the_table->batch_execute(batch_operation, result));
OB_LOG(INFO, "batch execute result", K(result));
ASSERT_EQ(BATCH_SIZE, result.count());
for (int64_t i = 0; i < BATCH_SIZE; ++i) {
const ObTableOperationResult &r = result.at(i);
ASSERT_EQ(OB_SUCCESS, r.get_errno());
ASSERT_EQ(ObTableOperationType::GET, r.type());
ASSERT_EQ(0, r.get_affected_rows());
ASSERT_EQ(OB_SUCCESS, r.get_entity(result_entity));
ASSERT_EQ(0, result_entity->get_rowkey_size());
ObObj value;
ASSERT_EQ(OB_SUCCESS, result_entity->get_property(C2, value));
//fprintf(stderr, "get C2 value=%ld i=%ld key=%ld\n", value.get_int(), i, i*2%10);
ASSERT_EQ(195+i%5, value.get_int());
}
}
{
// all the same key
batch_operation.reset();
entity_factory.free_and_reuse();
ObObj null_obj;
for (int64_t i = 0; i < BATCH_SIZE; ++i) {
entity = entity_factory.alloc();
ASSERT_TRUE(NULL != entity);
ObObj key;
key.set_int(0);
ASSERT_EQ(OB_SUCCESS, entity->add_rowkey_value(key));
ASSERT_EQ(OB_SUCCESS, entity->set_property(C2, null_obj));
ASSERT_EQ(OB_SUCCESS, batch_operation.retrieve(*entity));
}
ASSERT_TRUE(batch_operation.is_readonly());
ASSERT_TRUE(batch_operation.is_same_type());
ASSERT_TRUE(batch_operation.is_same_properties_names());
ASSERT_EQ(OB_SUCCESS, the_table->batch_execute(batch_operation, result));
OB_LOG(INFO, "batch execute result", K(result));
ASSERT_EQ(BATCH_SIZE, result.count());
for (int64_t i = 0; i < BATCH_SIZE; ++i) {
const ObTableOperationResult &r = result.at(i);
ASSERT_EQ(OB_SUCCESS, r.get_errno());
ASSERT_EQ(ObTableOperationType::GET, r.type());
ASSERT_EQ(0, r.get_affected_rows());
ASSERT_EQ(OB_SUCCESS, r.get_entity(result_entity));
ASSERT_EQ(0, result_entity->get_rowkey_size());
ObObj value;
ASSERT_EQ(OB_SUCCESS, result_entity->get_property(C2, value));
//fprintf(stderr, "get C2 value=%ld i=%ld\n", value.get_int(), i);
ASSERT_EQ(195, value.get_int());
}
}
{
// pattern: empty empty exist exist empty empty exist exist ...
batch_operation.reset();
entity_factory.free_and_reuse();
ObObj null_obj;
int64_t key1_not_exist = 1;
int64_t key2_not_exist = 3;
for (int64_t i = 0; i < BATCH_SIZE; ++i) {
entity = entity_factory.alloc();
ASSERT_TRUE(NULL != entity);
ObObj key;
if (i < BATCH_SIZE/4) {
key.set_int(key1_not_exist);
} else if (i < BATCH_SIZE/4*2) {
key.set_int(0);
} else if (i < BATCH_SIZE/4*3) {
key.set_int(key2_not_exist);
} else {
key.set_int(2);
}
ASSERT_EQ(OB_SUCCESS, entity->add_rowkey_value(key));
ASSERT_EQ(OB_SUCCESS, entity->set_property(C2, null_obj));
ASSERT_EQ(OB_SUCCESS, batch_operation.retrieve(*entity));
}
ASSERT_TRUE(batch_operation.is_readonly());
ASSERT_TRUE(batch_operation.is_same_type());
ASSERT_TRUE(batch_operation.is_same_properties_names());
ASSERT_EQ(OB_SUCCESS, the_table->batch_execute(batch_operation, result));
OB_LOG(INFO, "batch execute result", K(result));
ASSERT_EQ(BATCH_SIZE, result.count());
for (int64_t i = 0; i < BATCH_SIZE; ++i) {
const ObTableOperationResult &r = result.at(i);
ASSERT_EQ(OB_SUCCESS, r.get_errno());
ASSERT_EQ(ObTableOperationType::GET, r.type());
ASSERT_EQ(0, r.get_affected_rows());
ASSERT_EQ(OB_SUCCESS, r.get_entity(result_entity));
ASSERT_EQ(0, result_entity->get_rowkey_size());
if (i < BATCH_SIZE/4) {
ASSERT_TRUE(result_entity->is_empty());
} else if (i < BATCH_SIZE/4*2) {
ObObj value;
ASSERT_EQ(OB_SUCCESS, result_entity->get_property(C2, value));
//fprintf(stderr, "get C2 value=%ld i=%ld\n", value.get_int(), i);
ASSERT_EQ(195, value.get_int());
} else if (i < BATCH_SIZE/4*3) {
ASSERT_TRUE(result_entity->is_empty());
} else {
ObObj value;
ASSERT_EQ(OB_SUCCESS, result_entity->get_property(C2, value));
//fprintf(stderr, "get C2 value=%ld i=%ld\n", value.get_int(), i);
ASSERT_EQ(196, value.get_int());
}
} // end for
}
// teardown
service_client_->free_table(the_table);
the_table = NULL;
}
// create table if not exists query_with_filter (C1 bigint primary key, C2 bigint default null, C3 varchar(100) default null, C4 double default 0);
TEST_F(TestBatchExecute, table_query_with_filter)
{

View File

@ -31,7 +31,6 @@ mysql -h $HOST -P $PORT -u $user -e "alter system set _enable_defensive_check =
mysql -h $HOST -P $PORT -u $user -e "drop table if exists batch_execute_test; create table if not exists batch_execute_test (C1 bigint primary key, C2 bigint, C3 varchar(100)) PARTITION BY KEY(C1) PARTITIONS 16" $db
mysql -h $HOST -P $PORT -u $user -e "drop table if exists complex_batch_execute_test; create table if not exists complex_batch_execute_test (C1 bigint primary key, C2 bigint, C3 varchar(100)) PARTITION BY KEY(C1) PARTITIONS 16" $db
mysql -h $HOST -P $PORT -u $user -e "drop table if exists all_single_operation_test; create table if not exists all_single_operation_test (C1 bigint primary key, C2 bigint, C3 varchar(100)) PARTITION BY KEY(C1) PARTITIONS 16" $db
mysql -h $HOST -P $PORT -u $user -e "drop table if exists batch_operation_with_same_keys_test; create table if not exists batch_operation_with_same_keys_test (C1 bigint primary key, C2 bigint, C3 varchar(100))" $db
mysql -h $HOST -P $PORT -u $user -e "drop table if exists type_check_test; create table type_check_test (pk1 bigint, pk2 varchar(10), ctinyint tinyint, csmallint smallint, cmediumint mediumint, cint int, cbigint bigint, utinyint tinyint unsigned, usmallint smallint unsigned, umediumint mediumint unsigned, uint int unsigned, ubigint bigint unsigned, cfloat float, cdouble double, ufloat float unsigned, udouble double unsigned, cnumber decimal(10, 2), unumber decimal(10,2) unsigned, cvarchar varchar(10), cchar char(10), cbinary binary(10), cvarbinary varbinary(10), ctimestamp timestamp, cdatetime datetime, cyear year, cdate date, ctime time, ctext text, cblob blob, cbit bit(64), cnotnull bigint not null default 111, PRIMARY KEY(pk1, pk2));" $db
mysql -h $HOST -P $PORT -u $user -e "drop table if exists column_default_value; create table column_default_value (C1 bigint primary key, C2 bigint default 1, C3 varchar(100) default 'abc') PARTITION BY KEY(C1) PARTITIONS 16" $db
mysql -h $HOST -P $PORT -u $user -e "drop table if exists partial_update_test; create table if not exists partial_update_test (C1 bigint primary key, C2 bigint, C3 varchar(100)) PARTITION BY KEY(C1) PARTITIONS 16" $db
@ -93,7 +92,6 @@ mysql -h $HOST -P $PORT -u $user -e "drop table if exists htable1_query_sync; cr
mysql -h $HOST -P $PORT -u $user -e "drop table if exists batch_execute_test; create table if not exists batch_execute_test (C1 bigint primary key, C2 bigint, C3 varchar(100), index i1(c2) local, index i2(c3) local, index i3(c2, c3)) PARTITION BY KEY(C1) PARTITIONS 16" $db
mysql -h $HOST -P $PORT -u $user -e "drop table if exists complex_batch_execute_test; create table if not exists complex_batch_execute_test (C1 bigint primary key, C2 bigint, C3 varchar(100), index i1(c2) local, index i2(c3) local, index i3(c2, c3)) PARTITION BY KEY(C1) PARTITIONS 16" $db
mysql -h $HOST -P $PORT -u $user -e "drop table if exists all_single_operation_test; create table if not exists all_single_operation_test (C1 bigint primary key, C2 bigint, C3 varchar(100)) PARTITION BY KEY(C1) PARTITIONS 16" $db
mysql -h $HOST -P $PORT -u $user -e "drop table if exists batch_operation_with_same_keys_test; create table if not exists batch_operation_with_same_keys_test (C1 bigint primary key, C2 bigint, C3 varchar(100), index i1(c2) local, index i2(c3) local, index i3(c2, c3))" $db
mysql -h $HOST -P $PORT -u $user -e "drop table if exists type_check_test; create table type_check_test (pk1 bigint, pk2 varchar(10), ctinyint tinyint, csmallint smallint, cmediumint mediumint, cint int, cbigint bigint, utinyint tinyint unsigned, usmallint smallint unsigned, umediumint mediumint unsigned, uint int unsigned, ubigint bigint unsigned, cfloat float, cdouble double, ufloat float unsigned, udouble double unsigned, cnumber decimal(10, 2), unumber decimal(10,2) unsigned, cvarchar varchar(10), cchar char(10), cbinary binary(10), cvarbinary varbinary(10), ctimestamp timestamp, cdatetime datetime, cyear year, cdate date, ctime time, ctext text, cblob blob, cbit bit(64), cnotnull bigint not null default 111, PRIMARY KEY(pk1, pk2));" $db
mysql -h $HOST -P $PORT -u $user -e "drop table if exists column_default_value; create table column_default_value (C1 bigint primary key, C2 bigint default 1, C3 varchar(100) default 'abc', index i1(c2) local, index i2(c3) local, index i3(c2, c3)) PARTITION BY KEY(C1) PARTITIONS 16" $db
mysql -h $HOST -P $PORT -u $user -e "drop table if exists partial_update_test; create table if not exists partial_update_test (C1 bigint primary key, C2 bigint, C3 varchar(100), index i1(c2) local, index i2(c3) local, index i3(c2, c3)) PARTITION BY KEY(C1) PARTITIONS 16" $db