Rewrite name unique check so it is cross-database compatible

neilnz - April 1, 2009 - 21:33
Project:Email Registration
Version:6.x-1.1
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Description

Hi,

I wanted to use this module on Postgres, but your SQL query to fetch the next sequence number is MySQL-specific.

Patch attached for Postgres support.

Thanks

AttachmentSize
email_registration.module.patch1.36 KB

#1

greggles - June 9, 2009 - 00:42
Title:PostgreSQL support (patch)» PostgreSQL support for email_registration (patch)
Status:active» needs review

I don't have a test bed for this, but here's a better status ;)

#2

greggles - June 10, 2009 - 12:15
Title:PostgreSQL support for email_registration (patch)» Rewrite name unique check so it is cross-database compatible
Status:needs review» needs work

This is not a real solution to the problem because it uses a switch. We should use standard sql.

As far as I can tell, this code is trying to find 1) if the name is unique, 2) if not, what is the highest "index" for the name. While it may be slightly slower, we should be able to do more of this in php and make it cross-database compatible.

 
 

Drupal is a registered trademark of Dries Buytaert.