Project

General

Profile

« Previous | Next » 

Revision 9458

bugfix: lib/sql.py: parse_exception(): typed_name_re: added back matching of names without "", since these are used by some error messages (ones that contain () after the function name)

View differences:

sql.py
598 598
        name, type_ = match.groups()
599 599
        raise InvalidTypeException(type_, name, e)
600 600
    
601
    typed_name_re = r'^(\S+) "(.+?)"(?: of relation ".+?")?'
601
    typed_name_re = r'^(\S+) ("?)(.+?)\2(?: of relation ".+?")?'
602 602
        # regexp must be followed with text for .*? to match properly
603 603
    
604
    match = re.match(typed_name_re+r'.*? already exists', msg)
604
    match = re.match(typed_name_re+r'(?:\(.*?)? already exists', msg)
605 605
    if match:
606
        type_, name = match.groups()
606
        type_, quote, name = match.groups()
607 607
        raise DuplicateException(type_, name, e)
608 608
    
609 609
    match = re.match(r'more than one (\S+) named ""(.+?)""', msg)
......
613 613
    
614 614
    match = re.match(typed_name_re+r' does not exist', msg)
615 615
    if match:
616
        type_, name = match.groups()
616
        type_, quote, name = match.groups()
617 617
        if type_ == 'function':
618 618
            match = re.match(r'^(.+?)\(.*\)$', name)
619 619
            if match: # includes params, so is call rather than cast to regproc

Also available in: Unified diff