Project

General

Profile

« Previous | Next » 

Revision 5446

sql.py: run_query(): DuplicateKeyException: Also retrieve the index's condition using new index_cond()

View differences:

sql.py
524 524
            if match:
525 525
                constraint, = match.groups()
526 526
                cols = []
527
                cond = None
527 528
                if recover: # need auto-rollback to run index_cols()
528
                    try: cols = index_cols(db, constraint)
529
                    try:
530
                        cols = index_cols(db, constraint)
531
                        cond = index_cond(db, constraint)
529 532
                    except NotImplementedError: pass
530
                raise DuplicateKeyException(constraint, None, cols, e)
533
                raise DuplicateKeyException(constraint, cond, cols, e)
531 534
            
532 535
            match = re.match(r'^null value in column "(.+?)" violates not-null'
533 536
                r' constraint', msg)

Also available in: Unified diff