mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
newdb: Fix true/false searches on numeric columns
This commit is contained in:
parent
602c3d22a5
commit
8d3fd8b05c
@ -290,8 +290,11 @@ class NumericSearch(object): # {{{
|
||||
raise ParseException(
|
||||
_('Non-numeric value in query: {0}').format(query))
|
||||
|
||||
qfalse = query == 'false'
|
||||
for val, book_ids in field_iter():
|
||||
if val is None:
|
||||
if qfalse:
|
||||
matches |= book_ids
|
||||
continue
|
||||
try:
|
||||
v = cast(val)
|
||||
|
@ -224,8 +224,8 @@ class ReadingTest(BaseTest):
|
||||
'rating:3', 'rating:>2', 'rating:=2', 'rating:true',
|
||||
'rating:false', 'rating:>4', 'tags:#<2', 'tags:#>7',
|
||||
'cover:false', 'cover:true', '#float:>11', '#float:<1k',
|
||||
'#float:10.01', 'series_index:1', 'series_index:<3', 'id:1',
|
||||
'id:>2',
|
||||
'#float:10.01', '#float:false', 'series_index:1',
|
||||
'series_index:<3', 'id:1', 'id:>2',
|
||||
|
||||
# Bool tests
|
||||
'#yesno:true', '#yesno:false', '#yesno:yes', '#yesno:no',
|
||||
|
Loading…
x
Reference in New Issue
Block a user