Skip to content
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: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 6d95320 commit af0056201e4484adaf7d91b8a061db1ec3e8f41d @adrianholovaty adrianholovaty committed
Showing with 5 additions and 6 deletions.
  1. +4 −5 django/db/backends/sqlite3/
  2. +1 −1 django/db/backends/
9 django/db/backends/sqlite3/
@@ -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):
2 django/db/backends/
@@ -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()
return self.cursor.execute(sql, params)

0 comments on commit af00562

Please sign in to comment.
Something went wrong with that request. Please try again.