Project

General

Profile

« Previous | Next » 

Revision 3302

sql_io.py: put_table(): Add pkey on pkeys table right when it's created, so that any duplicates are detected right away instead of at the end of the iteration. (Duplicates are created as a result of joins matching multiple rows, which often indicates a database misconfiguration.)

View differences:

lib/sql_io.py
316 316
            sql.insert_select(db, into, pkeys_names, query, **kw_args)
317 317
        else:
318 318
            sql.run_query_into(db, query, into=into, **kw_args)
319
            sql.add_pkey(db, into)
319 320
            pkeys_table_exists_ref[0] = True
320 321
    
321 322
    limit_ref = [None]
......
482 483
        
483 484
        sql.empty_temp(db, [insert_out_pkeys, insert_in_pkeys])
484 485
    
485
    sql.add_pkey(db, into)
486
    
487 486
    if not is_function:
488 487
        log_debug('Setting pkeys of missing rows to '
489 488
            +strings.as_tt(repr(default)))

Also available in: Unified diff