3787363005
There are cases where users sort a table using compound-values sort_key
and one of the key has nullable set to True. For example, sorting a
table using ['id', 'updated_at'] where 'updated_at' can be None.
When marker_value is None, we cannot do value comparison using '<' or
'>' operators. This patch adds a check if the value from the marker
corresponding to the nullable-key has None value. If that is the case,
we skip the comparison.
Back to the example above, instead of always getting the following
criteria (which doesn't work):
(id > MARKER_ID) or (id == MARKER_ID && updated_at > None) <-- failure
we will get the following criteria when 'updated_at' is None:
(id > MARKER_ID)
This is not hurting in any way to existing / legal use cases where
callers are expected to include a unique key in sort keys. If there are
such cases, this patch is not making things worse because the sorting
is already unpredictable.
Closes-Bug: #1615938
Change-Id: Iea2cd0bb2556b0b15a0baaa76ef522a3097f9928
(cherry picked from commit
|
||
---|---|---|
doc/source | ||
oslo_db | ||
releasenotes | ||
tools | ||
.coveragerc | ||
.gitignore | ||
.gitreview | ||
.mailmap | ||
.testr.conf | ||
CONTRIBUTING.rst | ||
HACKING.rst | ||
LICENSE | ||
README.rst | ||
babel.cfg | ||
requirements.txt | ||
setup.cfg | ||
setup.py | ||
tox.ini |
README.rst
oslo.db -- OpenStack Database Pattern Library
The oslo db (database) handling library, provides database connectivity to different database backends and various other helper utils.
- Free software: Apache license
- Documentation: http://docs.openstack.org/developer/oslo.db
- Source: http://git.openstack.org/cgit/openstack/oslo.db
- Bugs: http://bugs.launchpad.net/oslo.db