Partitioning algorithm wrong for thread_id=0
Motivation
----------
The partitioning algorithm is not working correctly for `thread_id=0`. It then wrongly goes to a mode assuming there are no partitions.

diff --git a/lib/rucio/db/sqla/__init__.py b/lib/rucio/db/sqla/__init__.py
index 4a0df8e60..d86c16af7 100644
--- a/lib/rucio/db/sqla/__init__.py
+++ b/lib/rucio/db/sqla/__init__.py
@@ -9,7 +9,7 @@ from sqlalchemy.sql.expression import bindparam, text
 
 def filter_thread_work(session, query, total_threads, thread_id, hash_variable=None):
     """ Filters a query to partition thread workloads based on the thread id and total number of threads """
-    if thread_id and total_threads and (total_threads - 1) > 0:
+    if thread_id is not None and total_threads is not None and (total_threads - 1) > 0:
         if session.bind.dialect.name == 'oracle':
             bindparams = [bindparam('thread_id', thread_id), bindparam('total_threads', total_threads - 1)]
             if not hash_variable:
['lib/rucio/db/sqla/__init__.py']