本文整理汇总了C++中TableIndex::replaceEntryNoKeyChange方法的典型用法代码示例。如果您正苦于以下问题:C++ TableIndex::replaceEntryNoKeyChange方法的具体用法?C++ TableIndex::replaceEntryNoKeyChange怎么用?C++ TableIndex::replaceEntryNoKeyChange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TableIndex
的用法示例。
在下文中一共展示了TableIndex::replaceEntryNoKeyChange方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: scheme
TEST_F(CompactingHashIndexTest, ENG1193) {
TableIndex *index = NULL;
vector<int> columnIndices;
vector<ValueType> columnTypes;
vector<int32_t> columnLengths;
vector<bool> columnAllowNull;
columnIndices.push_back(0);
columnTypes.push_back(VALUE_TYPE_BIGINT);
columnLengths.push_back(NValue::getTupleStorageSize(VALUE_TYPE_BIGINT));
columnAllowNull.push_back(false);
TupleSchema *schema = TupleSchema::createTupleSchemaForTest(columnTypes,
columnLengths,
columnAllowNull);
TableIndexScheme scheme("test_index", HASH_TABLE_INDEX,
columnIndices, TableIndex::simplyIndexColumns(),
false, false, schema);
index = TableIndexFactory::getInstance(scheme);
TableTuple *tuple1 = newTuple(schema, 0, 10);
index->addEntry(tuple1);
TableTuple *tuple2 = newTuple(schema, 0, 11);
index->addEntry(tuple2);
TableTuple *tuple3 = newTuple(schema, 0, 12);
index->addEntry(tuple3);
TableTuple *tuple4 = newTuple(schema, 0, 10);
EXPECT_TRUE(index->replaceEntryNoKeyChange(*tuple4, *tuple1));
EXPECT_FALSE(index->exists(tuple1));
EXPECT_TRUE(index->exists(tuple2));
EXPECT_TRUE(index->exists(tuple3));
EXPECT_TRUE(index->exists(tuple4));
delete index;
TupleSchema::freeTupleSchema(schema);
delete[] tuple1->address();
delete tuple1;
delete[] tuple2->address();
delete tuple2;
delete[] tuple3->address();
delete tuple3;
delete[] tuple4->address();
delete tuple4;
}