Project

General

Profile

« Previous | Next » 

Revision 5711

sql.py: parse_exception(): function MissingCastException: Fixed bug where determining whether the exception is a MissingCastException rather than a DoesNotExistException needs to check whether the function exists rather than whether it's the same in the exception message as in the query that was run. The exception message will of course copy the function name verbatim from the query, so there is no information in the exception message itself to indicate whether the DoesNotExistException was caused by a missing cast or by a nonexistent function.

View differences:

sql.py
577 577
            match = re.match(r'^(.+?)\(.*\)$', name)
578 578
            if match: # includes params, so is call rather than cast to regproc
579 579
                function_name, = match.groups()
580
                if msg.split('\n')[1].find(function_name) >= 0: # also on line 2
580
                func = sql_gen.Function(function_name)
581
                if function_exists(db, func):
581 582
                    # not found only because of a missing cast
582 583
                    raise MissingCastException('text', function_name, e)
583 584
        raise DoesNotExistException(type_, name, e)

Also available in: Unified diff