From:             teju_baba at hotmail dot com
Operating system: Solaris 10
PHP version:      5.2.6
PHP Bug Type:     OCI8 related
Bug description:  memory leak in select statement for varchar2 above 2000 
characters

Description:
------------
Client: Solaris 10 / Sparc
PHP 5.2.3 / 5.2.5 / 5.2.6 
OCI 1.2.3 / 1.3.3
Instant Client: 10.1
Oracle 10g Enterprise Edition: 10.1.0.3

TABLE AGENCY SCHEMA
AGENCY_ID NUMBER, AGENCY_NAME VARCHAR2(60), AGENCY_TYPE VARCHAR2(1) ,
AGENCY_ABBR VARCHAR2(10) , ADMIN_HIST VARCHAR2(2000),
DATE_UPDATED DATE 

A simple query like select * from agency where agency_id=40 produces an
overflow at either oci_execute() or oci_fetch_assoc()

Result is garbage for ADMIN_HIST and overflows on to DATE_UPDATED.

For similar queries, the query may or may not return a row.
Say: select * from agency where agency_id=54 returns NULL when there is
valid data.




Reproduce code:
---------------
$conn = oci_connect('user', 'pwd', '//10.203.2.14/db');
$query="select * from agency where agency_id=40";
$stid = oci_parse($conn, $query);
$r = oci_execute($stid, OCI_DEFAULT);
while ($row = oci_fetch_assoc($stid)) { 
print_r($row);
}
oci_close($conn);

Expected result:
----------------
xl*
[DATE_UPDATED] => 00-DECEMBER-00

the words xl * are garbage characters
the DATE_UPDATED is invalid (actual date is: 11-APR-08)





Actual result:
--------------
Array
(
[AGENCY_ID] => 40
[AGENCY_NAME] => City Council
[AGENCY_TYPE] => A
[AGENCY_ABBR] => CC
[ADMIN_HIST] => The Municipal Council became known as the City Council on
22 September 1951. The City Council, the local authority within the city
area, consisted of a President appointed by the Governor-in-Council and 27
members of whom 18 were elected.

The City Council enjoyed a wide measure of autonomy in matters placed
under its control by the Municipal Ordinance and was empowered to make
by-laws but was subjected to certain safeguards. The detailed execution of
City Council policies was undertaken by specialised departments concerned
with health, water, electricity and so forth.

Under the Local Government Ordinance of 1957, the administration of the
city area for all local government purposes was the responsibility of a
City Council of 32 elected Councillors.In July 1959, the government
absorbed the City Council into the central government and most of its
functions were transferred to the Ministry of National Development.xl*
[DATE_UPDATED] => 00-DECEMBER-00
)


-- 
Edit bug report at http://bugs.php.net/?id=45497&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=45497&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=45497&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=45497&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45497&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=45497&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45497&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45497&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45497&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45497&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45497&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=45497&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=45497&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45497&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45497&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45497&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45497&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45497&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45497&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45497&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45497&r=mysqlcfg

Reply via email to