index refactoring
This commit is contained in:
16
table.cpp
16
table.cpp
@@ -282,23 +282,11 @@ bool Table::drop_index(const std::string &index_name) {
|
||||
|
||||
|
||||
void Table::index_row(Index &index, const ColDefNode &col_def, const Row &row, const size_t rowid) {
|
||||
if (col_def.type==ColumnType::integer_type) {
|
||||
index.insert(row[col_def.order].getIntValue(), rowid);
|
||||
} else if (col_def.type==ColumnType::varchar_type) {
|
||||
index.insert(row[col_def.order].getStringValue(), rowid);
|
||||
} else {
|
||||
throw Exception("implement me! Table::index_row(const Row &row)");
|
||||
}
|
||||
index.insert(reinterpret_cast<ColValue *>(&row[col_def.order]), rowid);
|
||||
}
|
||||
|
||||
void Table::unindex_row(Index &index, const ColDefNode &col_def, const Row &row, const size_t rowid) {
|
||||
if (col_def.type==ColumnType::integer_type) {
|
||||
index.remove(row[col_def.order].getIntValue(), rowid);
|
||||
} else if (col_def.type==ColumnType::varchar_type) {
|
||||
index.remove(row[col_def.order].getStringValue(), rowid);
|
||||
} else {
|
||||
throw Exception("implement me! Table::index_row(const Row &row)");
|
||||
}
|
||||
index.remove(reinterpret_cast<ColValue *>(&row[col_def.order]), rowid);
|
||||
}
|
||||
|
||||
void Table::reindex_row(Index &index, const ColDefNode &col_def, const Row &old_row, const Row &new_row, size_t rowid) {
|
||||
|
||||
Reference in New Issue
Block a user