]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/log
thirdparty/sqlalchemy/sqlalchemy.git
15 months agoensure intermediary mappers emit subclass IN
Mike Bayer [Sat, 27 Apr 2024 04:31:07 +0000 (00:31 -0400)] 
ensure intermediary mappers emit subclass IN

Fixed issue in :func:`_orm.selectin_polymorhpic` loader option where the
SELECT emitted would only accommodate for the child-most class among the
result rows that were returned, leading intermediary-class attributes to be
unloaded if there were no concrete instances of that intermediary-class
present in the result.   This issue only presented itself for multi-level
inheritance hierarchies.

Fixes: #11327
Change-Id: Iec88cc517613d031221a1c035c4cfb46db0154be
(cherry picked from commit 37c598a41efd2609622b1ca6ee698dbe0ab5ac8b)

15 months agoFixing ci errors
Federico Caselli [Sat, 27 Apr 2024 08:48:47 +0000 (10:48 +0200)] 
Fixing ci errors

Change-Id: Ia1e3a8748a36dd3fa013707eae5ee4f97013d71b
(cherry picked from commit d85289b35ee6c2683eef378f1ea2fdea7f401ed9)

15 months agoMerge "consider propagate_to_loaders at application time" into rel_2_0
Michael Bayer [Sat, 27 Apr 2024 04:33:52 +0000 (04:33 +0000)] 
Merge "consider propagate_to_loaders at application time" into rel_2_0

15 months agoMerge "Add missing overload to __add__" into rel_2_0
Federico Caselli [Fri, 26 Apr 2024 20:35:15 +0000 (20:35 +0000)] 
Merge "Add missing overload to __add__" into rel_2_0

