Project

General

Profile

« Previous | Next » 

Revision 5026

bin/map, db_xml.put_table() (row-based and column-based import): Don't sort the input table by its pkey, in order to support input tables with no pkey. Note that reading the input table in table order and having this match the input flat file's order is only possible with sql_io.import_csv()'s truncation of the table on a failed import, which ensures that the rows will be stored in inserted order.

View differences:

lib/db_xml.py
219 219
        try: sql.add_row_num(db, in_table, sql.pkey_col)
220 220
        except sql.DatabaseErrors: pass # already has pkey
221 221
        cur = sql.insert_select(db, in_table, None, sql.mk_select(db,
222
            full_in_table, limit=this_limit, start=start))
222
            full_in_table, limit=this_limit, start=start, order_by=None))
223 223
        
224 224
        this_ct = cur.rowcount
225 225
        total += this_ct
bin/map
342 342
            if by_col: limit = 0 # only fetch column names
343 343
            else: limit = n
344 344
            cur = sql.select(in_db, table, limit=limit, start=start,
345
                cacheable=False)
345
                order_by=None, cacheable=False)
346 346
            col_names = list(sql.col_names(cur))
347 347
            
348 348
            if by_col:

Also available in: Unified diff