Revision 4925
Added by Aaron Marcuse-Kubitza about 12 years ago
bin/csv2db | ||
---|---|---|
107 | 107 |
cols_ct = len(col_names) |
108 | 108 |
for row in csvs.make_reader(line_in, dialect): |
109 | 109 |
row = map(strings.to_unicode, row) |
110 |
row.insert(0, sql.default) # row_num is autogen |
|
111 | 110 |
util.list_set_length(row, cols_ct) # truncate extra cols |
112 | 111 |
sql.insert(db, table, row, cacheable=False, log_level=5) |
113 | 112 |
finally: |
Also available in: Unified diff
csv2db: Fixed bug where tables without a row_num (such as *.src tables) were not properly supported when the CSV contained ragged rows, because the columns were truncated to # column names + 1 but there was no row_num to be the +1. This was solved by moving row_num to the end, so that it does not impact the column count whether it's there or not.