Commits

Tuukka Norri committed f8caa55

Fixed a bug in a WHERE clause which didn't take a null into account

Comments (0)

Files changed (1)

Resources/BaseTenModifications.sql.m4

 
 changequote(`{{', `}}')
 -- ' -- Fix for syntax coloring in SQL mode.
-define({{_bx_version_}}, {{0.931}})dnl
+define({{_bx_version_}}, {{0.932}})dnl
 define({{_bx_compat_version_}}, {{0.19}})dnl
 
 
 		INNER JOIN "baseten".relation r1 ON (r1.id = rel.srcid)
 		INNER JOIN "baseten".relation r2 ON (r2.id = rel.dstid)
 		LEFT OUTER JOIN "baseten".relation r3 ON (r3.id = rel.helperid)
-		WHERE r1.enabled = true AND r2.enabled = true AND r3.enabled = true;
+		WHERE r1.enabled = true AND r2.enabled = true AND (
+            r3.id IS NULL OR r3.enabled = true
+        );
 $$ VOLATILE LANGUAGE SQL;
 REVOKE ALL PRIVILEGES ON FUNCTION "baseten"._insert_relationships () FROM PUBLIC;
 GRANT EXECUTE ON FUNCTION "baseten"._insert_relationships () TO basetenowner;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.