Project

General

Profile

« Previous | Next » 

Revision 2687

sql.py: add_index(): Fixed bug where expr needed to be deep copied so that any column nested in it (e.g. inside a FunctionCall) wouldn't be modified when col.table is set to None

View differences:

lib/sql.py
839 839
    '''Adds an index on a column or expression if it doesn't already exist.
840 840
    Currently, only function calls are supported as expressions.
841 841
    '''
842
    expr = copy.copy(expr) # don't modify input!
842
    expr = copy.deepcopy(expr) # don't modify input!
843 843
    
844 844
    # Extract col
845 845
    if isinstance(expr, sql_gen.FunctionCall):

Also available in: Unified diff