Project

General

Profile

« Previous | Next » 

Revision 2351

sql.py: put_table(): Set missing rows' pkeys to NULL

View differences:

lib/sql.py
859 859
                    sql_gen.Join(out_pkeys_ref[0],
860 860
                    {row_num_col: sql_gen.join_using})], pkeys, start=0))
861 861
            
862
            db.log_debug("Setting missing rows' pkeys to NULL")
863
            missing_rows_joins = input_joins+[sql_gen.Join(pkeys_ref[0],
864
                {in_pkey: sql_gen.CompareCond(in_pkey_col, '~=')},
865
                sql_gen.filter_out)] # must use '~=' or query will take forever
866
            run_query_into_pkeys(*mk_select(db, missing_rows_joins,
867
                [in_pkey_col, sql_gen.NamedCol(out_pkey, None)], start=0))
868
            
862 869
            break # insert successful
863 870
    
864 871
    return sql_gen.Col(out_pkey, pkeys_ref[0])

Also available in: Unified diff