Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

magic-removal: Fixed #1624 -- Made small changes to parameters in exe…

…cutemany() in cursor implementations in MySQL and SQLite database backends

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2686 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit af0056201e4484adaf7d91b8a061db1ec3e8f41d 1 parent 6d95320
@adrianholovaty adrianholovaty authored
View
9 django/db/backends/sqlite3/base.py
@@ -62,15 +62,14 @@ class SQLiteCursorWrapper(Database.Cursor):
"""
Django uses "format" style placeholders, but pysqlite2 uses "qmark" style.
This fixes it -- but note that if you want to use a literal "%s" in a query,
- you'll need to use "%%s" (which I belive is true of other wrappers as well).
+ you'll need to use "%%s".
"""
-
- def execute(self, query, params=[]):
+ def execute(self, query, params=()):
query = self.convert_query(query, len(params))
return Database.Cursor.execute(self, query, params)
- def executemany(self, query, params=[]):
- query = self.convert_query(query, len(params[0]))
+ def executemany(self, query, param_list):
+ query = self.convert_query(query, len(param_list[0]))
return Database.Cursor.executemany(self, query, params)
def convert_query(self, query, num_params):
View
2  django/db/backends/util.py
@@ -6,7 +6,7 @@ def __init__(self, cursor, db):
self.cursor = cursor
self.db = db
- def execute(self, sql, params=[]):
+ def execute(self, sql, params=()):
start = time()
try:
return self.cursor.execute(sql, params)
Please sign in to comment.
Something went wrong with that request. Please try again.