Revision 3304
Added by Aaron Marcuse-Kubitza over 12 years ago
lib/db_xml.py | ||
---|---|---|
175 | 175 |
in_table = copy.copy(full_in_table) # don't modify input! |
176 | 176 |
in_table.name = str(in_table) # prepend schema |
177 | 177 |
cur = sql.run_query_into(db, sql.mk_select(db, full_in_table, |
178 |
limit=this_limit, start=start), into=in_table) |
|
178 |
limit=this_limit, start=start), into=in_table, add_pkey_=True)
|
|
179 | 179 |
# full_in_table will be shadowed (hidden) by created temp table |
180 | 180 |
|
181 | 181 |
this_ct = cur.rowcount |
... | ... | |
183 | 183 |
start += this_ct # advance start to fetch next set |
184 | 184 |
if this_ct == 0: break # in_table size is multiple of partition_size |
185 | 185 |
|
186 |
sql.add_pkey(db, in_table) |
|
187 |
|
|
188 | 186 |
# Recurse |
189 | 187 |
pkeys_loc = put_table_(node, in_row_ct_ref) |
190 | 188 |
if in_row_ct_ref != None: in_row_ct_ref[0] += this_ct |
lib/sql_io.py | ||
---|---|---|
299 | 299 |
full_in_table_cols.append(default) |
300 | 300 |
default = sql_gen.with_table(default, full_in_table) |
301 | 301 |
sql.run_query_into(db, sql.mk_select(db, in_table, full_in_table_cols, |
302 |
order_by=None), into=full_in_table) |
|
303 |
sql.add_pkey(db, full_in_table) |
|
302 |
order_by=None), into=full_in_table, add_pkey_=True) |
|
304 | 303 |
|
305 | 304 |
pkeys_names = [in_pkey, out_pkey] |
306 | 305 |
pkeys_cols = [in_pkey_col, out_pkey_col] |
... | ... | |
315 | 314 |
if pkeys_table_exists_ref[0]: |
316 | 315 |
sql.insert_select(db, into, pkeys_names, query, **kw_args) |
317 | 316 |
else: |
318 |
sql.run_query_into(db, query, into=into, **kw_args) |
|
319 |
sql.add_pkey(db, into) |
|
317 |
sql.run_query_into(db, query, into=into, add_pkey_=True, **kw_args) |
|
320 | 318 |
pkeys_table_exists_ref[0] = True |
321 | 319 |
|
322 | 320 |
limit_ref = [None] |
Also available in: Unified diff
sql.run_query_into() calls: Use new add_pkey_ param instead of manually calling sql.add_pkey()