The Trac on reactorframework.org appears to be running really slowly, and the 
bug list I did get included several spam tickets.

So, in leu of Trac:

We recently noticed that our Informix adapter doesn't handle composite primary 
keys- it reports the table as having primary keys, but only includes the 
first key from a composite. Obviously single primary key tables are fine.
This causes all sorts of fun when you try and use a table with composite 
primary keys, updates you don't expect etc.

Here is a patch to fix this defect:

Index: trunk/data/informix/ObjectDao.cfc
===================================================================
--- trunk/data/informix/ObjectDao.cfc   (revision 5347)
+++ trunk/data/informix/ObjectDao.cfc   (working copy)
@@ -37,21 +37,21 @@
                                
                <!--- this is taken from Perls Informix class 
http://search.cpan.org/src/JSTOWE/Class-DBI-Loader-Informix-0.02/lib/Class/DBI/Informix.pm
 --->
                <cfquery name="qPrimary" datasource="#getDsn()#" 
username="#getUsername()#" 
password="#getPassword()#">
-               SELECT p1.colname,
-       p2.colname,
-       p3.colname,
-       p4.colname,
-       p5.colname,
-       p6.colname,
-       p7.colname,
-       p8.colname,
-       p9.colname,
-       p10.colname,
-       p11.colname,
-       p12.colname,
-       p13.colname,
-       p14.colname,
-       p15.colname
+               SELECT p1.colname as col1,
+       p2.colname as col2,
+       p3.colname as col3,
+       p4.colname as col4,
+       p5.colname as col5,
+       p6.colname as col6,
+       p7.colname as col7,
+       p8.colname as col8,
+       p9.colname as col9,
+       p10.colname as col10,
+       p11.colname as col11,
+       p12.colname as col12,
+       p13.colname as col13,
+       p14.colname as col14,
+       p15.colname as col15
                 from sysconstraints
                join systables
                on sysconstraints.tabid = systables.tabid
@@ -90,7 +90,7 @@
                        <!--- identity is MSSQL for 'auto-increment', Informix 
calls 
these 'serial'--->
                        <cfset Field = StructNew() />
                        <cfset Field.name = qFields.name />
-                       <cfset Field.primaryKey = 
isThisFieldCalled(qPrimary.colname,qFields.name) />
+                       <cfset Field.primaryKey = 
isThisFieldInPrimarykeyList(qPrimary,qFields.name) />
                        <cfset Field.identity = isDbType6(qFields.identity) />
                        <cfset Field.nullable = is3rdBitNot1(qFields.nullable) 
/>
                        <cfset Field.dbDataType = qFields.dbDataType />
@@ -275,12 +275,18 @@
                <cfreturn 'false'>
        </cffunction>
        
-       <cffunction name="isThisFieldCalled" access="private" output="false" 
returntype="any" _returntype="string">
+       <cffunction name="isThisFieldInPrimarykeyList" access="private" 
output="false" returntype="any" _returntype="string">
                <cfargument name="a" required="true" type="any" _type="string">
                <cfargument name="b" required="true" type="any" _type="string">
-               <cfif a is b>
-                       <cfreturn 'true'>
+               <cfset var i=0>
+               <cfif a.recordCount eq 0>
+                       <cfreturn 'false'>
                </cfif>
+               <cfloop from="1" to="15" index="i">
+                       <cfif a["col#i#"][1] is b>
+                               <cfreturn 'true'>
+                       </cfif>
+               </cfloop>
                <cfreturn 'false'>
        </cffunction>
 

-- 
Tom Chiverton
Helping to synergistically disseminate magnetic IPOs
on: http://thefalken.livejournal.com

****************************************************

This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and 
Wales under registered number OC307980 whose registered office address is at 
Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB.  A list 
of members is available for inspection at the registered office. Any reference 
to a partner in relation to Halliwells LLP means a member of Halliwells LLP.  
Regulated by The Solicitors Regulation Authority.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be 
confidential or legally privileged.  If you are not the addressee you must not 
read it and must not use any information contained in nor copy it nor inform 
any person other than Halliwells LLP or the addressee of its existence or 
contents.  If you have received this email in error please delete it and notify 
Halliwells LLP IT Department on 0870 365 2500.

For more information about Halliwells LLP visit www.halliwells.com.


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[EMAIL PROTECTED]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply via email to