Project

General

Profile

« Previous | Next » 

Revision 2520

sql.py: put_table(): Preparing to insert new rows: Fixed bug where main_select needed to be generated after distinct_on was set in the if statement

View differences:

sql.py
969 969
        
970 970
        # Prepare to insert new rows
971 971
        insert_joins = input_joins[:] # don't modify original!
972
        main_select = mk_main_select(insert_joins, mapping.values())[0]
973 972
        insert_args = dict(recover=True, cacheable=False)
974 973
        if has_joins:
975 974
            distinct_on = [v.to_Col() for v in join_cols.values()]
......
977 976
                sql_gen.filter_out))
978 977
        else:
979 978
            insert_args.update(dict(returning=out_pkey, into=insert_out_pkeys))
979
        main_select = mk_main_select(insert_joins, mapping.values())[0]
980 980
        
981 981
        log_debug('Trying to insert new rows')
982 982
        try:

Also available in: Unified diff