php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48038 odbc_execute changes variables used to form params array
Submitted: 2009-04-21 16:37 UTC Modified: 2009-05-01 03:07 UTC
From: szeleung dot poon at gmail dot com Assigned:
Status: Closed Package: ODBC related
PHP Version: 5.2.9 OS: Linux linux1 2.6.26-1-686 #1 SMP
Private report: No CVE-ID: None
 [2009-04-21 16:37 UTC] szeleung dot poon at gmail dot com
Description:
------------
The odbc_execute documentation says that...

Elements of this array will be converted to strings by calling this function.

However in what I encountered, more than the array is changed. Variables used to form the param array are changed as well.

Reproduce code:
---------------
<?php
header("content-type: text/plain");
require_once(dirname(__FILE__)."/config.php"); // define connect params
$odbc = odbc_connect(ODBC_DSN, Username, Password);
$b = false;
$b2 = $b;
$params = array($b2);
?>
Before odbc: <?php var_dump($b, $params); ?>
<?php odbc_execute(odbc_prepare($odbc, "SELECT ?"), $params); ?>
After odbc: <?php var_dump($b, $params); ?>


Expected result:
----------------
Before odbc: bool(false)
array(1) {
  [0]=>
  bool(false)
}
After odbc: bool(false)
array(1) {
  [0]=>
  string(0) ""
}


Actual result:
--------------
Before odbc: bool(false)
array(1) {
  [0]=>
  bool(false)
}
After odbc: string(0) ""
array(1) {
  [0]=>
  string(0) ""
}


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-01 03:07 UTC] felipe@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Fixed in 5.2.9, 5.3 and HEAD.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 07:01:29 2024 UTC