Home » Database » DB » Bug #436
IBase - The memory could not be "read"
Details
| Submitted | 2003-12-16 12:56 UTC |
|---|---|
| From | joel at memory dot com dot br |
| Assigned | danielc |
| Status | Bogus |
| Package | DB |
| PHP Version | 4.3.2 |
| OS | Windows 2000 |
| Roadmaps | (Not assigned) |
Comments
[2003-12-16 12:56 UTC] joel at memory dot com dot br
Description:
------------
The memory could not be "read"
Reproduce code:
---------------
$user = 'SYSDBA';
$pass = 'masterkey';
$host = '192.168.1.100';
$db_name = '/dbs/counts.gdb';
// Data Source Name: This is the universal connection string
$dsn = "ibase://$user:$pass@$host/$db_name";
$db = DB::connect($dsn, "FALSE");
$sql = "SELECT nam_client FROM clients";
$result = $db->query($sql);
Expected result:
----------------
I have the structure above. when twirling the program through browser, I receive a window pop-up from the apache with the following error: - the instruction in "0x100bf794" made reference in "0x45440005". The memory could not be "read"
Actual result:
--------------
I have the structure above. when twirling the program through browser, I receive a window pop-up from the apache with the following error: - the instruction in "0x100bf794" made reference in "0x45440005". The memory could not be "read"
[2004-02-25 00:26 UTC] webmaster at retroline dot ru
The same code seems to crash php under Unix too. It gives "Segmentation Fault" error.
[2004-10-13 04:46 UTC] reza_prima77 at yahoo dot com
Same here. I'm using Debian linux. PHP 4.3.9. Latest
PEAR::DB. Apache 1.3.7
[2004-12-07 21:27 UTC] wagnerric at ccow dot cxo dot cpqcorp dot net
Supply a dialect in your DSN. Line 114 of DB/ibase.php says:
$params[] = isset($dsninfo['dialect']) ? $dsninfo['dialect'] : null;
Changing it to something reasonable:
$params[] = isset($dsninfo['dialect']) ? dsninfo['dialect'] : 2;
clears the problem. Seems that the call:
$conn = @call_user_func_array($connect_function, $params);
doesn't like it when dialect is passed as a null.
[2004-12-07 21:39 UTC] wagnerric at ccow dot cxo dot cpqcorp dot net
To explain my last comment fuller:
You could use a dsn array, supplying a dialect:
$dsn = array(
'phptype' => 'ibase',
'hostspec' => '192.168.1.100',
'database' => '/dbs/counts.gdb',
'username' => 'SYSDBA',
'password' => 'masterkey',
'dialect' => 3);
or a single line dsn, with parameters:
$dsn = "ibase://$user:$pass@$host/$db_name?dialect=2";
The code in the message is from the PEAR DB::ibase source, and could be modified, using the shown default. Dialect 2 is a reasonable default. 3 works too, and is the current dialect level for Interbase > 5 (I think), and all versions of Firebird.