Changeset 1689
- Timestamp:
- 12/15/05 23:16:48 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/magic-removal/django/db/backends/mysql/introspection.py
r1632 r1689 1 from django.db.backends.mysql.base import quote_name 1 2 from MySQLdb.constants import FIELD_TYPE 2 3 … … 8 9 def get_table_description(cursor, table_name): 9 10 "Returns a description of the table, with the DB-API cursor.description interface." 10 cursor.execute("SELECT * FROM %s LIMIT 1" % table_name)11 cursor.execute("SELECT * FROM %s LIMIT 1" % quote_name(table_name)) 11 12 return cursor.description 12 13 django/branches/magic-removal/django/db/backends/postgresql/introspection.py
r1632 r1689 1 from django.db.backends.postgresql.base import quote_name 2 1 3 def get_table_list(cursor): 2 4 "Returns a list of table names in the current database." … … 12 14 def get_table_description(cursor, table_name): 13 15 "Returns a description of the table, with the DB-API cursor.description interface." 14 cursor.execute("SELECT * FROM %s LIMIT 1" % table_name)16 cursor.execute("SELECT * FROM %s LIMIT 1" % quote_name(table_name)) 15 17 return cursor.description 16 18 django/branches/magic-removal/django/db/backends/sqlite3/introspection.py
r1632 r1689 1 from django.db.backends.sqlite3.base import quote_name 2 1 3 def get_table_list(cursor): 2 4 cursor.execute("SELECT name FROM sqlite_master WHERE type='table' ORDER BY name") … … 4 6 5 7 def get_table_description(cursor, table_name): 6 cursor.execute("PRAGMA table_info(%s)" % table_name)8 cursor.execute("PRAGMA table_info(%s)" % quote_name(table_name)) 7 9 return [(row[1], row[2], None, None) for row in cursor.fetchall()] 8 10
