Add all groups doesn't work in postgres (patch attached)

halcyonCorsair - September 30, 2009 - 22:21
Project:OG Contact
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Issue tags:PostgreSQL
Description

You need to use 's to quote in queries instead of "s or the query won't work in postgres. Also %d's don't need to be quoted.

- db_query('INSERT INTO {og_contact} (gid, reply, notpublic) VALUES ("%d","%s", "%d")', $gid->nid, "", $notpublic);
+ db_query("INSERT INTO {og_contact} (gid, reply, notpublic) VALUES (%d,'%s', %d)", $gid->nid, "", $notpublic);

AttachmentSize
og_contact-add_all_groups-sql_fix.patch1.81 KB

#1

gnat - October 15, 2009 - 15:28
Status:active» reviewed & tested by the community

Thanks for the patch. It patches cleanly, and doesn't seem to break anything.

I took a quick look over all the calls to db_query(), and those seem to be the only offending lines.

Leaving this issue open until I commit the change.

#2

gnat - October 18, 2009 - 20:16
Status:reviewed & tested by the community» fixed

Should be fixed in the 6.x dev version dated later than: 2009-Oct-16. Thanks again halcyonCorsair for the patch.

#3

System Message - November 1, 2009 - 20:20
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.