Project

General

Profile

« Previous | Next » 

Revision 2518

sql.py: put_table(): Moved mk_main_select() call out of try block since it is not related to the exceptions that may be thrown

View differences:

sql.py
968 968
        
969 969
        # Prepare to insert new rows
970 970
        insert_joins = input_joins[:] # don't modify original!
971
        main_select = mk_main_select(insert_joins, mapping.values())[0]
971 972
        insert_args = dict(recover=True, cacheable=False)
972 973
        if has_joins:
973 974
            distinct_on = [v.to_Col() for v in join_cols.values()]
......
978 979
        
979 980
        log_debug('Trying to insert new rows')
980 981
        try:
981
            cur = insert_select(db, out_table, mapping.keys(),
982
                *mk_main_select(insert_joins, mapping.values()), **insert_args)
982
            cur = insert_select(db, out_table, mapping.keys(), main_select,
983
                **insert_args)
983 984
            break # insert successful
984 985
        except DuplicateKeyException, e:
985 986
            log_exc(e)

Also available in: Unified diff