mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-03-28 17:55:06 +00:00
Fix sql error for mariadb <10.4
MariaDB below 10.4 doesn't support parentheses around selects for `intersect` and `union`. https://mariadb.com/kb/en/intersect/#parentheses Fixes #404
This commit is contained in:
parent
509823404e
commit
0461cfefe7
@ -328,17 +328,14 @@ object QItem {
|
||||
val EC = REquipment.Columns
|
||||
|
||||
// inclusive tags are AND-ed
|
||||
val tagSelectsIncl = (q.tagsInclude
|
||||
val tagSelectsIncl = q.tagsInclude
|
||||
.map(tid =>
|
||||
selectSimple(
|
||||
List(RTagItem.Columns.itemId),
|
||||
RTagItem.table,
|
||||
RTagItem.Columns.tagId.is(tid)
|
||||
)
|
||||
) ++ q.tagCategoryIncl.map(cat =>
|
||||
TagItemName.itemsInCategory(NonEmptyList.of(cat))
|
||||
))
|
||||
.map(f => sql"(" ++ f ++ sql") ")
|
||||
) ++ q.tagCategoryIncl.map(cat => TagItemName.itemsInCategory(NonEmptyList.of(cat)))
|
||||
|
||||
// exclusive tags are OR-ed
|
||||
val tagSelectsExcl =
|
||||
|
Loading…
x
Reference in New Issue
Block a user