Project

General

Profile

« Previous | Next » 

Revision 3020

sql_gen.py: to_name_only_col(): Consider any non-table column, including NamedCol, to be already name-only. This fixes a bug in sql.mk_insert_select() where the value of a NamedCol was removed by to_name_only_col() even though it was needed.

View differences:

lib/sql_gen.py
181 181
        
182 182
        code = as_Table(code)
183 183
        if not isinstance(code, (Table, FunctionCall, Expr)): code = Expr(code)
184
        if cols != None: cols = map(to_name_only_col, cols)
184
        if cols != None: cols = [to_name_only_col(c).to_Col() for c in cols]
185 185
        
186 186
        self.code = code
187 187
        self.cols = cols
......
263 263

  
264 264
def to_name_only_col(col, check_table=None):
265 265
    col = as_Col(col)
266
    if not isinstance(col, Col): return col
266
    if not is_table_col(col): return col
267 267
    
268 268
    if check_table != None:
269 269
        table = col.table

Also available in: Unified diff