Project

General

Profile

« Previous | Next » 

Revision 2787

sql.py: mk_insert_select(): Return just the query instead of the query plus empty params

View differences:

lib/sql.py
647 647
        # Return query that uses function
648 648
        func_table = sql_gen.NamedTable('f', sql_gen.FunctionCall(function),
649 649
            [returning]) # AS clause requires function alias
650
        return (mk_select(db, func_table, start=0, order_by=None), [])
650
        return mk_select(db, func_table, start=0, order_by=None)
651 651
    
652
    return (query, params)
652
    return query
653 653

  
654 654
def insert_select(db, *args, **kw_args):
655 655
    '''For params, see mk_insert_select() and run_query_into()
......
662 662
    cacheable = kw_args.pop('cacheable', True)
663 663
    log_level = kw_args.pop('log_level', 2)
664 664
    
665
    query, params = mk_insert_select(db, *args, **kw_args)
666
    return run_query_into(db, query, params, into, recover=recover,
667
        cacheable=cacheable, log_level=log_level)
665
    return run_query_into(db, mk_insert_select(db, *args, **kw_args), [], into,
666
        recover=recover, cacheable=cacheable, log_level=log_level)
668 667

  
669 668
default = sql_gen.default # tells insert() to use the default value for a column
670 669

  
......
769 768
        sql_gen.filter_out)]
770 769
    
771 770
    return mk_insert_select(db, errors_table, name_only_cols,
772
        mk_select(db, joins, select_cols, order_by=None))[0]
771
        mk_select(db, joins, select_cols, order_by=None))
773 772

  
774 773
def track_data_error(db, errors_table, *args, **kw_args):
775 774
    '''

Also available in: Unified diff