Project

General

Profile

« Previous | Next » 

Revision 2720

sql.py: cast(): Made errors table also store SQLSTATE in error_code column

View differences:

sql.py
801 801
        BEGIN
802 802
            -- Insert the value and error for *each* source column.
803 803
            INSERT INTO '''+errors_table.to_str(db)+'''
804
            ("column", value, error)
804
            ("column", value, error_code, error)
805 805
            SELECT *
806 806
            FROM (VALUES '''+(', '.join(('('+c.to_str(db)+')' for c in cols))
807 807
                )+''') AS c
808
            CROSS JOIN (VALUES (value, SQLERRM)) AS v
808
            CROSS JOIN (VALUES (value, SQLSTATE, SQLERRM)) AS v
809 809
            ;
810 810
        EXCEPTION
811 811
            WHEN unique_violation THEN NULL; -- ignore duplicate key

Also available in: Unified diff