Project

General

Profile

« Previous | Next » 

Revision 5766

sql_io.py: put_table(): insert_into_pkeys(): Use new sql.add_pkey_or_index() instead of sql.add_pkey() in order to just print a warning if for some reason there were duplicate entries for an input row in the iteration's pkeys table. This should provide a workaround for bugs (often in the schema itself, related to its unique indexes) that cause an input row to match multiple output rows when joining on the output table using the unique constraint's columns.

View differences:

lib/sql_io.py
435 435
            sql.insert_select(db, into, [in_pkey, into_out_pkey], query,
436 436
                **kw_args)
437 437
        else:
438
            sql.run_query_into(db, query, into=into, add_pkey_=True, **kw_args)
438
            sql.run_query_into(db, query, into=into, **kw_args)
439 439
            pkeys_table_exists_ref[0] = True
440
            sql.add_pkey_or_index(db, into, warn=True)
440 441
    
441 442
    def mk_main_select(joins, cols): return sql.mk_select(db, joins, cols)
442 443
    

Also available in: Unified diff