Revision 2197
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/sql.py | ||
---|---|---|
796 | 796 |
select_joins = insert_joins + [(out_table, join_cols)] |
797 | 797 |
|
798 | 798 |
# Get pkeys of already existing rows |
799 |
run_query_into(db, *mk_select(db, select_joins, pkeys_cols, start=0, |
|
800 |
table_is_esc=table_is_esc), into_ref=pkeys_ref, recover=True) |
|
799 |
run_query_into(db, *mk_select(db, select_joins, pkeys_cols, |
|
800 |
order_by=None, start=0, table_is_esc=table_is_esc), |
|
801 |
into_ref=pkeys_ref, recover=True) |
|
802 |
|
|
803 |
# Save existing pkeys in temp table for joining on |
|
804 |
existing_pkeys_ref = ['existing_pkeys_'+temp_suffix] |
|
805 |
run_query_into(db, *mk_select(db, pkeys_ref[0], [in_pkey], |
|
806 |
order_by=None, start=0, table_is_esc=True), |
|
807 |
into_ref=existing_pkeys_ref) |
|
808 |
# need table_is_esc=True to make table name case-insensitive |
|
801 | 809 |
|
802 | 810 |
return (pkeys_ref[0], out_pkey) |
803 | 811 |
|
Also available in: Unified diff
sql.py: put_table(): Added order_by=None wherever rows were not supposed to be re-ordered. On DuplicateKeyException: Save existing pkeys in temp table for joining on.