Closed Capncavedan closed 2 years ago
I've fixed the former case as a bug but don't change field_size_limit:
for the latter. Because the latter breaks a backward compatibility.
I've deprecated field_size_limit:
and introduced max_field_size:
instead. field_size_limit: 10
equals to max_field_size: 9
.
Thank you very much, @kou!
When using CSV.parse or CSV.foreach and specifying option
field_size_limit: 2_000
, we do not consistently see an exception raised when a field contains over 2,000 characters.I was finally able to reproduce the issue as occurring only after a comma has occurred within a data field.
I then also found what could be considered an off-by-one error with respect to "field_size_limit": you need to set a value 1 higher than the maximum field length you want to allow.
This occurs on Ruby 2.7.5 and 3.1.1.
This is a simple ruby script to demonstrate both issues: