Project

General

Profile

« Previous | Next » 

Revision 2572

sql_gen.py: esc_name(): If is_safe_name(), just return name, to avoid escessive escaping in debug output for Redmine

View differences:

lib/sql_gen.py
12 12
def is_safe_name(name): return re.match(r'^[^\WA-Z]+$', name) # no uppercase
13 13

  
14 14
def esc_name(name, quote='"'):
15
    if is_safe_name(name): return name
15 16
    return quote + name.replace(quote, quote+quote) + quote
16 17
        # doubling an embedded quote escapes it in both PostgreSQL and MySQL
17 18

  

Also available in: Unified diff