Trying to select specific albums with the tag "Only These Albums" + Child Albums results in this SQL error:
Warning: [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT DISTINCT(id)
FROM piwigo_categories
WHERE uppercats REGEXP '(^|,)4...' at line 16
This is the code being executed:
SELECT i.id
FROM piwigo_images AS i
WHERE
i.id NOT IN (
SELECT image_id
FROM piwigo_image_category
WHERE category_id NOT IN(
SELECT DISTINCT(id)
FROM piwigo_categories
WHERE uppercats REGEXP '(^|,)41(,|$)')
)
and i.id IN (
SELECT image_id
FROM piwigo_image_category
WHERE category_id =
SELECT DISTINCT(id)
FROM piwigo_categories
WHERE uppercats REGEXP '(^|,)41(,|$)'
)
GROUP BY i.id
ORDER BY date_available DESC, file ASC, id ASC
Which should probably be:
SELECT i.id
FROM piwigo_images AS i
WHERE
i.id NOT IN (
SELECT image_id
FROM piwigo_image_category
WHERE category_id NOT IN(
SELECT DISTINCT(id)
FROM piwigo_categories
WHERE uppercats REGEXP '(^|,)41(,|$)')
)
and i.id IN (
SELECT image_id
FROM piwigo_image_category
WHERE category_id IN (
SELECT DISTINCT(id)
FROM piwigo_categories
WHERE uppercats REGEXP '(^|,)41(,|$)'
)
)
GROUP BY i.id
ORDER BY date_available DESC, file ASC, id ASC
This change is going from an equal operator to an IN list with parentheses.
Trying to select specific albums with the tag "Only These Albums" + Child Albums results in this SQL error:
Warning: [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT DISTINCT(id)
FROM piwigo_categories
WHERE uppercats REGEXP '(^|,)4...' at line 16
This is the code being executed:
Which should probably be:
This change is going from an equal operator to an IN list with parentheses.