Project

General

Profile

« Previous | Next » 

Revision 2356

sql.py: put_table(): Missing mapping for NOT NULL column: Just create an empty pkeys table, since the missing rows' pkeys will be set to NULL later

View differences:

lib/sql.py
818 818
            
819 819
            out_col, = e.cols
820 820
            try: in_col = mapping[out_col]
821
            except KeyError: # no mapping for missing col, so every row invalid
822
                db.log_debug('Missing mapping for '+out_col)
823
                run_query_into_pkeys(*mk_select(db, input_joins,
824
                    [in_pkey_col, sql_gen.NamedCol(out_pkey, None)], start=0))
825
                break
821
            except KeyError:
822
                db.log_debug('Missing mapping for NOT NULL '+out_col)
823
                limit = 0 # just create an empty pkeys table
826 824
            else:
827 825
                log_ignore(in_col, 'NULL')
828 826
                conds[in_col] = sql_gen.CompareCond(None, '!=')

Also available in: Unified diff