PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » DB_DataObject » Bug #4135

_build_condition() bug?

Details

Submitted2005-04-13 08:31 UTC
Frommipo at amatrica dot lt
Assignedalan_k
StatusClosed
PackageDB_DataObject
PHP Version4.3.10
OSWindows 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