Project

General

Profile

« Previous | Next » 

Revision 3636

sql_io.py: put_table(): ignore(): Replacing invalid value with NULL in nullable column: Corrected log message to "Replacing invalid value ... with NULL in column ..." because the rows with that value are not ignored in that case

View differences:

lib/sql_io.py
385 385
            
386 386
            track_data_error(db, errors_table_, in_col.srcs, value,
387 387
                e.cause.pgcode, e.cause.pgerror)
388
            log_debug('Ignoring rows with '+strings.as_tt(repr(in_col))+' = '
389
                +strings.as_tt(repr(value)))
390 388
            
391 389
            sql.add_index(db, in_col, insert_in_table) # enable fast filtering
392 390
            if value != None and in_col not in not_null_cols:
393
                # Try just mapping the value to NULL
391
                log_debug('Replacing invalid value '+strings.as_tt(repr(value))
392
                    +' with NULL in column '+strings.as_tt(repr(in_col)))
394 393
                sql.update(db, insert_in_table, [(in_col, None)],
395 394
                    sql_gen.ColValueCond(in_col, value))
396 395
            else:
396
                log_debug('Ignoring rows with '+strings.as_tt(repr(in_col))
397
                    +' = '+strings.as_tt(repr(value)))
397 398
                sql.delete(db, insert_in_table,
398 399
                    sql_gen.ColValueCond(in_col, value))
399 400
                if value == None: not_null_cols.add(in_col)
400 401
        else:
401 402
            assert isinstance(in_col, sql_gen.NamedCol)
402 403
            if value != None:
403
                # Try just mapping the value to NULL
404 404
                log_debug('Replacing invalid literal '
405 405
                    +strings.as_tt(repr(in_col))+' with NULL')
406 406
                mapping[in_col.name] = None

Also available in: Unified diff