Project

General

Profile

« Previous | Next » 

Revision 3425

sql.py: function_exists(): Fixed bug where select() needed to be run with auto-rollback in case it raised an exception

View differences:

lib/sql.py
1131 1131
def function_exists(db, function):
1132 1132
    qual_function = sql_gen.Literal(function.to_str(db))
1133 1133
    try:
1134
        select(db, fields=[sql_gen.Cast('regproc', qual_function)], log_level=4)
1134
        select(db, fields=[sql_gen.Cast('regproc', qual_function)],
1135
            recover=True, cacheable=True, log_level=4)
1135 1136
    except DoesNotExistException: return False
1136 1137
    else: return True
1137 1138

  

Also available in: Unified diff