Support for PostgreSQL <8.2

maikeru - May 27, 2009 - 00:44
Project:Vocabulary Index
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

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

AttachmentSize
postgres8_1.patch1004 bytes

#1

mig5 - August 13, 2009 - 04:17

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.

AttachmentSize
473772.patch 991 bytes

#2

Xano - August 25, 2009 - 00:58

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

#3

Xano - August 25, 2009 - 00:59
Status:active» needs review

#4

Xano - August 25, 2009 - 00:59
Priority:normal» critical

Yes, it is *very* late.

#5

maikeru - August 25, 2009 - 03:28

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

Xano - August 25, 2009 - 08:33

Does the test also throw that error without the patch?

#7

maikeru - August 26, 2009 - 06:10

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.

AttachmentSize
vocab-index-simpletest-postgres.jpg 272.07 KB

#8

Xano - September 12, 2009 - 18:59

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

#9

Xano - October 11, 2009 - 13:36
Title:Support for Postgres 8.1» Support for PostgreSQL <8.2
Status:needs review» fixed

Fixed and committed. Thanks for the patch!

#10

System Message - October 25, 2009 - 13:40
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.