Project

General

Profile

« Previous | Next » 

Revision 2782

sql.py: index_cols(): Use db.esc_value() instead of params

View differences:

lib/sql.py
869 869
        JOIN pg_class table_ ON table_.oid = indrelid
870 870
        JOIN pg_attribute ON attrelid = indrelid AND attnum = ANY (indkey)
871 871
        WHERE
872
            table_.relname = %(table)s
873
            AND index.relname = %(index)s
872
            table_.relname = '''+db.esc_value(table)+'''
873
            AND index.relname = '''+db.esc_value(index)+'''
874 874
    UNION
875 875
        SELECT attnum, attname
876 876
        FROM
......
883 883
            JOIN pg_class index ON index.oid = indexrelid
884 884
            JOIN pg_class table_ ON table_.oid = indrelid
885 885
            WHERE
886
                table_.relname = %(table)s
887
                AND index.relname = %(index)s
886
                table_.relname = '''+db.esc_value(table)+'''
887
                AND index.relname = '''+db.esc_value(index)+'''
888 888
        ) s
889 889
        JOIN pg_attribute ON attrelid = indrelid AND attnum = indkey
890 890
) s
891 891
ORDER BY attnum
892
''',
893
            {'table': table, 'index': index}, cacheable=True, log_level=4)))
892
'''
893
            , cacheable=True, log_level=4)))
894 894
    else: raise NotImplementedError("Can't list index columns for "+module+
895 895
        ' database')
896 896

  

Also available in: Unified diff