Revision 3433
Added by Aaron Marcuse-Kubitza over 12 years ago
sql_io.py | ||
---|---|---|
255 | 255 |
else: out_pkey = sql.pkey(db, out_table, recover=True) |
256 | 256 |
out_pkey_col = sql_gen.as_Col(out_pkey, out_table) |
257 | 257 |
|
258 |
if mapping == {}: # need at least one column for INSERT SELECT |
|
259 |
mapping = {out_pkey: None} # ColDict will replace with default value |
|
260 |
|
|
261 | 258 |
in_tables_ = in_tables[:] # don't modify input! |
262 | 259 |
try: in_tables0 = in_tables_.pop(0) # first table is separate |
263 | 260 |
except IndexError: in_tables0 = None |
... | ... | |
277 | 274 |
input_joins = [in_tables0]+[sql_gen.Join(v, |
278 | 275 |
{in_pkey: sql_gen.join_same_not_null}) for v in in_tables_] |
279 | 276 |
|
277 |
if mapping == {} and not is_function: # need >= one column for INSERT SELECT |
|
278 |
mapping = {out_pkey: None} # ColDict will replace with default value |
|
279 |
|
|
280 | 280 |
if not is_literals: |
281 | 281 |
if into == None: |
282 | 282 |
into = into_table_name(out_table, in_tables0, mapping, is_func) |
Also available in: Unified diff
sql_io.py: put_table(): Needing >= one column for INSERT SELECT: Fixed bug where can't add pkey column if calling a function instead of outputting to a table