Home » Database » DB_DataObject » Bug #4135
_build_condition() bug?
Details
| Submitted | 2005-04-13 08:31 UTC |
|---|---|
| From | mipo at amatrica dot lt |
| Assigned | alan_k |
| Status | Closed |
| Package | DB_DataObject |
| PHP Version | 4.3.10 |
| OS | Windows 2000 |
| Roadmaps | (Not assigned) |
Comments
[2005-04-13 08:31 UTC] mipo at amatrica dot lt
Description:
------------
If last line of _build_condition() reached wrong things happen. In my case I use mysql tinyint(1) as boolean.
Line 2259 should be changed from:
$this->whereAdd(" $kSql = ".intval($v));
to:
$this->whereAdd(" $kSql = ".intval($this->$k));
I have found #2519 bug which says it is solved. But latest version from cvs doesn't solve my problem.
Reproduce code:
---------------
ini:
[mytable1]
...
myfield2 = 145
...
php:
$do = &DB_DataObject::factory('mytable1');
$do->myfield2 = true;
$do->find();
Expected result:
----------------
SELECT ... FROM mytable1 WHERE mytable1.myfield2 = 1
Actual result:
--------------
SELECT ... FROM mytable1 WHERE mytable1.myfield2 = 145