You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrated issue, originally created by Michael Bayer (@zzzeek)
see if we don't need the subquery here:
from sqlalchemy import *
from sqlalchemy.sql import table, column
product = table('product', column('id'), column('other_id'))
b_id = 2
s_id = 3
id = product.c.id
sel = select(
[b_id, product.c.id],
).union(
select([b_id, s_id])
)
ins = insert(product).from_select([
product.c.id, product.c.other_id
],
sel
)
print ins
patch:
index 61abe81..2b4320a 100644
--- a/lib/sqlalchemy/sql/selectable.py
+++ b/lib/sqlalchemy/sql/selectable.py
@@ -42,7 +42,7 @@ def _interpret_as_select(element):
element = _interpret_as_from(element)
if isinstance(element, Alias):
element = element.original
- if not isinstance(element, Select):
+ if not isinstance(element, SelectBase):
element = element.select()
return element
The text was updated successfully, but these errors were encountered:
Fixed bug in INSERT..FROM SELECT construct where selecting from a
UNION would wrap the union in an anonymous (e.g. unlabled) subquery.
fixes INSERT from SELECT UNION #3044
Fixed bug in INSERT..FROM SELECT construct where selecting from a
UNION would wrap the union in an anonymous (e.g. unlabled) subquery.
fixes INSERT from SELECT UNION #3044
Fixed bug in INSERT..FROM SELECT construct where selecting from a
UNION would wrap the union in an anonymous (e.g. unlabled) subquery.
fixes INSERT from SELECT UNION #3044
Migrated issue, originally created by Michael Bayer (@zzzeek)
see if we don't need the subquery here:
patch:
The text was updated successfully, but these errors were encountered: