Hi,

Just installed this module, and found an issue when running on Postgres 8.1. (Both in 6.x-2.x-dev and 6.x-2.1)

When installing the module, it returns an error:

query: INSERT INTO vocabindex (vid, type) VALUES (1, 2), (1, 1) in /vhost/michaela.cmstest.dev/modules/vocabindex/vocabindex.module on line 442.

The following line:

db_query("INSERT INTO {vocabindex} (vid, type) VALUES (%d, %d), (%d, %d)", $vid, VOCABINDEX_VI_PAGE, $vid, VOCABINDEX_VI_BLOCK)

Doesn't work in PostgreSQL < 8.2. see : http://groups.drupal.org/node/9243

I think it just needs to be split into two db_query statements:

db_query("INSERT INTO {vocabindex} (vid, type) VALUES (%d, %d)", $vid, VOCABINDEX_VI_PAGE);
db_query("INSERT INTO {vocabindex} (vid, type) VALUES (%d, %d)", $vid, VOCABINDEX_VI_BLOCK);

I've attached a patch. I haven't written one before, but if theres anything wrong, its a small change :D

Michael

Comments

Anonymous’s picture

StatusFileSize
new991 bytes

The patch had dos-like carriage return ^M characters in it which caused patch to fail on a Unix machine.

Attached is an updated patch minus the characters.

xano’s picture

Is this the only query that doesn't work with PG 8.1?

xano’s picture

Status: Active » Needs review
xano’s picture

Priority: Normal » Critical

Yes, it is *very* late.

maikeru’s picture

I think so.

I've just run through an clean install with the patch, running through most of the screens, no errors.

I ran through the simpletests provided - returned one error from unit testing:

Make sure alphanumerical characters are accepted by the letter wildcard's loader. Other vocabindex.test 82 VocabindexUnitTest->testLetterLoader()

But that doesn't seem to be running any database queries.

We're running vocab index on a site that has been through testing, and there hasn't been any other postgres problems with the module.

Cheers,
Michael

xano’s picture

Does the test also throw that error without the patch?

maikeru’s picture

StatusFileSize
new272.07 KB

Yes that error is thrown before applying the patch.

With patch: 8 passes, 1 fail

Without patch:

5 passes, 4 fails, and 6 exceptions.

I've attached a jpg of the errors thrown pre-patch.

xano’s picture

Can you confirm the patch works? It would be awesome if you could write a patch for 5.x-2.x-dev too! :)

xano’s picture

Title: Support for Postgres 8.1 » Support for PostgreSQL <8.2
Status: Needs review » Fixed

Fixed and committed. Thanks for the patch!

Status: Fixed » Closed (fixed)

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