Переглянути джерело

Table names are now encapsulated by backticks before being used in a query

Taddeus Kroes 13 роки тому
батько
коміт
c2b2219fa7
1 змінених файлів з 1 додано та 1 видалено
  1. 1 1
      generate.py

+ 1 - 1
generate.py

@@ -269,7 +269,7 @@ def read_tables(conn):
 
 def read_fields(conn, table):
     cur = conn.cursor(mysql.cursors.DictCursor)
-    cur.execute('show columns from %s' % table)
+    cur.execute('show columns from `%s`' % table)
     fields = cur.fetchall()
     cur.close()
     return fields