Revision 5373
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql_io.py | ||
---|---|---|
694 | 694 |
|
695 | 695 |
# Handle unrecoverable errors |
696 | 696 |
if limit_ref[0] == 0: |
697 |
if is_literals or default == None: |
|
698 |
log_debug('Returning default: ' |
|
699 |
+strings.as_tt(strings.urepr(default))) |
|
700 |
return default |
|
701 |
elif is_function: pass # empty pkeys table already created |
|
702 |
else: |
|
703 |
log_debug('Creating an empty output pkeys table') |
|
704 |
has_joins = False # use the no-joins case |
|
705 |
cur = sql.run_query_into(db, sql.mk_select(db, out_table, |
|
706 |
[out_pkey], order_by=None, limit=0), into=insert_out_pkeys) |
|
697 |
log_debug('Returning default: '+strings.as_tt(strings.urepr(default))) |
|
698 |
return default |
|
707 | 699 |
|
708 | 700 |
if cur != None and row_ct_ref != None and cur.rowcount >= 0: |
709 | 701 |
row_ct_ref[0] += cur.rowcount |
Also available in: Unified diff
sql_io.py: put_table(): Ignoring all rows for unrecoverable errors: Even in multi-row mode, just return whatever the default value or column was, instead of creating an output table containing the default value filled in for every row. This also assists the optimization to skip empty levels of taxonconcepts, because it folds the empty level to that level's parent level rather than creating a whole new temp table with ultimately the same contents.