PEAR is archived and read-only

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

Home » Database » MDB2 » Bug #8239

MDB2_PORTABILITY_RTRIM ignored by driver

Details

Submitted2006-07-18 14:22 UTC
Fromale dot pas at tiscali dot it
Assignedlsmith
StatusClosed
PackageMDB2
PHP Version5.1.2
OSlinux
Roadmaps(Not assigned)

Comments

[2006-07-18 14:22 UTC] ale dot pas at tiscali dot it

Description:
------------
option MDB2_PORTABILITY_RTRIM seems to be ignored
by pgsql driver, in line 915 of file MDB2/Driver/pgsql.php there is a line like this,

if ($this->db->options['portability'] & MDB2_PORTABILITY_EMPTY_TO_NULL)
{
$this->db->_fixResultArrayValues($row,
MDB2_PORTABILITY_EMPTY_TO_NULL);
}

I believe it should pass control to _fixResultArrayValues also when MDB2_PORTABILITY_RTRIM is set.

This works for me (but maybe breaks somewhere else):

if ($this->db->options['portability'] &
(MDB2_PORTABILITY_EMPTY_TO_NULL | MDB2_PORTABILITY_RTRIM )) {
$this->db->_fixResultArrayValues($row,
$this->db->options['portability']);
}

Test script:
---------------
http://elpaso.homelinux.org/pear_bug.txt

Expected result:
----------------
array
'driver_id' => '1' (length=1)
'driver' => 'GD/Gif' (length=6)
'tstamp' => '2004-04-01 12:00:00' (length=19)

Actual result:
--------------
array
'driver_id' => '1' (length=1)
'driver' => 'GD/Gif ' (length=50)
'tstamp' => '2004-04-01 12:00:00' (length=19)