Ticket #117 (new defect)
Informix mis calculates max length of integer fields
| Reported by: | TomChiverton | Owned by: | dhughes |
|---|---|---|---|
| Type: | defect | Priority: | highest |
| Milestone: | 1.0 Release | Component: | Reactor - DBMS Interfaces |
| Version: | Severity: | major | |
| Keywords: | spam patch | Cc: |
Description
Index: /home/chivertont/Projects/reactor/trunk/data/informix/ObjectDao.cfc
===================================================================
--- /home/chivertont/Projects/reactor/trunk/data/informix/ObjectDao.cfc (revision 3983)
+++ /home/chivertont/Projects/reactor/trunk/data/informix/ObjectDao.cfc (working copy)
@@ -99,7 +99,11 @@
<!--- field length for text fields is held as 56 in the db, but text can be 231 or space available on disk, whichever is less --->
<cfif qFields.dbDataType NEQ 12>
- <cfset Field.length = qFields.length />
+ <cfif qFields.dbDataType eq 2><!--- for integer is length in bits --->
+ <cfset Field.length = len(2((2(qFields.length+1))-1)) >
+ <cfelse>
+ <cfset Field.length = qFields.length />
+ </cfif>
<cfelse>
<cfset Field.length = 2147483648>
</cfif>

