Django

Code

Changeset 1689

Show
Ignore:
Timestamp:
12/15/05 23:16:48 (3 years ago)
Author:
adrian
Message:

magic-removal: Merged to [1688]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/magic-removal/django/db/backends/mysql/introspection.py

    r1632 r1689  
     1from django.db.backends.mysql.base import quote_name 
    12from MySQLdb.constants import FIELD_TYPE 
    23 
     
    89def get_table_description(cursor, table_name): 
    910    "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)
    1112    return cursor.description 
    1213 
  • django/branches/magic-removal/django/db/backends/postgresql/introspection.py

    r1632 r1689  
     1from django.db.backends.postgresql.base import quote_name 
     2 
    13def get_table_list(cursor): 
    24    "Returns a list of table names in the current database." 
     
    1214def get_table_description(cursor, table_name): 
    1315    "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)
    1517    return cursor.description 
    1618 
  • django/branches/magic-removal/django/db/backends/sqlite3/introspection.py

    r1632 r1689  
     1from django.db.backends.sqlite3.base import quote_name 
     2 
    13def get_table_list(cursor): 
    24    cursor.execute("SELECT name FROM sqlite_master WHERE type='table' ORDER BY name") 
     
    46 
    57def 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)
    79    return [(row[1], row[2], None, None) for row in cursor.fetchall()] 
    810