The fix introduced a bug in in fast_gallery_class.php at line 467. Changing this conditional: ($db_type == 'mysql') to: ($db_type == 'mysqli', fixes it in my case.

If we are simply concerned about a postgres issue, I think this code change would be a more universal solution:

// fix for supporting postgresql
global $db_type;
if ($db_type == 'pgsql') {
$sql_folders = "SELECT " .
"DISTINCT ON (fg.folder) fg.path, fg.folder, fg.gid, fe.value " .
"FROM fast_gallery fg, fast_gallery_exif AS fe " .
"WHERE fg.parent='%s' " .
"AND fg.gid=fe.gid " .
"AND fe.field='dateTaken'" .
"GROUP by fg.folder, fg.path, fg.gid, fe.value ORDER by fg.folder, fe.value %s";
} else {
$sql_folders = "SELECT path, fg.folder, fg.gid, fe.value FROM {fast_gallery} AS fg, " .
"{fast_gallery_exif} AS fe " .
"RIGHT JOIN " .
"(SELECT DISTINCT folder FROM {fast_gallery} WHERE parent='%s') " .
"AS fldrs " .
"ON 1 WHERE fg.folder=fldrs.folder " .
"AND fg.gid=fe.gid " .
"AND fe.field='dateTaken' " .
"GROUP by folder " .
"ORDER by value %s";
}

Here is the error message I get, so others can see what the above solves:

* warning: mysqli_query() [function.mysqli-query]: Empty query in /home3/realityb/public_html/photokinesis/includes/database.mysqli.inc on line 108.
* user warning: Table 'realityb_pk.fast_gallery_folders' doesn't exist query: CREATE TEMPORARY TABLE fast_gallery_all_folders Engine=HEAP SELECT * FROM fast_gallery_folders UNION SELECT * FROM fast_gallery_folders_noexif in /home3/realityb/public_html/photokinesis/sites/all/modules/fast_gallery/fast_gallery.class.php on line 575.
* user warning: Table 'realityb_pk.fast_gallery_all_folders' doesn't exist query: SELECT SUM(count) FROM (SELECT COUNT(*) AS count FROM fast_gallery_all_images UNION SELECT COUNT(*) AS count FROM fast_gallery_all_folders) AS tbl in /home3/realityb/public_html/photokinesis/sites/all/modules/fast_gallery/fast_gallery.class.php on line 583.
* user warning: Table 'realityb_pk.fast_gallery_all_folders' doesn't exist query: SELECT path, folder, gid FROM fast_gallery_all_folders UNION SELECT path, folder, gid FROM fast_gallery_all_images LIMIT 0, 30 in /home3/realityb/public_html/photokinesis/sites/all/modules/fast_gallery/fast_gallery.class.php on line 583.
* user warning: Table 'realityb_pk.fast_gallery_all_folders' doesn't exist query: SELECT path, folder, gid FROM fast_gallery_all_folders UNION SELECT path, folder, gid FROM fast_gallery_all_images in /home3/realityb/public_html/photokinesis/sites/all/modules/fast_gallery/fast_gallery.class.php on line 597.

CommentFileSizeAuthor
#1 fast_gallery-db_compatibility.patch1.44 KBfernao

Comments

fernao’s picture

StatusFileSize
new1.44 KB

Here goes the patch. Tell me if something went wrong and feel free to send a patch also!
(again, I've just accepted your suggestion!)

cheers
Fernão

rapsli’s picture

Status: Active » Needs review
tstermitz’s picture

'brigado. Como uma galinha botando ovos.

I'm not up to speed on how patches work, but I looked at it, and I think I understand what it does. I did verify that my adjustment to the postgress fix works in my situation (mysqli). I think someone on postgres needs to try it as well.

rapsli’s picture

Status: Needs review » Fixed

committed to head -> committed using command line for the first time... dude it's not that simple ;)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.