OpenStack Common DB Code
Go to file
tengqm 3787363005 Fix marker checking when value is None
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 b3869d04cf)
2017-04-14 02:53:51 +00:00
doc/source Make it possible to use enginefacade decorators with class methods 2016-06-27 17:22:01 +03:00
oslo_db Fix marker checking when value is None 2017-04-14 02:53:51 +00:00
releasenotes Merge "release notes: mention changes in wrap_db_retry()" 2016-08-10 18:28:23 +00:00
tools Prepare for using standard python tests 2017-02-06 21:59:16 +01:00
.coveragerc Fix coverage configuration and execution 2015-10-08 17:29:42 -04:00
.gitignore Autogenerate the module docs 2015-09-24 10:56:06 -05:00
.gitreview Update .gitreview for stable/newton 2016-08-29 16:07:01 -04:00
.mailmap Fix the graduate.sh script result 2014-04-18 11:33:16 +03:00
.testr.conf Move files out of the namespace package 2014-12-24 13:28:48 +02:00
CONTRIBUTING.rst Prepare for using standard python tests 2017-02-06 21:59:16 +01:00
HACKING.rst Add doc8 to tox environment docs 2014-09-01 11:40:08 +02:00
LICENSE Fix the graduate.sh script result 2014-04-18 11:33:16 +03:00
README.rst Make readme and documentation titles consistent 2015-09-24 20:45:26 +00:00
babel.cfg Fix the graduate.sh script result 2014-04-18 11:33:16 +03:00
requirements.txt Updated from global requirements 2016-08-24 01:37:25 +00:00
setup.cfg Updated from global requirements 2016-09-20 13:15:26 +00:00
setup.py Updated from global requirements 2015-09-18 16:41:34 +00:00
tox.ini Consolidate pifpaf commands into variables 2016-07-19 20:18:07 +03:00

README.rst

oslo.db -- OpenStack Database Pattern Library

Latest Version

Downloads

The oslo db (database) handling library, provides database connectivity to different database backends and various other helper utils.