Skip to content

Conversation

@benjeffery
Copy link
Member

Fixes #2336

@benjeffery
Copy link
Member Author

Heh, was good to do this as it exposed a logic error in the overflow check. The calculation overflowed when the added rows were greater than the maximum.

@codecov
Copy link

codecov bot commented Jun 10, 2022

Codecov Report

Merging #2337 (ad011ff) into main (5202ff6) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2337   +/-   ##
=======================================
  Coverage   93.28%   93.28%           
=======================================
  Files          28       28           
  Lines       26712    26713    +1     
  Branches     1222     1222           
=======================================
+ Hits        24917    24918    +1     
  Misses       1762     1762           
  Partials       33       33           
Flag Coverage Δ
c-tests 92.25% <100.00%> (+<0.01%) ⬆️
lwt-tests 89.05% <ø> (ø)
python-c-tests 71.35% <ø> (ø)
python-tests 98.85% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
c/tskit/tables.c 90.24% <100.00%> (+<0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5202ff6...ad011ff. Read the comment docs.

@benjeffery benjeffery marked this pull request as ready for review June 12, 2022 21:49
Copy link
Member

@jeromekelleher jeromekelleher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one nit

c/tskit/tables.c Outdated
return current_size > (TSK_MAX_SIZE - additional_elements);
tsk_size_t max_val = TSK_MAX_SIZE;
return additional_elements > max_val
|| current_size > (TSK_MAX_SIZE - additional_elements);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably use (max_val - additional_elements) here

@jeromekelleher
Copy link
Member

Needs CHANGELOGs update

@mergify mergify bot merged commit a39202f into tskit-dev:main Jun 15, 2022
GertjanBisschop added a commit to GertjanBisschop/tskit that referenced this pull request Jun 22, 2022
Docstring did not reflect the changes in tskit-dev#2337.
benjeffery pushed a commit to GertjanBisschop/tskit that referenced this pull request Jun 22, 2022
Docstring did not reflect the changes in tskit-dev#2337.
mergify bot pushed a commit that referenced this pull request Jun 22, 2022
Docstring did not reflect the changes in #2337.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reduce the maximum number of rows in a table to fit into tsk_id_t

2 participants