PEAR is archived and read-only

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

Home » Database » DB » Bug #811

Change to DB 1.6.0 Breaks Informix BC

Details

Submitted2004-02-20 14:47 UTC
Fromjkaufman at wamnetgov dot com
Assigneddanielc
StatusBogus
PackageDB
PHP Version4.3.4
OSLinux, Mandrake 9.1
Roadmaps(Not assigned)

Comments

[2004-02-20 14:47 UTC] jkaufman at wamnetgov dot com

Description:
------------
fetchRow for Informix starts at 1, rather than the expected 0. Code has been written that anticpates this behaviour, and adjusts for it. The latest version of DB (1.6.0) corrects for this behaviour and breaks backward compatibility with existing programs.

Reproduce code:
---------------
/* MySQL fetches rows beginning from 0, Informix starts at 1 */

if ($dbengine=='ifx') { $iRowOffset++; }
if ($iRowTotal) {
$res = $dbh->limitQuery($sql, $iRowOffset, $iRowLimit);
}
$row = $res->fetchRow(DB_FETCHMODE_ASSOC, $iRowOffset);

Expected result:
----------------
Without the adjustment to the row offset, then the first two rows that are retrieved are the same. With the adjustment, the correct rows are returned.

[2004-02-20 15:11 UTC] jkaufman at wamnetgov dot com

My scripts currently compensate for the older behaviour
and will break if I update to the latest DB. I can change
my scripts, but I would have a different problem if the
script ran on an older version of DB.

Since I can't always control the DB version on all
production systems, I need a way to determine the version
and handle it that way (preferred), OR have an option to
maintain backward compatibility as Lukas suggested.