Project

General

Profile

« Previous | Next » 

Revision 3310

sql_io.py: put_table(): ignore(): Also add an index on in_col if mapping the value to NULL

View differences:

lib/sql_io.py
341 341
        log_debug('Ignoring rows with '+strings.as_tt(repr(in_col))+' = '
342 342
            +strings.as_tt(repr(value)))
343 343
        
344
        sql.add_index(db, in_col, insert_in_table) # enable fast filtering
344 345
        if value != None and in_col not in not_null_cols:
345 346
            # Try just mapping the value to NULL
346 347
            sql.update(db, insert_in_table, [(in_col, None)],
347 348
                sql_gen.ColValueCond(in_col, value))
348 349
        else:
349
            sql.add_index(db, in_col, insert_in_table) # enable fast filtering
350 350
            sql.delete(db, insert_in_table, sql_gen.ColValueCond(in_col, value))
351 351
            if value == None: not_null_cols.add(in_col)
352 352
    

Also available in: Unified diff