shlomi-noach / openarkkit

Automatically exported from code.google.com/p/openarkkit
24 stars 16 forks source link

backticks missing on column names #28

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
columns name in get_table_columns need to be enclosed in backticks

def get_table_columns(read_table_name):
    """
    Return the list of column names (lowercase) for the given table
    """
    query = """
        SELECT COLUMN_NAME
        FROM INFORMATION_SCHEMA.COLUMNS
        WHERE TABLE_SCHEMA='%s'
            AND TABLE_NAME='%s'
        """ % (database_name, read_table_name)
    column_names = set(["`"+row["COLUMN_NAME"].lower()+"`" for row in get_rows(query)])
    return column_names

Original issue reported on code.google.com by jeanchri...@gmail.com on 7 Sep 2012 at 4:40