Made the truncating of columns automatic when closing them (note:
already the case for AVLs)
This commit is contained in:
@ -989,6 +989,13 @@ int obi_close_column(OBIDMS_column_p column)
|
||||
bool close_dir;
|
||||
Opened_columns_list_p columns_list;
|
||||
|
||||
// Truncate the column to the number of lines used if it's not read-only
|
||||
if (column->writable)
|
||||
{
|
||||
if (obi_truncate_column(column) < 0)
|
||||
return -1;
|
||||
}
|
||||
|
||||
columns_list = (column->dms)->opened_columns;
|
||||
|
||||
(column->counter)--;
|
||||
@ -1049,7 +1056,7 @@ int obi_close_column(OBIDMS_column_p column)
|
||||
}
|
||||
|
||||
|
||||
int obi_truncate_column_to_lines_used(OBIDMS_column_p column) // TODO is it necessary to unmap/remap?
|
||||
int obi_truncate_column(OBIDMS_column_p column) // TODO is it necessary to unmap/remap?
|
||||
{
|
||||
size_t file_size;
|
||||
size_t data_size;
|
||||
@ -1224,20 +1231,6 @@ int obi_enlarge_column(OBIDMS_column_p column)
|
||||
}
|
||||
|
||||
|
||||
int obi_truncate_and_close_column(OBIDMS_column_p column)
|
||||
{
|
||||
if (column->writable) // TODO discuss
|
||||
{
|
||||
if (obi_truncate_column_to_lines_used(column) < 0)
|
||||
return -1;
|
||||
}
|
||||
if (obi_close_column(column) < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void obi_ini_to_NA_values(OBIDMS_column_p column,
|
||||
index_t first_line_nb,
|
||||
index_t nb_lines)
|
||||
|
Reference in New Issue
Block a user