Postgres support

aaron1234nz - October 14, 2008 - 09:07
Project:Image FUpload
Version:6.x-2.0-beta3
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Thanks for writing this module. It's really sweet. I love it!!

Just a quick note on postgres support though. This module is nearly postgres compliant. The only thing holding it back is the LIMIT clauses in some of the SQL statements. Where its necessary to use query with a range, its better to use db_query_range.

#1

grandcat - October 14, 2008 - 19:03
Status:active» postponed (maintainer needs more info)

The problem is, I can't directly use db_query_range because it's important to use db_query of Drupal's API.
But where did you find some additonal LIMIT clauses in the code with two arguments? If I remember well, it's only allowed to use one argument with LIMIT to make it work with Postgre?

#2

aaron1234nz - October 15, 2008 - 10:28
Version:6.x-3.x-dev» 6.x-1.1-rc1

Hi, yes your right about the single argument for LIMIT, I just checked the docs. The only offending query in this case is this one:

Line 101 of fupload_image module
// validate given session id
$result = db_query("SELECT * FROM {sessions} WHERE sid = '%s' AND hostname = '%s' LIMIT 0 , 1", $sid, ip_address());

#3

grandcat - October 15, 2008 - 12:56
Status:postponed (maintainer needs more info)» postponed

You changed the version, so this seems only to affect rc1. I thought that I had fixed in devel, right? If true, you could use this version instead, it's quite stable at the moment. But I will also fix the rc1 candidate next time, so the fixed version will be called rc2.

#4

grandcat - October 24, 2008 - 23:06
Status:postponed» fixed

I couldn't find any further "limit" statements which aren't compatible with PostGre.

#5

grandcat - October 24, 2008 - 23:06
Version:6.x-1.1-rc1» 6.x-2.0-beta1

Fixed in 6.x-2.0-beta1.

#6

aaron1234nz - October 27, 2008 - 08:57
Version:6.x-2.0-beta1» 6.x-2.0-beta3
Status:fixed» active

I've just installed beta3 and am adapting my code to work with it. Thanks for your efforts in working on this module!

One thing I noticed however is that there is a LIMIT clause on an UPDATE statement on 165 & 188 of fimage_upload.module. Postgres only supports LIMIT clauses on SELECT statements. I don't think that the LIMIT clauses are needed because fid is a primary key so there will only be one record to update anyway.

There are also a number of LIMIT clauses on update statements on in the image_fupload_image.module that are problematic (I have not looked at image_fupload_imagefield.module)

I've just removed the LIMIT clauses from each UPDATE statement and everything is running fine.

#7

grandcat - October 30, 2008 - 19:37
Status:active» fixed

OK, it should not be critical to remove these LIMIT statements, should be fixed in CVS Head now.

#8

Anonymous (not verified) - November 13, 2008 - 19:42
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.