Bug #79277 [NEW]: pdo_odbc accessing SAP 16.0 ASE Fatal error: Allowed memory size ...
| From: | khleung at isfactory dot com | Date: | Sat, 15 Feb 2020 15:43:54 +0000 |
| Subject: | Bug #79277 [NEW]: pdo_odbc accessing SAP 16.0 ASE Fatal error: Allowed memory size ... | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-225585@lists.php.net to get a copy of this message | ||
From: khleung at isfactory dot com
Operating system: CentOS 7
PHP version: 7.4.2
Package: PDO ODBC
Bug Type: Bug
Bug description:pdo_odbc accessing SAP 16.0 ASE Fatal error: Allowed memory size ...
Description:
------------
Having installed
php 7.4.2 on CentOS 7 1804 64-bit (3.10.0-1062.12.1.el7.x86_64) on a
VMware host :
2 GB ram, 250G HardDisk and 1 CPU Core.
PHP and necessary modules are installed via yum install php and also by
compiling using source from php-7.4.2.tar.gz
With SAP SDK for ASE binary file SDKASE160003P_7-21012007.TGZ installed
A testing script was prepared to check the connecting
It works fine to query a simple varchar(3) with
"SELECT name FROM sysusers ORDER BY uid ASC"
but it crashed :
SELECT name, environ FROM sysusers ORDER BY uid ASC
or even
SELECT top 1 name, environ FROM sysusers ORDER BY uid ASC
with following message:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to
allocate 4294967320 bytes) in /home/sybase/sybconnect1.php on line 16
sysusers table layout as follow
Column_name Type Length Prec Scale Nulls
----------- -------- ------ ---- ----- -----
suid int 4 NULL NULL 0
uid int 4 NULL NULL 0
gid int 4 NULL NULL 0
name char 30 NULL NULL 0
environ varchar 255 NULL NULL 1
user_status smallint 2 NULL NULL 0
via UnixODBC Client tool : isql
/bin/isql SB007H sa [sapassword]
all of the above query works perfectly without any error
Test script:
---------------
[sybase@nagioshost lib]$ vi sybconnect.php
<?php
//PDO Driver Connect to Sybase
try {
//$pdo = new PDO("odbc:Driver={Adaptive Server
Enterprise};NA=lx007hsyb,5000;Uid=sa;Pwd=[sapassword];");
$pdo = new PDO("odbc:SB007H", "sa", "[sapassword]");
$pdo_status = "dsn: odbc:SB007H Connected to ASE 16\n";
echo $pdo_status;
$getUsers = $pdo->prepare('SELECT name FROM sysusers ORDER BY uid
ASC');
while ($row = $stmt->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {
$data = $row[0] . "\t" . $row[1] . "\t" . $row[2] . "\n";
print $data;
}
$stmt = null;
$getUsers->execute();
$users = $getUsers->fetchAll();
if ($users) {
foreach ($users as $user) {
echo $user['name']."\n";
}
} else {
trigger_error('No users.');
}
} catch(PDOException $e) {
echo 'Connection failed: ' . $e->getMessage();
}
:wq
Expected result:
----------------
sysusers contains only 20 rows and so it was expected
All query result set can shown
Actual result:
--------------
pdo_odnc FetchAll queries with column of varchar(255) crashed
with following message:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to
allocate 4294967320 bytes) in /home/sybase/sybconnect1.php on line 16
--
Edit bug report at https://bugs.php.net/bug.php?id=79277&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79277&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79277&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79277&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79277&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79277&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79277&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79277&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79277&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79277&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79277&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79277&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79277&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79277&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79277&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79277&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79277&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79277&r=mysqlcfg