Revision 2496
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
115 | 115 |
else: quote = '"' |
116 | 116 |
elif module == 'MySQLdb': quote = '`' |
117 | 117 |
else: raise NotImplementedError("Can't escape name for "+module+' database') |
118 |
return quote + name.replace(quote, '') + quote |
|
118 |
return quote + name.replace(quote, quote+quote) + quote |
|
119 |
# doubling an embedded quote escapes it in both PostgreSQL and MySQL |
|
119 | 120 |
|
120 | 121 |
def esc_name_by_engine(engine, name, **kw_args): |
121 | 122 |
return esc_name_by_module(db_engines[engine][0], name, **kw_args) |
Also available in: Unified diff
sql.py: esc_name_by_module(): Double embedded quotes to escape them instead of removing them