Project

General

Profile

« Previous | Next » 

Revision 2395

sql.py: put_table(): Join together input tables into new table for speed and so don't modify input if values edited

View differences:

lib/sql.py
804 804
    input_joins = [in_tables0]+[sql_gen.Join(v, {in_pkey: sql_gen.join_same})
805 805
        for v in in_tables_]
806 806
    
807
    db.log_debug('Joining together input tables')
808
    # Place in new table for speed and so don't modify input if values edited
809
    in_table = sql_gen.Table(temp_prefix+'_in')
810
    flatten_cols = filter(sql_gen.is_table_col, mapping.values())
811
    mapping = dicts.join(mapping, flatten(db, in_table, input_joins,
812
        flatten_cols, preserve=[in_pkey_col], start=0))
813
    input_joins = [in_table]
814
    
807 815
    out_pkey = pkey(db, out_table, recover=True)
808 816
    out_pkey_col = sql_gen.as_Col(out_pkey, out_table)
809 817
    
......
822 830
    distinct_on = []
823 831
    def mk_main_select(joins, cols):
824 832
        return mk_select(db, joins, cols, conds, distinct_on, limit=limit,
825
            start=start, default_table=in_tables0)
833
            start=start)
826 834
    
827 835
    def log_exc(e):
828 836
        db.log_debug('Caught exception: '+exc.str_(e, first_line_only=True))

Also available in: Unified diff