Details
-
Type:
Bug
-
Status:
Reopened
-
Priority:
N/A
-
Resolution: Unresolved
-
Affects Version/s: 1.5.1, 1.5.2
-
Fix Version/s: None
-
Component/s: Zend_Db_Adapter_Mysqli
-
Labels:None
Description
The default quote() method of the parent class (Zend_Db_Adapter_Abstract) uses the following cast operations to ensure that the value is a valid 32-bit integer.
case Zend_Db::INT_TYPE: // 32-bit integer
return (string) intval($value);
break;
This works for signed integers, but for fields declared as UNSIGNED in MySQL, this turns valid values between 2147483648 and 4294967296 into '2147483647'.
I think a possible solution would be to add Zend_Db::UNSIGNED_TYPE type,
add
case Zend_Db::UNSIGNED_TYPE: // Unsigned integer
$quotedValue = sprintf('%u', $value);
break;
to Zend_Db_Adapter_Abstract::quote()
and implement in all adapters.
Ralph if you want I can write a patch, i'm almost done with it, but time for bed now.