Revision 2763
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
212 | 212 |
self.result = [] |
213 | 213 |
|
214 | 214 |
def execute(self, query, params=None): |
215 |
if params == None or params == [] or params == ():# not using params |
|
216 |
esc_query = strings.esc_for_mogrify(query) |
|
217 |
else: esc_query = query |
|
215 |
if params == [] or params == (): params = None |
|
216 |
# None turns off the mogrifier |
|
218 | 217 |
|
219 | 218 |
self._is_insert = query.upper().find('INSERT') >= 0 |
220 | 219 |
self.query_lookup = _query_lookup(query, params) |
221 | 220 |
try: |
222 | 221 |
try: |
223 |
cur = self.inner.execute(esc_query, params)
|
|
222 |
cur = self.inner.execute(query, params) |
|
224 | 223 |
self.outer.do_autocommit() |
225 | 224 |
finally: self.query = get_cur_query(self.inner, query, params) |
226 | 225 |
except Exception, e: |
Also available in: Unified diff
sql.py: DbConn.DbCursor.execute(): Fixed bug where params == None would apparently turn off the mogrifier completely, causing "%"s to be excessively escaped, by just setting params to None if it was [] or () and not using strings.esc_for_mogrify() at all