Skip to content

Fixed bug with assignments like DT[,c('x', 'y') := 1:10]#2557

Merged
mattdowle merged 2 commits intomasterfrom
assignFix2
Jan 10, 2018
Merged

Fixed bug with assignments like DT[,c('x', 'y') := 1:10]#2557
mattdowle merged 2 commits intomasterfrom
assignFix2

Conversation

@MarkusBonsch
Copy link
Copy Markdown
Contributor

@MarkusBonsch MarkusBonsch commented Jan 6, 2018

Closes #2540
Closes #185
assign.c is very careful, when the right hand side needs to be copied.
However, there was one loophole where it failed to copy the right hand side: if the right hand side is a factory fresh vector, where MAYBE_SHARED returns FALSE, that is assigned to multiple columns.
An example is DT[, c('x', 'y') := 1:10]
I fixed and added a test.

@codecov-io
Copy link
Copy Markdown

codecov-io commented Jan 6, 2018

Codecov Report

Merging #2557 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2557      +/-   ##
==========================================
+ Coverage   91.45%   91.45%   +<.01%     
==========================================
  Files          63       63              
  Lines       12071    12072       +1     
==========================================
+ Hits        11039    11040       +1     
  Misses       1032     1032
Impacted Files Coverage Δ
src/assign.c 94.32% <100%> (ø) ⬆️

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 f1d10c5...ea384e0. Read the comment docs.

@mattdowle mattdowle added this to the v1.10.6 milestone Jan 10, 2018
…as well. Added 753.2 too. Checked these tests fail in current dev and CRAN release.
@mattdowle mattdowle merged commit bf963b6 into master Jan 10, 2018
@mattdowle mattdowle deleted the assignFix2 branch January 10, 2018 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants