Fixed a bug where the new line count when truncating a column would not
be computed correctly when dealing with high numbers (bad automatic type for intermediate result)
This commit is contained in:
@ -1466,7 +1466,7 @@ int obi_truncate_column(OBIDMS_column_p column) // TODO is it necessary to unmap
|
||||
|
||||
// Compute the new line count = the number of lines used rounded to the nearest greater multiple of page size greater than 0
|
||||
multiple = ceil((double) (ONE_IF_ZERO((column->header)->lines_used) * (column->header)->nb_elements_per_line * obi_sizeof((column->header)->stored_data_type)) / (double) getpagesize());
|
||||
new_line_count = floor((((int) multiple) * getpagesize()) / ((column->header)->nb_elements_per_line * obi_sizeof((column->header)->stored_data_type)));
|
||||
new_line_count = floor((((int64_t) multiple) * ((int64_t) getpagesize())) / ((column->header)->nb_elements_per_line * obi_sizeof((column->header)->stored_data_type)));
|
||||
|
||||
data_size = obi_array_sizeof((column->header)->stored_data_type, new_line_count, (column->header)->nb_elements_per_line);
|
||||
|
||||
|
Reference in New Issue
Block a user