Ticket #134 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

bug in CSV format code

Reported by: ruport Assigned to: sandal
Milestone: Keywords:
Cc: tarmo@itech.ee

Description

source:/trunk/lib/ruport/format/csv.rb

{{{ # Calls build_csv_row for each row in the Data::Table

def build_table_body

data.map { |r| build_csv_row(r) }.join("\n")

end

# Produces CSV output for a data row. def build_csv_row(row)

require "fastercsv" output << FasterCSV.generate { |csv| csv << row }

end}}}

The '.join("\n")' should be removed in build_table_body method because build_csv_row already accumulates the rows, if it's not removed then the result will look like:

{{{line1

line1 line2

line1 line2 line3

... and so on}}}

and in case of a longer report this will just run out of memory.

Change History

01/18/07 00:46:09 changed by sandal

  • status changed from new to assigned.
  • type changed from task to defect.

Hi,

Nice catch!

I actually ran into an out of memory error today, and this was likely the culpret.

I will patch it right now, and will have a maintainence release out before friday for 0.7

Thanks!

01/18/07 00:50:37 changed by sandal

  • status changed from assigned to closed.
  • resolution set to fixed.

fixed. See r435