Skip to content

v2.3.2

Choose a tag to compare

@se7enxweb se7enxweb released this 22 Apr 08:15
· 109 commits to master since this release

What's Changed

fix: SQLite compatibility — MOD() → %, positional ORDER BY after UNION

SQLite does not support the MOD() function and requires positional (or
unambiguous) column references in ORDER BY clauses that follow a UNION.
Both changes are fully backward-compatible with MySQL and PostgreSQL.

classes/eztagsobject.php — line 729

-$customConds .= " AND eztags.main_language_id + MOD( eztags.language_mask, 2 ) = eztags_keyword.language_id ";
+$customConds .= " AND eztags.main_language_id + (eztags.language_mask % 2) = eztags_keyword.language_id ";

datatypes/eztags/eztags.php — lines 255 & 259

-                                   eztags.main_language_id + MOD( eztags.language_mask, 2 ) = eztags_keyword.language_id AND
+                                   eztags.main_language_id + (eztags.language_mask % 2) = eztags_keyword.language_id AND
-                                ORDER BY priority ASC, id ASC" );
+                                ORDER BY 5 ASC, 1 ASC" );

Why positional ORDER BY? SQLite treats bare column names like priority
and id as ambiguous when they appear in an ORDER BY after a UNION
(it cannot tell which side of the union to resolve against). Using positional
indices (5 = priority, 1 = id) is unambiguous and is valid SQL-92
accepted by MySQL, PostgreSQL, and SQLite alike.


Full Changelog: v2.3.1...v2.3.2