Support for PostgreSQL <8.2
| Project: | Vocabulary Index |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
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
| Attachment | Size |
|---|---|
| postgres8_1.patch | 1004 bytes |

#1
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.
#2
Is this the only query that doesn't work with PG 8.1?
#3
#4
Yes, it is *very* late.
#5
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
#6
Does the test also throw that error without the patch?
#7
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.
#8
Can you confirm the patch works? It would be awesome if you could write a patch for 5.x-2.x-dev too! :)
#9
Fixed and committed. Thanks for the patch!
#10
Automatically closed -- issue fixed for 2 weeks with no activity.