mirror of
https://github.com/owncloud/bookmarks.git
synced 2025-02-18 15:54:28 +01:00
fix apps/bookmarks if oc_bookmarks_tags is empty
If you have bookmarks, but there are no tags in oc_bookmarks_tags, the query doesn't return any results. Using a left join fixes this. Reference: http://stackoverflow.com/questions/3171276/select-multiple-tables-when-one-table-is-empty-in-mysql Signed-off-by: Florian Pritz <bluewind@xinu.at>
This commit is contained in:
parent
70208c5b92
commit
619ff59236
@ -70,7 +70,8 @@ $query = OC_DB::prepare('
|
||||
ELSE \' \'
|
||||
END
|
||||
AS tags
|
||||
FROM *PREFIX*bookmarks, *PREFIX*bookmarks_tags
|
||||
FROM *PREFIX*bookmarks
|
||||
LEFT JOIN *PREFIX*bookmarks_tags ON 1=1
|
||||
WHERE (*PREFIX*bookmarks.id = *PREFIX*bookmarks_tags.bookmark_id
|
||||
OR *PREFIX*bookmarks.id NOT IN (
|
||||
SELECT *PREFIX*bookmarks_tags.bookmark_id FROM *PREFIX*bookmarks_tags
|
||||
|
Loading…
x
Reference in New Issue
Block a user