if you want something done right… DIY.

meanderings of a computer scientist on the brink of sheer insanity.

debugging gallery2 after upgrade

no idea what version to which this applies as i’ve never installed or configured gallery2, but here’s the process by which i just now debugged one particular gallery2 install…
gallery2/config.php
line 30 - @ini_set(’display_errors’, 1);
line 134 - $gallery->setDebug(’buffered’);
1st error:
Unknown column ‘g2_Item.g_renderer’
grep -r ‘renderer’ *
modules/core/classes/GalleryStorage/schema.tpl:
CREATE TABLE DB_TABLE_PREFIXItem(

DB_COLUMN_PREFIXownerId int(11) NOT NULL,
DB_COLUMN_PREFIXrenderer varchar(128),
ALTER TABLE g2_Item ADD g_renderer VARCHAR(128) NULL AFTER […]

beware of table alias in LEFT JOIN

when mixing standard selects containing table aliases with LEFT JOIN’s you need be aware of a critical change as of mysql 5… if you reference a table alias in an ON clause the same way you might have in verison 4, mysql may report an ‘unknown column’ error.
so, a query of the form:
SELECT a.id FROM […]