diff --git a/mysql/MySQLdb.py b/mysql/MySQLdb.py
index <HASH>..<HASH> 100644
--- a/mysql/MySQLdb.py
+++ b/mysql/MySQLdb.py
@@ -110,7 +110,9 @@ insert_values = re.compile(r'values\s(\(.+\))', re.IGNORECASE)
 
 def escape_dict(d):
     d2 = {}
-    for k,v in d.items(): d2[k] = "'%s'" % escape_string(str(v))
+    for k,v in d.items():
+        if v is None: d2[k] = "NULL"
+        else: d2[k] = "'%s'" % escape_string(str(v))
     return d2
User-contributed fix: Convert None to NULL correctly when passing a
dictionary as the parameters to execute.