Compare commits

...

No commits in common. 'i8c-beta-stream-2.7' and 'c9' have entirely different histories.

2
.gitignore vendored

@ -1 +1 @@
SOURCES/SQLAlchemy-1.3.2.tar.gz SOURCES/SQLAlchemy-1.4.45.tar.gz

@ -1 +1 @@
277e64612df80a1fe9c05a33f69928f5de18f5fb SOURCES/SQLAlchemy-1.3.2.tar.gz eb2f1528723b728dd2ee764fe0d52434f4e9e792 SOURCES/SQLAlchemy-1.4.45.tar.gz

@ -1,115 +0,0 @@
diff --git a/lib/sqlalchemy/sql/util.py b/lib/sqlalchemy/sql/util.py
index 3077840..8719b26 100644
--- a/lib/sqlalchemy/sql/util.py
+++ b/lib/sqlalchemy/sql/util.py
@@ -20,6 +20,7 @@ from .annotation import _shallow_annotate # noqa
from .base import _from_objects
from .base import ColumnSet
from .ddl import sort_tables # noqa
+from .elements import _expand_cloned
from .elements import _find_columns # noqa
from .elements import _label_reference
from .elements import _textual_label_reference
@@ -149,6 +150,16 @@ def find_left_clause_to_join_from(clauses, join_to, onclause):
idx.append(i)
break
+ if len(idx) > 1:
+ # this is the same "hide froms" logic from
+ # Selectable._get_display_froms
+ toremove = set(
+ chain(*[_expand_cloned(f._hide_froms) for f in clauses])
+ )
+ idx = [
+ i for i in idx if clauses[i] not in toremove
+ ]
+
# onclause was given and none of them resolved, so assume
# all indexes can match
if not idx and onclause is not None:
diff --git a/test/orm/test_joins.py b/test/orm/test_joins.py
index bb9747c..4fe04f7 100644
--- a/test/orm/test_joins.py
+++ b/test/orm/test_joins.py
@@ -1559,6 +1559,81 @@ class JoinTest(QueryTest, AssertsCompiledSQL):
"ON dingalings.address_id = addresses_1.id",
)
+ def test_clause_present_in_froms_twice_w_onclause(self):
+ # test [ticket:4584]
+ Order, Address, Dingaling, User = (
+ self.classes.Order,
+ self.classes.Address,
+ self.classes.Dingaling,
+ self.classes.User,
+ )
+
+ sess = create_session()
+
+ a1 = aliased(Address)
+
+ q = sess.query(Order).select_from(Order, a1, User)
+ assert_raises_message(
+ sa.exc.InvalidRequestError,
+ "Can't determine which FROM clause to join from, there are "
+ "multiple FROMS which can join to this entity. "
+ "Try adding an explicit ON clause to help resolve the ambiguity.",
+ q.outerjoin,
+ a1,
+ )
+
+ # the condition which occurs here is: Query._from_obj contains both
+ # "a1" by itself as well as a join that "a1" is part of.
+ # find_left_clause_to_join_from() needs to include removal of froms
+ # that are in the _hide_froms of joins the same way
+ # Selectable._get_display_froms does.
+ q = sess.query(Order).select_from(Order, a1, User)
+ q = q.outerjoin(a1, a1.id == Order.address_id)
+ q = q.outerjoin(User, a1.user_id == User.id)
+
+ self.assert_compile(
+ q,
+ "SELECT orders.id AS orders_id, orders.user_id AS orders_user_id, "
+ "orders.address_id AS orders_address_id, "
+ "orders.description AS orders_description, "
+ "orders.isopen AS orders_isopen "
+ "FROM orders "
+ "LEFT OUTER JOIN addresses AS addresses_1 "
+ "ON addresses_1.id = orders.address_id "
+ "LEFT OUTER JOIN users ON addresses_1.user_id = users.id",
+ )
+
+ def test_clause_present_in_froms_twice_wo_onclause(self):
+ # test [ticket:4584]
+ Order, Address, Dingaling, User = (
+ self.classes.Order,
+ self.classes.Address,
+ self.classes.Dingaling,
+ self.classes.User,
+ )
+
+ sess = create_session()
+
+ a1 = aliased(Address)
+
+ # the condition which occurs here is: Query._from_obj contains both
+ # "a1" by itself as well as a join that "a1" is part of.
+ # find_left_clause_to_join_from() needs to include removal of froms
+ # that are in the _hide_froms of joins the same way
+ # Selectable._get_display_froms does.
+ q = sess.query(User).select_from(Dingaling, a1, User)
+ q = q.outerjoin(a1, User.id == a1.user_id)
+ q = q.outerjoin(Dingaling)
+
+ self.assert_compile(
+ q,
+ "SELECT users.id AS users_id, users.name AS users_name "
+ "FROM users LEFT OUTER JOIN addresses AS addresses_1 "
+ "ON users.id = addresses_1.user_id "
+ "LEFT OUTER JOIN dingalings "
+ "ON addresses_1.id = dingalings.address_id",
+ )
+
def test_multiple_adaption(self):
Item, Order, User = (
self.classes.Item,

@ -1,56 +1,40 @@
%global debug_package %{nil} # when bootstrapping Python, pytest-xdist is not yet available (also not yet in EPEL9)
%if ! 0%{?rhel} || 0%{?rhel} > 9
%if 0%{?fedora} || 0%{?rhel} > 7 %bcond_without xdist
%bcond_without python3 %else
%bcond_with xdist
%endif %endif
# python2X and python3X are built form the same module, so we need a conditional for python2 bits
# the state of the conditional is not important in the spec, it is set in modulemd
%bcond_with python2
%bcond_with python36_module
%global srcname SQLAlchemy %global srcname SQLAlchemy
%global python_pkg_extras \
asyncio \
mssql_pyodbc \
postgresql \
pymysql
Name: python-sqlalchemy Name: python-sqlalchemy
Version: 1.3.2 Version: 1.4.45
Release: 2%{?dist} # cope with pre-release versions containing tildes
Summary: Modular and flexible ORM library for python %global srcversion %{lua: srcversion, num = rpm.expand("%{version}"):gsub("~", ""); print(srcversion);}
Release: 3%{?dist}
Summary: Modular and flexible ORM library for Python
Group: Development/Libraries
License: MIT License: MIT
URL: http://www.sqlalchemy.org/ URL: https://www.sqlalchemy.org/
Source0: https://files.pythonhosted.org/packages/source/S/%{srcname}/%{srcname}-%{version}.tar.gz Source0: %{pypi_source %{srcname} %{srcversion}}
# Fold entities into existing joins when resolving FROM ambiguity.
# This regression was introduced with the 1.3 sqlalchemy series.
# Fixed upstream: https://github.com/sqlalchemy/sqlalchemy/commit/25a42e93f4ef5ce1a9f9c23fbcdea3e21a7b3f1a
# Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1829932
Patch0: fix-regression-in-ambiguous-join-logic.patch
BuildRequires: gcc BuildRequires: gcc
BuildRequires: python3-devel >= 3.6
%if %{with python2} BuildRequires: python3-greenlet >= 1.0
BuildRequires: python2-devel >= 2.6
BuildRequires: python2-setuptools
BuildRequires: python2-mock
BuildRequires: python2-pytest
%endif
%if %{with python3}
%if %{with python36_module}
BuildRequires: python36-devel
BuildRequires: python36-rpm-macros
%else
BuildRequires: python3-devel
%endif
BuildRequires: python3-setuptools BuildRequires: python3-setuptools
BuildRequires: python3-pytest BuildRequires: python3-pytest
%if %{with xdist}
BuildRequires: python3-pytest-xdist
%endif %endif
%description %description
SQLAlchemy is an Object Relational Mappper (ORM) that provides a flexible, SQLAlchemy is an Object Relational Mapper (ORM) that provides a flexible,
high-level interface to SQL databases. Database and domain concepts are high-level interface to SQL databases. Database and domain concepts are
decoupled, allowing both sides maximum flexibility and power. SQLAlchemy decoupled, allowing both sides maximum flexibility and power. SQLAlchemy
provides a powerful mapping layer that can work as automatically or as manually provides a powerful mapping layer that can work as automatically or as manually
@ -58,23 +42,11 @@ as you choose, determining relationships based on foreign keys or letting you
define the join conditions explicitly, to bridge the gap between database and define the join conditions explicitly, to bridge the gap between database and
domain. domain.
This package includes the python 2 version of the module. %package -n python3-sqlalchemy
Summary: %{summary}
%package doc
Summary: Documentation for SQLAlchemy
BuildArch: noarch
%description doc
Documentation for SQLAlchemy
%if %{with python2}
%package -n python2-sqlalchemy
Summary: Modular and flexible ORM library for python
Group: Development/Libraries
%{?python_provide:%python_provide python2-sqlalchemy}
%description -n python2-sqlalchemy %description -n python3-sqlalchemy
SQLAlchemy is an Object Relational Mappper (ORM) that provides a flexible, SQLAlchemy is an Object Relational Mapper (ORM) that provides a flexible,
high-level interface to SQL databases. Database and domain concepts are high-level interface to SQL databases. Database and domain concepts are
decoupled, allowing both sides maximum flexibility and power. SQLAlchemy decoupled, allowing both sides maximum flexibility and power. SQLAlchemy
provides a powerful mapping layer that can work as automatically or as manually provides a powerful mapping layer that can work as automatically or as manually
@ -82,94 +54,240 @@ as you choose, determining relationships based on foreign keys or letting you
define the join conditions explicitly, to bridge the gap between database and define the join conditions explicitly, to bridge the gap between database and
domain. domain.
This package includes the python 2 version of the module. # Subpackages to ensure dependencies enabling extra functionality
%endif %{?python_extras_subpkg:%python_extras_subpkg -n python3-sqlalchemy -i %{python3_sitearch}/*.egg-info %python_pkg_extras}
%if %{with python3} %package doc
%package -n python3-sqlalchemy Summary: Documentation for SQLAlchemy
Summary: Modular and flexible ORM library for python BuildArch: noarch
Group: Development/Libraries
%{?python_provide:%python_provide python%{python3_pkgversion}-sqlalchemy}
%description -n python3-sqlalchemy %description doc
SQLAlchemy is an Object Relational Mappper (ORM) that provides a flexible, Documentation for SQLAlchemy.
high-level interface to SQL databases. Database and domain concepts are
decoupled, allowing both sides maximum flexibility and power. SQLAlchemy
provides a powerful mapping layer that can work as automatically or as manually
as you choose, determining relationships based on foreign keys or letting you
define the join conditions explicitly, to bridge the gap between database and
domain.
This package includes the python 3 version of the module.
%endif # with python3
%prep %prep
%setup -n %{srcname}-%{version} %setup -q -n %{srcname}-%{srcversion}
%patch0 -p1
%build %build
%{?with_python2:%py2_build}
%if %{with python3}
%py3_build %py3_build
%endif
%install %install
%{?with_python2:%py2_install}
%if %{with python3}
%py3_install %py3_install
%endif
# remove unnecessary scripts for building documentation # remove unnecessary scripts for building documentation
rm -rf doc/build rm -rf doc/build
%check %check
%{?with_python2:PYTHONPATH=. %{__python2} -m pytest test} %pytest test \
%if %{with xdist}
%if %{with python3} --numprocesses=auto
PYTHONPATH=. %{__python3} -m pytest test
%endif %endif
%files doc %files doc
%doc doc examples %doc doc examples
%if %{with python2}
%files -n python2-sqlalchemy
%license LICENSE
%doc README.rst
%{python2_sitearch}/*
%endif
%if %{with python3}
%files -n python3-sqlalchemy %files -n python3-sqlalchemy
%license LICENSE %license LICENSE
%doc README.rst %doc README.rst
%{python3_sitearch}/* %{python3_sitearch}/SQLAlchemy-*.egg-info/
%endif # with python3 %{python3_sitearch}/sqlalchemy/
%changelog %changelog
* Wed Apr 03 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 1.3.2-2 * Tue Dec 13 2022 Sergio Correia <scorreia@redhat.com> - 1.4.45-3
- Rebuilt for MSVSphere 8.10 beta - Update to current version - 1.4.45
Resolves: rhbz#2152649
* Sat Jun 18 2022 Sergio Correia <scorreia@redhat.com> - 1.4.37-3
- Remove obsolete cruft from the specfile, follow the packaging guidelines
- Remove also extra packages we have no runtime dependencies for
Related: rhbz#2084556
* Fri Jun 17 2022 Sergio Correia <scorreia@redhat.com> - 1.4.37-2
- Add python-sqlalchemy to RHEL-9
Resolves: rhbz#2084556
* Wed Jun 01 2022 Nils Philippsen <nils@tiptoe.de> - 1.4.37-1
- version 1.4.37
* Wed Apr 27 2022 Nils Philippsen <nils@tiptoe.de> - 1.4.36-1
- version 1.4.36
* Thu Apr 07 2022 Nils Philippsen <nils@tiptoe.de> - 1.4.35-1
- version 1.4.35
* Fri Apr 01 2022 Nils Philippsen <nils@tiptoe.de> - 1.4.34-1
- version 1.4.34
* Fri May 15 2020 Charalampos Stratakis <cstratak@redhat.com> - 1.3.2-2 * Tue Mar 08 2022 Nils Philippsen <nils@tiptoe.de> - 1.4.32-1
- Fix regression in ambiguous join logic - version 1.4.32
Resolves: rhbz#1829932 - don't BR: python3-pytest-xdist on EL9
- remove obsolete (no-op) tweak of setup.cfg
* Fri Apr 05 2019 Charalampos Stratakis <cstratak@redhat.com> - 1.3.2-1 * Fri Jan 21 2022 Nils Philippsen <nils@tiptoe.de> - 1.4.31-1
- Rebase to 1.3.2 to fix CVE-2019-7164 and CVE-2019-7548 - version 1.4.31
Resolves: rhbz#1695754
* Tue Jul 31 2018 Lumír Balhar <lbalhar@redhat.com> - 1.2.8-6 * Thu Dec 23 2021 Nils Philippsen <nils@tiptoe.de> - 1.4.29-1
- Switch python3 coditions to bcond - version 1.4.29
* Wed Jul 18 2018 Tomas Orsava <torsava@redhat.com> - 1.2.8-5 * Wed Dec 15 2021 Nils Philippsen <nils@tiptoe.de> - 1.4.28-1
- BuildRequire also python36-rpm-macros as part of the python36 module build - version 1.4.28
- remove build dependency on python3-mock
* Wed Jul 04 2018 Miro Hrončok <mhroncok@redhat.com> - 1.2.8-4 * Fri Nov 12 2021 Nils Philippsen <nils@tiptoe.de> - 1.4.27-1
- Add a bcond for python2 - version 1.4.27
- Remove provides filter, it was only needed 100 years ago
* Tue Oct 26 2021 Joel Capitao <jcapitao@redhat.com> - 1.4.26-1
- Update to 1.4.26. Fixes rhbz#2015705
* Sun Sep 26 2021 Kevin Fenzi <kevin@scrye.com> - 1.4.25-1
- Update to 1.4.25. Fixes rhbz#1995262
* Wed Aug 25 2021 Nils Philippsen <nils@tiptoe.de> - 1.4.23-1
- version 1.4.23
* Sun Aug 08 2021 Kevin Fenzi <kevin@scrye.com> - 1.4.22-1
- Update to 1.4.22. Fixes rhbz#1975029
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.18-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Sun Jun 13 2021 Nils Philippsen <nils@tiptoe.de> - 1.4.18-1
- version 1.4.18
* Thu Jun 03 2021 Python Maint <python-maint@redhat.com> - 1.4.15-2
- Rebuilt for Python 3.10
* Fri May 14 2021 Nils Philippsen <nils@tiptoe.de> - 1.4.15-1
- version 1.4.15
* Mon May 10 2021 Nils Philippsen <nils@tiptoe.de> - 1.4.14-1
- version 1.4.14
- drop Python 2.x support
- define extras subpackages
* Fri Apr 30 2021 Tomas Hrnciar <thrnciar@redhat.com> - 1.3.22-3
- Disabled failing test test_pyodbc_extra_connect_azure
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.22-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Dec 21 2020 Nils Philippsen <nils@tiptoe.de> - 1.3.22-1
- version 1.3.22
* Sun Nov 01 2020 Nils Philippsen <nils@tiptoe.de> - 1.3.20-1
- version 1.3.20
* Tue Aug 18 2020 Nils Philippsen <nils@tiptoe.de> - 1.3.19-1
- version 1.3.19
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.18-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri Jul 10 2020 Nils Philippsen <nils@tiptoe.de> - 1.3.18-1
- version 1.3.18
* Sun May 24 2020 Miro Hrončok <mhroncok@redhat.com> - 1.3.17-3
- Rebuilt for Python 3.9
* Fri May 22 2020 Miro Hrončok <mhroncok@redhat.com> - 1.3.17-2
- Bootstrap for Python 3.9
* Sat May 16 2020 Nils Philippsen <nils@tiptoe.de> - 1.3.17-1
- version 1.3.17
* Thu Mar 26 2020 Nils Philippsen <nils@tiptoe.de> - 1.3.15-1
- version 1.3.15
- quieten %%setup
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.13-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Sun Jan 26 2020 Nils Philippsen <nils@tiptoe.de> - 1.3.13-1
- version 1.3.13
* Wed Dec 18 2019 Nils Philippsen <nils@tiptoe.de> - 1.3.12-1
- version 1.3.12
* Tue Nov 19 2019 Randy Barlow <bowlofeggs@fedoraproject.org> - 1.3.11-1
- Update to 1.3.11 (#1771196).
- https://docs.sqlalchemy.org/en/13/changelog/changelog_13.html#change-1.3.11
* Wed Nov 13 2019 Nils Philippsen <nils@tiptoe.de> - 1.3.10-2
- drop python2-sqlalchemy from F32 on
* Fri Oct 18 2019 Nils Philippsen <nils@tiptoe.de> - 1.3.10-1
- fix/skip tests that are broken on SQLite 3.30
* Wed Oct 16 2019 Nils Philippsen <nils@tiptoe.de> - 1.3.10-1
- version 1.3.10
* Tue Sep 17 2019 Randy Barlow <bowlofeggs@fedoraproject.org> - 1.3.8-1
- Update to 1.3.8 (#1747080).
- https://docs.sqlalchemy.org/en/13/changelog/changelog_13.html#change-1.3.8
* Sun Aug 25 2019 Nils Philippsen <nils@tiptoe.de> - 1.3.7-1
- version 1.3.7
- require python3-mock for building
* Thu Aug 15 2019 Miro Hrončok <mhroncok@redhat.com> - 1.3.6-2
- Rebuilt for Python 3.8
* Sat Jul 27 2019 Nils Philippsen <nils@tiptoe.de> - 1.3.6-1
- version 1.3.6
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Mon Jul 22 2019 Petr Viktorin <pviktori@redhat.com> - 1.3.5-2
- Remove dependency on python2-xdist
- Enable multi-process testing using python3-xdist
* Tue Jun 18 2019 Randy Barlow <bowlofeggs@fedoraproject.org> - 1.3.5-1
- Update to 1.3.5 (#1721271).
- https://docs.sqlalchemy.org/en/13/changelog/changelog_13.html#change-1.3.5
* Mon Jun 03 2019 Nils Philippsen <nils@tiptoe.de> - 1.3.4-1
- version 1.3.4
* Thu Apr 18 2019 Nils Philippsen <nils@tiptoe.de> - 1.3.3-1
- version 1.3.3
* Wed Apr 10 2019 Nils Philippsen <nils@tiptoe.de> - 1.3.2-1
- version 1.3.2
* Wed Mar 13 2019 Nils Philippsen <nils@tiptoe.de> - 1.3.1-1
- version 1.3.1
* Tue Mar 05 2019 Nils Philippsen <nils@tiptoe.de> - 1.3.0-1
- version 1.3.0
* Fri Mar 01 2019 Nils Philippsen <nils@tiptoe.de> - 1.3.0~b3-1
- version 1.3.0b3
* Wed Feb 20 2019 Nils Philippsen <nils@tiptoe.de> - 1.2.18-1
- version 1.2.18
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.17-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Jan 30 2019 Nils Philippsen <nils@tiptoe.de> - 1.2.17-1
- version 1.2.17
* Sat Jan 12 2019 Nils Philippsen <nils@tiptoe.de> - 1.2.16-1
- version 1.2.16
* Tue Oct 30 2018 Nils Philippsen <nils@tiptoe.de> - 1.2.12-1
- version 1.2.12
* Tue Aug 21 2018 Nils Philippsen <nils@tiptoe.de> - 1.2.11-1
- version 1.2.11
* Sun Jul 22 2018 Nils Philippsen <nils@tiptoe.de> - 1.2.10-1
- version 1.2.10
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.2.8-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Sun Jun 17 2018 Nils Philippsen <nils@tiptoe.de> - 1.2.8-3 * Sun Jun 17 2018 Nils Philippsen <nils@tiptoe.de> - 1.2.8-3
- rename patch, apply with backups - rename patch, apply with backups
@ -181,9 +299,6 @@ Resolves: rhbz#1695754
* Tue Jun 05 2018 Nils Philippsen <nils@tiptoe.de> - 1.2.8-1 * Tue Jun 05 2018 Nils Philippsen <nils@tiptoe.de> - 1.2.8-1
- version 1.2.8 - version 1.2.8
* Mon Apr 30 2018 Tomas Orsava <torsava@redhat.com> - 1.2.7-2
- Require the python36-devel package when building for the python36 module
* Sun Apr 22 2018 Nils Philippsen <nils@tiptoe.de> - 1.2.7-1 * Sun Apr 22 2018 Nils Philippsen <nils@tiptoe.de> - 1.2.7-1
- version 1.2.7 - version 1.2.7

Loading…
Cancel
Save