After attempting to install this module with a PostgreSQL database, I see the following error messages in the PostgreSQL log file (multiple times):

ERROR:  function lpad(bigint, integer, unknown) does not exist at character 119
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
STATEMENT:  SELECT count, bundle_md5, filename FROM (SELECT LPAD(COUNT(*), 8, '00000000') AS count, bundle_md5, filename_md5 FROM advagg_bundles WHERE root = 1 AND timestamp > 1319753642 GROUP BY filename_md5) AS ab INNER JOIN advagg_files AS af USING ( filename_md5 )

Anyway, from looking at the documentation for lpad() on PostgreSQL and MySQL, it looks like the first argument is supposed to be a string, whereas count() returns a bigint in PostgreSQL and MySQL. I've attached a patch that casts the return value from count as a char. It works on PostgreSQL, should work with MySQL.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mikeytown2’s picture

Title: Improper argument to SQL lpad() in advagg_bundler_analysis() » PostgreSQL: Improper argument to SQL lpad() in advagg_bundler_analysis()
ChrisLaFrancis’s picture

Sorry, this should be cast to varchar instead of char. New patch attached.

Also, the MySQL documentation for lpad() specifies that the first argument should be a string, too, so I'm not sure this issue is specific to PostgreSQL...

mikeytown2’s picture

Status: Active » Fixed

Patch above has been committed. Thanks!

mikeytown2’s picture

ChrisLaFrancis’s picture

It looks like MySQL can cast to a char, so how about we cast to char(8) instead of varchar? Patch attached.

mikeytown2’s picture

Verified this time it works.
Last patch has been committed.
Thanks!

Status: Fixed » Closed (fixed)

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