15 months agoFix typo in sqlalchemy.event.api (#11325)
Felix Zenk [Fri, 26 Apr 2024 19:25:19 +0000 (21:25 +0200)] 
Fix typo in sqlalchemy.event.api (#11325)

(cherry picked from commit f0ed44e89ea83dc2f994105dcd0c471bcb54d608)

15 months agoAdd missing overload to __add__
Yossi Rozantsev [Wed, 24 Apr 2024 20:15:30 +0000 (16:15 -0400)] 
Add missing overload to __add__

Add a missing `@overload` to the `__add__` operator.

### Description
The `__add__` function is missing an overload that handles the rest of the cases, similar to the one that `__sub__` has a few lines later in the same file.

This fix is taken from https://github.com/microsoft/pyright/issues/7743

### Checklist
This pull request is:

- [x] A documentation / typographical / small typing error fix
- Good to go, no issue or tests are needed
- [ ] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #11307
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11307
Pull-request-sha: 961d87403a5f985fbd17e07bae490e8e97475158

Change-Id: I27784f79e8d4f8b7f09b17060186916c78cba0a3
(cherry picked from commit 18b5b8a5b4d40b8ed8695a4027cedaaafa04cff4)

15 months agoMerge "Fix typing to support mypy 1.10" into rel_2_0
Federico Caselli [Thu, 25 Apr 2024 19:42:53 +0000 (19:42 +0000)] 
Merge "Fix typing to support mypy 1.10" into rel_2_0

15 months agoAdd Databricks to external dialect list
Gord Thompson [Thu, 25 Apr 2024 15:14:53 +0000 (09:14 -0600)] 
Add Databricks to external dialect list

Change-Id: I155e274c6baaeb044f7fda76ba74a63ab9e8e4e3
(cherry picked from commit d1cda3482aeb4b7edbcd564dc3523b974848a02c)

15 months agoFix typing to support mypy 1.10
Federico Caselli [Wed, 24 Apr 2024 20:30:21 +0000 (22:30 +0200)] 
Fix typing to support mypy 1.10

Change-Id: I77c0a04331a99c7be77c174721431a5601475dc3
(cherry picked from commit 859dda8f0b2874fcf7f080d15411336047b89a64)

15 months agoAdd Databend and Greenplum dialects (#11248)
Pat Buxton [Wed, 24 Apr 2024 20:48:02 +0000 (21:48 +0100)] 
Add Databend and Greenplum dialects (#11248)

(cherry picked from commit 7adc7404acc691698e30c362a8ec03af2bd426fd)

15 months agoChanged some `declared_attr` code examples in the docs to return `mapped_column`...
gmanny [Wed, 24 Apr 2024 20:41:34 +0000 (22:41 +0200)] 
Changed some `declared_attr` code examples in the docs to return `mapped_column` to indicate that it's possible. (#11302)

(cherry picked from commit 81c2503173fc674baa579a355e63e020969618af)

15 months agoconsider propagate_to_loaders at application time
Mike Bayer [Thu, 18 Apr 2024 22:17:21 +0000 (18:17 -0400)] 
consider propagate_to_loaders at application time

Fixed regression from 1.4 where using :func:`_orm.defaultload` in
conjunction with a non-propagating loader like :func:`_orm.contains_eager`
would nonetheless propagate the :func:`_orm.contains_eager` to a lazy load
operation, causing incorrect queries as this option is only intended to
come from an original load.

Fixes: #11292
Change-Id: I79928afa108970b523f2166c3190f7952eca73ed
(cherry picked from commit 80399cefa1b16a8548ba0c997a1eda94b8e9db01)

15 months agoImprove docs formatting on automap, fix missing import
Federico Caselli [Wed, 17 Apr 2024 20:17:25 +0000 (22:17 +0200)] 
Improve docs formatting on automap, fix missing import

Fixes: #11273
Change-Id: I872dcc0c2cf5093034e1590533b2e0d26602df7f
References: #11267
(cherry picked from commit 82803016b5fcbc3225af87a43768dbea2be87582)

15 months agoFix missing pythonpath in test that use subprocess
Federico Caselli [Mon, 15 Apr 2024 19:52:38 +0000 (21:52 +0200)] 
Fix missing pythonpath in test that use subprocess

Ensure the ``PYTHONPATH`` variable is properly initialized when
using ``subprocess.run`` in the tests.

Fixes: #11268
Change-Id: Ie2db656364931b3be9033dcaaf7a7c56b383ecca
(cherry picked from commit b5cf61c504e6ff7cdceeb0ca376eb47a97b9da5a)

15 months agoMerge "typing: annotate Exists.select() to return Select[bool]" into rel_2_0
Michael Bayer [Fri, 12 Apr 2024 15:49:23 +0000 (15:49 +0000)] 
Merge "typing: annotate Exists.select() to return Select[bool]" into rel_2_0

15 months agoDocument how to configure the cursor_factory on psycopg
Federico Caselli [Thu, 11 Apr 2024 19:24:54 +0000 (21:24 +0200)] 
Document how to configure the cursor_factory on psycopg

Change-Id: I117a0600c31dde721c99891caaa43937458e78d9
Refereinces: #8978
(cherry picked from commit 497c4a2c22be2e5c2319acf56e11d3037a552064)

15 months agoMerge "Fix typing issue in `MetaData.reflect()` with asyncio." into rel_2_0
Federico Caselli [Wed, 10 Apr 2024 20:42:14 +0000 (20:42 +0000)] 
Merge "Fix typing issue in `MetaData.reflect()` with asyncio." into rel_2_0

15 months agoMerge "Highlite composide mode that's more type checker friently" into rel_2_0
Federico Caselli [Wed, 10 Apr 2024 19:03:50 +0000 (19:03 +0000)] 
Merge "Highlite composide mode that's more type checker friently" into rel_2_0

15 months agoFix typing issue in `MetaData.reflect()` with asyncio.
Francisco Del Roio [Fri, 5 Apr 2024 16:05:51 +0000 (12:05 -0400)] 
Fix typing issue in `MetaData.reflect()` with asyncio.

Fixed typing regression caused by PR :ticket:`11055` in version 2.0.29 that
attempted to add ``ParamSpec`` to the asyncio ``run_sync()`` methods, where
using :meth:`_asyncio.AsyncConnection.run_sync` with
meth:`_schema.MetaData.reflect` would fail on mypy due to a bug.
See https://github.com/python/mypy/issues/17093 for details.
Pull request courtesy of Francisco R. Del Roio

Fixes: #11200
Closes: #11201
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11201
Pull-request-sha: 49e10e0d2a7bbadf471212033e25b7616b99c092

Change-Id: Ie2ebaebd1bc1ee1b865b78561cb6cb8937e85eca
(cherry picked from commit 40fc02d93f3f8b4d9ae2f7bf987f5f965a761dd4)

15 months agoimprove distinct() docs
Mike Bayer [Wed, 10 Apr 2024 14:28:28 +0000 (10:28 -0400)] 
improve distinct() docs

differentiate more clearly between distinct() and select().distinct().

Change-Id: Id5eae749393e5898ae501b2462ec4c2c54262e2f
(cherry picked from commit da639af16f77118bc17bbf5cf78fe41dd1818168)

15 months agoUpdate links from initd.org to psycopg.org (#11244)
Stefan Wojcik [Mon, 8 Apr 2024 19:23:19 +0000 (15:23 -0400)] 
Update links from initd.org to psycopg.org (#11244)

(cherry picked from commit ac7d70dea89dfaf8e061bc8dd03a1ed7825069fc)

16 months agoHighlite composide mode that's more type checker friently
Federico Caselli [Thu, 4 Apr 2024 18:56:39 +0000 (20:56 +0200)] 
Highlite composide mode that's more type checker friently

Change-Id: I9c7d79f31ab5e7a7f63aca4ba42c93f346acdefe
References: #11232
(cherry picked from commit 585a582db0c3a3271659bd48e13abe42eb67ac13)

16 months agotyping: annotate Exists.select() to return Select[bool]
wouter bolsterlee [Thu, 4 Apr 2024 18:15:07 +0000 (14:15 -0400)] 
typing: annotate Exists.select() to return Select[bool]

Fixes: #11231
A query of the form:

``` sql
SELECT EXISTS (
    SELECT 1
    FROM ...
    WHERE ...
)
```

… returns a boolean.

Closes: #11233
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11233
Pull-request-sha: 1bec1cac731eb42e097948f84ae3d0ef133f8a9a

Change-Id: I407a3bd9ed21a180c6c3ff02250aa0a9fbe502d7
(cherry picked from commit ceb9e021cd5df3aa7f3beed2c9564d5f182bf8b6)

16 months agoset up is_from_statement and others for FromStatement
Mike Bayer [Mon, 1 Apr 2024 21:54:22 +0000 (17:54 -0400)] 
set up is_from_statement and others for FromStatement

Added new attribute :attr:`_orm.ORMExecuteState.is_from_statement`, to
detect statements of the form ``select().from_statement()``, and also
enhanced ``FromStatement`` to set :attr:`_orm.ORMExecuteState.is_select`,
:attr:`_orm.ORMExecuteState.is_insert`,
:attr:`_orm.ORMExecuteState.is_update`, and
:attr:`_orm.ORMExecuteState.is_delete` according to the element that is
sent to the :meth:`_sql.Select.from_statement` method itself.

Fixes: #11220
Change-Id: I3bf9e7e22fa2955d772b3b6ad636ed93a60916ae
(cherry picked from commit d3222a31b8df97a454b37a32881dd484a06e5742)

16 months agonew flake8-builtins adds a code we dont want
Mike Bayer [Mon, 1 Apr 2024 23:28:01 +0000 (19:28 -0400)] 
new flake8-builtins adds a code we dont want

A005 "he module is shadowing a Python builtin module "

Change-Id: I9c7464e8f0c32df76d4c455e502b8bc7f94aa038
(cherry picked from commit c3f8bd1c27fd5e376e88533542aa6fd669c58067)

16 months agouse a full ConnectionCharacteristic for logging_token
Mike Bayer [Thu, 28 Mar 2024 13:59:44 +0000 (09:59 -0400)] 
use a full ConnectionCharacteristic for logging_token

Fixed issue in the
:paramref:`_engine.Connection.execution_options.logging_token` option,
where changing the value of ``logging_token`` on a connection that has
already logged messages would not be updated to reflect the new logging
token.  This in particular prevented the use of
:meth:`_orm.Session.connection` to change the option on the connection,
since the BEGIN logging message would already have been emitted.

Fixes: #11210
Change-Id: I0ddade3778215259a6eacde3a67e09d30bc3257b
(cherry picked from commit a124a593c86325389a92903d2b61f40c34f6d6e2)

16 months agoremove restore_asyncio hack
Mike Bayer [Sun, 24 Mar 2024 15:43:33 +0000 (11:43 -0400)] 
remove restore_asyncio hack

we have backported the asnycio.Runner from 2.1 so we dont
need this hack anymore; it fails if greenlet is not installed

Change-Id: I9e2ce09f9987ba5a4a78881475d85b9fa24e5bb4

16 months agoVersion 2.0.30 placeholder
Mike Bayer [Sat, 23 Mar 2024 21:53:46 +0000 (17:53 -0400)] 
Version 2.0.30 placeholder

16 months ago- 2.0.29 rel_2_0_29
Mike Bayer [Sat, 23 Mar 2024 21:46:25 +0000 (17:46 -0400)] 
- 2.0.29

16 months agotyping fix
Mike Bayer [Sat, 23 Mar 2024 20:59:40 +0000 (16:59 -0400)] 
typing fix

the most recent greenlet/asyncio commit introduced a typing error
that only comes up under python3.10 due to the non-presence of
asyncio.Runner in that version.  do an intricate dance here along with
another python-version-specific thing observed around the greenlet
import.

Change-Id: I1b220ab8ea633cdf43ad7e8abe826f758858b62a

16 months agouse asyncio.Runner for tests
Mike Bayer [Sat, 23 Mar 2024 17:02:46 +0000 (13:02 -0400)] 
use asyncio.Runner for tests

Backported to SQLAlchemy 2.0 an improvement to the test suite with regards
to how asyncio related tests are run, now using the newer Python 3.11
``asyncio.Runner`` or a backported equivalent, rather than relying on the
previous implementation based on ``asyncio.get_running_loop()``.  This
should hopefully prevent issues with large suite runs on CPU loaded
hardware where the event loop seems to become corrupted, leading to
cascading failures.

Fixes: #11187
Change-Id: I867b2478b9ba3a152fbfef380650eb987527ba46

16 months agochangelog fixes
Mike Bayer [Sat, 23 Mar 2024 14:55:55 +0000 (10:55 -0400)] 
changelog fixes

Change-Id: I1e1b752660d2186647c15f2b19e8eece720f29cb
(cherry picked from commit 438f09c82a295343e4211df7a31582e829ecde35)

16 months agoMerge "Add pg DOMAIN type reflection" into rel_2_0
Michael Bayer [Sat, 23 Mar 2024 05:20:55 +0000 (05:20 +0000)] 
Merge "Add pg DOMAIN type reflection" into rel_2_0

16 months agoMerge "subqueryload invokes compile() on _OverrideBinds - do robust replace of bp...
Michael Bayer [Fri, 22 Mar 2024 14:34:10 +0000 (14:34 +0000)] 
Merge "subqueryload invokes compile() on _OverrideBinds - do robust replace of bp" into rel_2_0

16 months agoMerge "use a private return class for the "catch all" relationship" into rel_2_0
Michael Bayer [Fri, 22 Mar 2024 13:30:52 +0000 (13:30 +0000)] 
Merge "use a private return class for the "catch all" relationship" into rel_2_0

16 months agoAdd pg DOMAIN type reflection
Thomas Stephenson [Wed, 21 Feb 2024 20:17:01 +0000 (15:17 -0500)] 
Add pg DOMAIN type reflection

The PostgreSQL dialect now returns :class:`_postgresql.DOMAIN` instances
when reflecting a column that has a domain as type.
Previously the domain data type was returned instead.
As part of this change, the domain reflection was improved to also
return the collation of the text types.

Fixes: #10693
Closes: #10729
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10729
Pull-request-sha: adac164d191138265ecd64a28be91254a53a9c25

Change-Id: I8730840de2e7e9649067191430eefa086bcf5e7b
(cherry picked from commit 0b6a54811d9cf4943ba2ae4b5a0eaa718b1e848e)

16 months agoMerge "assign variant mapping on adapt()" into rel_2_0
Michael Bayer [Fri, 22 Mar 2024 13:23:25 +0000 (13:23 +0000)] 
Merge "assign variant mapping on adapt()" into rel_2_0

16 months agoMerge "A scalar subquery that returns bool is now correctly typed" into rel_2_0
Michael Bayer [Fri, 22 Mar 2024 13:22:49 +0000 (13:22 +0000)] 
Merge "A scalar subquery that returns bool is now correctly typed" into rel_2_0

16 months agosubqueryload invokes compile() on _OverrideBinds - do robust replace of bp
Mike Bayer [Tue, 19 Mar 2024 17:35:35 +0000 (13:35 -0400)] 
subqueryload invokes compile() on _OverrideBinds - do robust replace of bp

Fixed regression from version 2.0.28 caused by the fix for :ticket:`11085`
where the newer method of adjusting post-cache bound parameter values would
interefere with the implementation for the :func:`_orm.subqueryload` loader
option, which has some more legacy patterns in use internally, when
the additional loader criteria feature were used with this loader option.

Fixes: #11173
Change-Id: I88982fbcc809d516eb7c46a00fb807aab9c3a98e
(cherry picked from commit b6f63a57ed878c1e157ecf86cb35d8b15cd7ea3b)

16 months agoensure ARRAY.__init__ documents before Comparator
Mike Bayer [Thu, 21 Mar 2024 06:13:22 +0000 (02:13 -0400)] 
ensure ARRAY.__init__ documents before Comparator

also add note for zero_indexes to generic and PG ARRAY
types

References: https://github.com/sqlalchemy/sqlalchemy/discussions/11100
Change-Id: I2087da695787a930f325cfb2fa4156d19c8e8f31
(cherry picked from commit 7c70ab8c6b7b9ce1c566862c4ca0438e0b0e9131)

16 months agoA scalar subquery that returns bool is now correctly typed
Federico Caselli [Wed, 20 Mar 2024 21:18:35 +0000 (22:18 +0100)] 
A scalar subquery that returns bool is now correctly typed

Fixes: #10937
Change-Id: Iba4986be14fefd4210b727ddb7ae7e9291ab7f7f
(cherry picked from commit bf7289f9d4218275d32ce7cfcb24a8da3475d95d)

16 months agouse a private return class for the "catch all" relationship
Mike Bayer [Thu, 9 Nov 2023 15:27:19 +0000 (10:27 -0500)] 
use a private return class for the "catch all" relationship

Fixed Declarative issue where typing a relationship using
:class:`_orm.Relationship` rather than :class:`_orm.Mapped` would
inadvertently pull in the "dynamic" relationship loader strategy for that
attribute.

Fixes: #10611
Change-Id: Ie4421050b583827fdf96c27ae9d7fe7ca596e77e
(cherry picked from commit 7cfb940b1a9392f6e3784aff8f487c37ebcd588b)

16 months agoassign variant mapping on adapt()
Mike Bayer [Wed, 20 Mar 2024 14:23:41 +0000 (10:23 -0400)] 
assign variant mapping on adapt()

Fixed regression from the 1.4 series where the refactor of the
:meth:`_types.TypeEngine.with_variant` method introduced at
:ref:`change_6980` failed to accommodate for the ``.copy()`` method, which
will lose the variant mappings that are set up. This becomes an issue for
the very specific case of a "schema" type, which includes types such as
:class:`.Enum` and :class:`.ARRAY`, when they are then used in the context
of an ORM Declarative mapping with mixins where copying of types comes into
play.  The variant mapping is now copied as well.

Fixes: #11176
Change-Id: Icf1a2752f60fce863c87ead8b0fe298b0f3d3766
(cherry picked from commit 29a428955a904e235e1b85e928cbe89155aeca82)

16 months agowork around boldface concerns
Mike Bayer [Tue, 19 Mar 2024 14:51:01 +0000 (10:51 -0400)] 
work around boldface concerns

Change-Id: I99ed117bb0f1bdc1a8750bd13db5a69d5c398ae0
(cherry picked from commit 697dcc94e412e013aba298e17613ee097f423e04)

16 months agoMerge "do not convert uuid to string in postgresql and mssql" into rel_2_0
Michael Bayer [Tue, 19 Mar 2024 14:44:01 +0000 (14:44 +0000)] 
Merge "do not convert uuid to string in postgresql and mssql" into rel_2_0

16 months agoMerge "document improvement for load_only" into rel_2_0
Michael Bayer [Tue, 19 Mar 2024 14:42:35 +0000 (14:42 +0000)] 
Merge "document improvement for load_only" into rel_2_0

16 months agoadd notes clarifying the role of "$user" in pg search_path
Mike Bayer [Tue, 19 Mar 2024 12:35:00 +0000 (08:35 -0400)] 
add notes clarifying the role of "$user" in pg search_path

references: https://github.com/sqlalchemy/alembic/discussions/1447
Change-Id: I2ef55813699f84ac7fbca6de7522f0d3d78e6029
(cherry picked from commit 58a50c06836792da201bb610ee2f0463ac1bb073)

16 months agodo not convert uuid to string in postgresql and mssql
Federico Caselli [Mon, 18 Mar 2024 21:01:00 +0000 (22:01 +0100)] 
do not convert uuid to string in postgresql and mssql

Change-Id: Ic3c87d8c654926f7ef28ba9ec6dd21c50a1171cf
(cherry picked from commit 5032cf6bc14f76e47063696a58ea3cce44e0f13f)

16 months agofix typo from d8174392dce20004d9158a90949b4ff11b830247
Federico Caselli [Mon, 18 Mar 2024 20:52:41 +0000 (21:52 +0100)] 
fix typo from d8174392dce20004d9158a90949b4ff11b830247

Change-Id: If76715abf6de8fc85580080a73aa5faa138aa968
(cherry picked from commit 82ae47ba9959c63cfaa9169869ef08db61f71fd7)

16 months agodocument improvement for load_only
Federico Caselli [Mon, 18 Mar 2024 20:50:35 +0000 (21:50 +0100)] 
document improvement for load_only

mention that load_only can be used to control what
populate existing refreses.

Change-Id: I9bd6fbe8674005d9f32f9d1bc263bf860b53c3ec
(cherry picked from commit 93da4ba1446162f1476598b4f13c307ae7bfb1f1)

16 months agoAdd impyla to external dialect list
Gord Thompson [Mon, 18 Mar 2024 13:26:17 +0000 (07:26 -0600)] 
Add impyla to external dialect list

Change-Id: I5a85db43a11c2c993597d0fa737377ee460b7629
(cherry picked from commit d8174392dce20004d9158a90949b4ff11b830247)

16 months agoMerge "remove sentinel_value_resolvers and use pre-bind values" into rel_2_0
Michael Bayer [Mon, 18 Mar 2024 18:17:18 +0000 (18:17 +0000)] 
Merge "remove sentinel_value_resolvers and use pre-bind values" into rel_2_0

16 months agoadd missing cache_ok directive to MyEpochType
Mike Bayer [Mon, 18 Mar 2024 14:22:06 +0000 (10:22 -0400)] 
add missing cache_ok directive to MyEpochType

Change-Id: Ic4da52b02a4ba36d87d73974fe428b91d9d7915c
(cherry picked from commit 4ef36de359449abd49b90726a1d06aef9a4084e7)

16 months agoremove sentinel_value_resolvers and use pre-bind values
Mike Bayer [Fri, 15 Mar 2024 14:51:02 +0000 (10:51 -0400)] 
remove sentinel_value_resolvers and use pre-bind values

Made a change to the adjustment made in version 2.0.10 for :ticket:`9618`,
which added the behavior of reconciling RETURNING rows from a bulk INSERT
to the parameters that were passed to it.  This behavior included a
comparison of already-DB-converted bound parameter values against returned
row values that was not always "symmetrical" for SQL column types such as
UUIDs, depending on specifics of how different DBAPIs receive such values
versus how they return them, necessitating the need for additional
"sentinel value resolver" methods on these column types.  Unfortunately
this broke third party column types such as UUID/GUID types in libraries
like SQLModel which did not implement this special method, raising an error
"Can't match sentinel values in result set to parameter sets".  Rather than
attempt to further explain and document this implementation detail of the
"insertmanyvalues" feature including a public version of the new
method, the approach is intead revised to no longer need this extra
conversion step, and the logic that does the comparison now works on the
pre-converted bound parameter value compared to the post-result-processed
value, which should always be of a matching datatype.  In the unusual case
that a custom SQL column type that also happens to be used in a "sentinel"
column for bulk INSERT is not receiving and returning the same value type,
the "Can't match" error will be raised, however the mitigation is
straightforward in that the same Python datatype should be passed as that
returned.

Fixes: #11160
Change-Id: Ica62571e923ad9545eb90502e6732b11875b164a
(cherry picked from commit 4c0af9e93dab62a04aa00f7c9a07c984e0e316df)

16 months agoMerge "mysql: Add new reserved words from MySQL 8.3." into rel_2_0
Federico Caselli [Fri, 15 Mar 2024 21:02:10 +0000 (21:02 +0000)] 
Merge "mysql: Add new reserved words from MySQL 8.3." into rel_2_0

16 months agofix mypy on python<3.10
Federico Caselli [Fri, 15 Mar 2024 19:42:16 +0000 (20:42 +0100)] 
fix mypy on python<3.10

Change-Id: Ice16ff3685f89c64607ef37a906e17c53a5324fd
(cherry picked from commit 34a974e509190497cd41831342dda0bdadf88891)

16 months agomysql: Add new reserved words from MySQL 8.3.
Sean Bright [Fri, 15 Mar 2024 17:57:28 +0000 (13:57 -0400)] 
mysql: Add new reserved words from MySQL 8.3.

Adds the following new keywords from MySQL 8.3:

* `intersect`
* `parallel`
* `qualify`

Sourced from https://dev.mysql.com/doc/refman/8.3/en/keywords.html

Fixes: #11166
<!-- Provide a general summary of your proposed changes in the Title field above -->

### Description
<!-- Describe your changes in detail -->

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [ ] A documentation / typographical / small typing error fix
- Good to go, no issue or tests are needed
- [x] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #11167
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11167
Pull-request-sha: adc789cdc6ea66d73925e2a819ea70e60ec282e4

Change-Id: I4441389a4ebec02cdb8372051b6fab1280bcf198
(cherry picked from commit 03cedd7e2ff994636b915039b700858ae835c786)

16 months agoaccommodate schema_translate_map in _deliver_insertmanyvalues_batches
Mike Bayer [Wed, 13 Mar 2024 22:23:07 +0000 (18:23 -0400)] 
accommodate schema_translate_map in _deliver_insertmanyvalues_batches

Fixed issue in :ref:`engine_insertmanyvalues` feature where using a primary
key column with an "inline execute" default generator such as an explicit
:class:`.Sequence` with an explcit schema name, while at the same time
using the
:paramref:`_engine.Connection.execution_options.schema_translate_map`
feature would fail to render the sequence or the parameters properly,
leading to errors.

Fixes: #11157
Change-Id: I35666af46d40996aff35d3d39f48c150d838e6e4
(cherry picked from commit e3f7bc683ac3ea6d7c517b9c7ffeaa911860d732)

16 months agoMerge "Make instrumented attribute covariant as well" into rel_2_0
Michael Bayer [Wed, 13 Mar 2024 16:02:37 +0000 (16:02 +0000)] 
Merge "Make instrumented attribute covariant as well" into rel_2_0

16 months agoMerge "add doctests to asyncio tutorial" into rel_2_0
Michael Bayer [Wed, 13 Mar 2024 16:01:12 +0000 (16:01 +0000)] 
Merge "add doctests to asyncio tutorial" into rel_2_0

16 months agoMake instrumented attribute covariant as well
Ethan Langevin [Mon, 11 Mar 2024 11:41:58 +0000 (07:41 -0400)] 
Make instrumented attribute covariant as well

<!-- Provide a general summary of your proposed changes in the Title field above -->

Allows mapped relationships to use covariant types which makes it possible to define methods that operate on relationships in a typesafe way

### Description

See: https://github.com/sqlalchemy/sqlalchemy/issues/11112 for a more in depth explanation.

Just changed the type parameter in `InstrumentedAttribute` from `_T` to `_T_co`.

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [ ] A documentation / typographical / small typing error fix
- Good to go, no issue or tests are needed
- [x] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #11113
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11113
Pull-request-sha: 3c100f28661f3440769175a17c2763ed25f4b83a

Change-Id: Iff715c24f1556d5604dcd33661a0ee7232b9404b
(cherry picked from commit 058e10f2b7e5686198dc744107b32952e55dc93c)

16 months agoimprove docs for sqlite memory db
Federico Caselli [Tue, 12 Mar 2024 22:05:50 +0000 (23:05 +0100)] 
improve docs for sqlite memory db

Change-Id: Icdbc13bdad3fb5ae69e79605bb7e6cb82d538c80
References: #10968
(cherry picked from commit e560794883c5a3259aa4208ee7c5aa0740cb3087)

16 months agoupdate section be qualified for PGBouncer
Mike Bayer [Mon, 11 Mar 2024 23:59:06 +0000 (19:59 -0400)] 
update section be qualified for PGBouncer

the NullPool advice is for PGBouncer only

Change-Id: Ib79cae8965435b78fbde6e2d4de5e35fcd2a2f21
(cherry picked from commit f99209583272b65a71c0b4884fd14edcf6577939)

16 months agoadd doctests to asyncio tutorial
Federico Caselli [Mon, 26 Feb 2024 21:16:18 +0000 (22:16 +0100)] 
add doctests to asyncio tutorial

Change-Id: I28c94a7bc1e7ae572af0d206b8e63a110dc6fd7a
(cherry picked from commit e32954b91eef968be33ac4b46c16055daffa90dd)

16 months agoMerge "Update docs references to .execute() with string literal" into main
Federico Caselli [Mon, 11 Mar 2024 22:35:49 +0000 (22:35 +0000)] 
Merge "Update docs references to .execute() with string literal" into main

(cherry picked from commit ca759fdc6c105922141898b29dfaafbd8b76b873)

16 months agoMention getitem on automap classes property
Federico Caselli [Mon, 11 Mar 2024 22:11:28 +0000 (23:11 +0100)] 
Mention getitem on automap classes property

Fixes #11097

Change-Id: I05198c8288e11fb0c645e9a7d46652fa979b56f7
(cherry picked from commit f0822f0d930c33ec66e440db99e90641f612338c)

16 months agoMerge "Fixes: #10933 typing in ColumnExpressionArgument" into main
Federico Caselli [Mon, 11 Mar 2024 22:10:55 +0000 (22:10 +0000)] 
Merge "Fixes: #10933 typing in ColumnExpressionArgument" into main

(cherry picked from commit 716189460f69a9f44dce3af1d47eab4560def86b)

16 months agoMerge "Allow using AsyncEngine in compile" into rel_2_0
Michael Bayer [Mon, 11 Mar 2024 22:04:52 +0000 (22:04 +0000)] 
Merge "Allow using AsyncEngine in compile" into rel_2_0

16 months agoFixing typos (#11105)
Andreas Deininger [Mon, 11 Mar 2024 21:40:14 +0000 (22:40 +0100)] 
Fixing typos (#11105)

(cherry picked from commit 1f6a129d80453e274d1e14631f065b1afaa37b96)

Change-Id: I5d6197cae2470e3df8d09b3ca8ea186a91e4811a

16 months agoFixes: #11083 (#11095)
Daniel Robert [Mon, 11 Mar 2024 21:34:20 +0000 (14:34 -0700)] 
Fixes: #11083 (#11095)
(cherry picked from commit 3551c7b66ab0318deef419fbe61fe038b6e2825c)

Change-Id: I959dff7f4ee6218267627e878283e3c48b88b314

16 months agoadd a docs cross-reference between adding columns & relationships to existing table...
Jens Troeger [Mon, 11 Mar 2024 21:11:45 +0000 (17:11 -0400)] 
add a docs cross-reference between adding columns & relationships to existing table mappings

For context see discussion https://github.com/sqlalchemy/sqlalchemy/discussions/11124. This change adds the requested cross-reference to the documentation.

This pull request is:

- [X] A documentation / typographical / small typing error fix
- Good to go, no issue or tests are needed
- [ ] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #11133
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11133
Pull-request-sha: f8cc7a9c510f058f75bcb4308f3f398b8ae70de8

Change-Id: Ic683354fa05560d869d47ceda820d88e758e2973
(cherry picked from commit ba9c86f2075bd4eb1d71caca58b6da6fe19e35ac)

16 months agochore: remove repetitive words (#11134)
acceptacross [Mon, 11 Mar 2024 21:01:42 +0000 (05:01 +0800)] 
chore: remove repetitive words (#11134)

Signed-off-by: acceptacross <csqcqs@gmail.com>
(cherry picked from commit 64b661d7058818ad6852b208a877804eba294d91)

16 months agofix imports in "Self-Referential Many-to-Many Relationship" code example (#11120)
Denis Laxalde [Mon, 11 Mar 2024 20:59:51 +0000 (21:59 +0100)] 
fix imports in "Self-Referential Many-to-Many Relationship" code example (#11120)

Some were unused, some were missing.

(cherry picked from commit 461ababb789dd024f4e9d0c5f06e405eb911026e)

16 months agofix usage of kwargs to execute in docs
Federico Caselli [Mon, 11 Mar 2024 20:58:46 +0000 (21:58 +0100)] 
fix usage of kwargs to execute in docs

Change-Id: I033cba49ba6c12113643b88e48c5917f2b70a307
(cherry picked from commit af4df5e2a2405cfef3aa26bbb8f48e24d954a370)

16 months agoAllow using AsyncEngine in compile
Eugene Toder [Mon, 11 Mar 2024 11:42:47 +0000 (07:42 -0400)] 
Allow using AsyncEngine in compile

This works, so only need to update the type annotation.

This pull request is:

- [x] A documentation / typographical / small typing error fix
- Good to go, no issue or tests are needed

Closes: #11103
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11103
Pull-request-sha: ba9e61a3902d5666a5176aedd50afe8ae7762bff

Change-Id: I3d08b930a8cae0539bf9b436d5e806d8912cdee0
(cherry picked from commit d2a743d0bcd88129f571f2256cd18f1b02036fd2)

16 months agoFixed typing issues with sync code runners
Francisco R. Del Roio [Sun, 25 Feb 2024 19:37:27 +0000 (14:37 -0500)] 
Fixed typing issues with sync code runners

Fixed typing issue allowing asyncio ``run_sync()`` methods to correctly
type the parameters according to the callable that was passed, making use
of :pep:`612` ``ParamSpec`` variables.  Pull request courtesy Francisco R.
Del Roio.

Closes: #11055
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11055
Pull-request-sha: 712b4382b16e4c07c09ac40a570c4bfb76c28161

Change-Id: I94ec8bbb0688d6c6e1610f8f769abab550179c14
(cherry picked from commit b687624f63b8613f3c487866292fa88f763c79ee)

16 months agoadd extra pep695 conversion step
Mike Bayer [Sat, 9 Mar 2024 17:47:01 +0000 (12:47 -0500)] 
add extra pep695 conversion step

Added support for the :pep:`695` ``TypeAliasType`` construct as well as the
python 3.12 native ``type`` keyword to work with ORM Annotated Declarative
form when using these constructs to link to a :pep:`593` ``Annotated``
container, allowing the resolution of the ``Annotated`` to proceed when
these constructs are used in a :class:`_orm.Mapped` typing container.

Fixes: #11130
Change-Id: I9a386943966de2107f15f08dfe6ed2aa84f7e86c
(cherry picked from commit 985193c407ffb891c8eed042fac6f9547a34d694)

16 months agoMerge "use a fixed date that's not near DST switchover" into rel_2_0
Michael Bayer [Sat, 9 Mar 2024 20:56:20 +0000 (20:56 +0000)] 
Merge "use a fixed date that's not near DST switchover" into rel_2_0

16 months agodocument caveat for #11054
Mike Bayer [Sat, 9 Mar 2024 18:41:05 +0000 (13:41 -0500)] 
document caveat for #11054

Fixes: #11054
Change-Id: I1a5a9586d024d84dacf37742d710baf7b8f7570f
(cherry picked from commit 10fb1328ba53f0dc64355b45abd9e4e321589fae)

16 months agouse a fixed date that's not near DST switchover
Mike Bayer [Sat, 9 Mar 2024 15:05:03 +0000 (10:05 -0500)] 
use a fixed date that's not near DST switchover

CI has been failing here due to the DST switchover regarding
live dates.

Change-Id: I98b2dbe646180f41f948bec20193fdf3f63501b8
(cherry picked from commit 5b94dfad5ebc0ef9f929a7d9c7200ca577fea9b2)

17 months agoaccommodate False conditions for unique / index merge
Mike Bayer [Mon, 4 Mar 2024 14:12:34 +0000 (09:12 -0500)] 
accommodate False conditions for unique / index merge

Fixed issue in ORM annotated declarative where using
:func:`_orm.mapped_column()` with an :paramref:`_orm.mapped_column.index`
or :paramref:`_orm.mapped_column.unique` setting of False would be
overridden by an incoming ``Annotated`` element that featured that
parameter set to ``True``, even though the immediate
:func:`_orm.mapped_column()` element is more specific and should take
precedence.  The logic to reconcile the booleans has been enhanced to
accommodate a local value of ``False`` as still taking precedence over an
incoming ``True`` value from the annotated element.

Fixes: #11091
Change-Id: I15cda4a0a07a289015c0a09bbe3ca2849956604e
(cherry picked from commit e4c4bd03abae2d3948f894d38992d51c9be2a8c0)

17 months agoVersion 2.0.29 placeholder
Mike Bayer [Mon, 4 Mar 2024 13:41:51 +0000 (08:41 -0500)] 
Version 2.0.29 placeholder

17 months ago- 2.0.28 rel_2_0_28
Mike Bayer [Mon, 4 Mar 2024 13:32:33 +0000 (08:32 -0500)] 
- 2.0.28

17 months agocherry-pick changelog update for 1.4.53
Mike Bayer [Mon, 4 Mar 2024 13:30:05 +0000 (08:30 -0500)] 
cherry-pick changelog update for 1.4.53

(cherry picked from commit cb00a5252e240c2b0308a2891989836473633538)

17 months agocherry-pick changelog from 1.4.52
Mike Bayer [Mon, 4 Mar 2024 13:30:04 +0000 (08:30 -0500)] 
cherry-pick changelog from 1.4.52

(cherry picked from commit 662006d4f84f54b2bcddea5025696e8134a187f6)

17 months agoMerge "Add support for preserve_rowcount execution_option" into rel_2_0
Michael Bayer [Mon, 4 Mar 2024 06:09:04 +0000 (06:09 +0000)] 
Merge "Add support for preserve_rowcount execution_option" into rel_2_0

17 months agoMerge "adjust bound parameters within cache key only, dont deep copy" into rel_2_0
Michael Bayer [Mon, 4 Mar 2024 06:08:12 +0000 (06:08 +0000)] 
Merge "adjust bound parameters within cache key only, dont deep copy" into rel_2_0

17 months agosupport pytest 8.1
Mike Bayer [Mon, 4 Mar 2024 04:03:14 +0000 (23:03 -0500)] 
support pytest 8.1

This is a bump in the tox.ini file.   it's possible we
don't need to change anything else as we had help from the pytest
people a few years back to make sure our API use was fairly modern.

Alembic is having problems that appear to be separate.

Change-Id: If0348dc4915522d31d3ab970df31244bbc8b8ca4
(cherry picked from commit bc4d9ceec1c73c6a4e36d570052ff5e588462443)

17 months agoadjust bound parameters within cache key only, dont deep copy
Mike Bayer [Sat, 2 Mar 2024 05:28:26 +0000 (00:28 -0500)] 
adjust bound parameters within cache key only, dont deep copy

Adjusted the fix made in :ticket:`10570`, released in 2.0.23, where new
logic was added to reconcile possibly changing bound parameter values
across cache key generations used within the :func:`_orm.with_expression`
construct.  The new logic changes the approach by which the new bound
parameter values are associated with the statement, avoiding the need to
deep-copy the statement which can result in a significant performance
penalty for very deep / complex SQL constructs.  The new approach no longer
requires this deep-copy step.

Fixes: #11085
Change-Id: Ia51eb4e949c8f37af135399925a9916b9ed4ad2f
(cherry picked from commit 06be748b474246c1061c309f16f5648ae9bb3954)

17 months agoAdd support for preserve_rowcount execution_option
Federico Caselli [Wed, 7 Feb 2024 21:11:25 +0000 (22:11 +0100)] 
Add support for preserve_rowcount execution_option

Added new core execution option
paramref:`_engine.Connection.execution_options.preserve_rowcount`
to unconditionally save the ``rowcount`` attribute from the cursor in the
class:`_engine.Result` returned from an execution, regardless of the
statement being executed.
When this option is provided the correct value is also set when
an INSERT makes use of the "insertmanyvalues" mode, that may use
more than one actualy cursor execution.

Fixes: #10974
Change-Id: Icecef6b7539be9f0a1a02b9539864f5f163dcfbc
(cherry picked from commit f0537442eb7d3a3b2e702c8843c3c277fbfda0ac)

17 months agoadd 1.4 changelog for #10365
Mike Bayer [Thu, 29 Feb 2024 16:07:22 +0000 (11:07 -0500)] 
add 1.4 changelog for #10365

Change-Id: I3359274337f214132f35d9c4b722c97685b63d72
(cherry picked from commit 9bcc4da735891d09a4c850c5f29b3abeef13ce27)

17 months agofix typos in docs
Federico Caselli [Mon, 26 Feb 2024 21:16:38 +0000 (22:16 +0100)] 
fix typos in docs

Change-Id: Iaba3c5979af626055acb0068cc8aac0c7334b0e0
(cherry picked from commit 8a171bb3391e916d19ddf853dc2f9f5e5756c16e)

17 months agofix issue in asincio doc example
Federico Caselli [Mon, 26 Feb 2024 20:11:20 +0000 (21:11 +0100)] 
fix issue in asincio doc example

Change-Id: Idd55c07a57381450ab5c9db99854b6a1668f0382
(cherry picked from commit 191b67b948291a6d1b6e6c2a4a17b181d43ecb56)

17 months agoAdded YugabyteDB dialect to the documentation (#11047)
Sfurti-yb [Thu, 22 Feb 2024 19:37:24 +0000 (01:07 +0530)] 
Added YugabyteDB dialect to the documentation (#11047)

* Added YugabyteDB dialect to the documentation

* Update doc/build/dialects/index.rst

Co-authored-by: Federico Caselli <cfederico87@gmail.com>
---------

Co-authored-by: Federico Caselli <cfederico87@gmail.com>
(cherry picked from commit 5c88498ba8ba5f7c524d5aca130e5a59a8940766)

17 months agoReplace non-standard Python plat env marker (#11035)
layday [Wed, 21 Feb 2024 20:13:13 +0000 (22:13 +0200)] 
Replace non-standard Python plat env marker (#11035)

Fixes #11034.

(cherry picked from commit 78d0a24f98e3a7f3ea76acf5e47ace848adc2e2b)

Change-Id: I43e5229612e6a881e547db08780f3223dfe1c5c3

17 months agoDocumenting multiprocessing and events (#10831)
James Braza [Wed, 21 Feb 2024 19:52:14 +0000 (14:52 -0500)] 
Documenting multiprocessing and events (#10831)

* Added documentation on multiprocessing support for event system

* Incorporating zzzeek's PR comments into docs as tip section

* Removed tip and changed section title to 'Events and Multiprocessing'

* Adopting zzzeek's PR comment suggestions

* Tweaked wording to be more concise

(cherry picked from commit e1e95a6a34ce201840a22c73b7f7dce358fe71d1)

17 months agoMerge "raise for asyncio-incompatible pool classes" into rel_2_0
Michael Bayer [Tue, 20 Feb 2024 15:09:00 +0000 (15:09 +0000)] 
Merge "raise for asyncio-incompatible pool classes" into rel_2_0

17 months agoFix mysql dialect text docstring, length is interpreted as byte size
Zhong Zheng [Fri, 16 Feb 2024 17:20:59 +0000 (12:20 -0500)] 
Fix mysql dialect text docstring, length is interpreted as byte size

<!-- Provide a general summary of your proposed changes in the Title field above -->

### Description
The `Text` and its variant types in MySQL are bytes size limited, not character length, so fixing the doctoring where the upper limit uses the `characters` as the unit instead of `bytes`

https://dev.mysql.com/doc/refman/5.7/en/storage-requirements.html
https://dev.mysql.com/doc/refman/8.0/en/storage-requirements.html

<img width="878" alt="Screenshot 2024-02-15 at 17 27 59" src="https://github.com/sqlalchemy/sqlalchemy/assets/5219229/29731769-f57e-46f9-858b-46feda0ae83c">

### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)

-->

This pull request is:

- [x] A documentation / typographical / small typing error fix
- Good to go, no issue or tests are needed
- [ ] A short code fix
- please include the issue number, and create an issue if none exists, which
  must include a complete example of the issue.  one line code fixes without an
  issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.   one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
  include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.

**Have a nice day!**

Closes: #11018
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/11018
Pull-request-sha: 13fa52917efea9a229c7abf19a3be40e24a79cb9

Change-Id: Iea903a6dc4b52ee4b7b5d2d64256c69abbd1f8aa
(cherry picked from commit 1c58fe53b6fd069cbb82955ddaf9eb5405076146)

17 months agoUpdate Actian entry in External Dialects table (#11014)
Michael Habiger [Fri, 16 Feb 2024 17:16:44 +0000 (11:16 -0600)] 
Update Actian entry in External Dialects table (#11014)

(cherry picked from commit edc00d9e96661328621aea3f3849b493a365bbbe)

17 months agoraise for asyncio-incompatible pool classes
Mike Bayer [Thu, 15 Feb 2024 02:10:20 +0000 (21:10 -0500)] 
raise for asyncio-incompatible pool classes

An error is raised if a :class:`.QueuePool` or other non-asyncio pool class
is passed to :func:`_asyncio.create_async_engine`.  This engine only
accepts asyncio-compatible pool classes including
:class:`.AsyncAdaptedQueuePool`. Other pool classes such as
:class:`.NullPool` are compatible with both synchronous and asynchronous
engines as they do not perform any locking.

Fixes: #8771
Change-Id: I5843ccea7d824488492d1a9d46207b9f05330ae3
(cherry picked from commit c449505f651ebf4b73aaa7d7aec99b038ea34cb6)