php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57552 XQuery statement is being parsed incorrectly by PDO
Submitted: 2007-02-28 10:00 UTC Modified: 2021-05-16 04:22 UTC
From: kfbombar@php.net Assigned: cmb (profile)
Status: No Feedback Package: PDO_IBM (PECL)
PHP Version: 5.2.1 OS: Linux/Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kfbombar@php.net
New email:
PHP Version: OS:

 

 [2007-02-28 10:00 UTC] kfbombar@php.net
Description:
------------
We are trying to prepare and execute a XQuery statement but PDO is parsing the statement incorrectly when passed to pdo_parse_params.  The following XQuery:

XQUERY declare default element namespace "http://posample.org"; for $custinfo in db2-fn:xmlcolumn('CUSTOMER.INFO') /customerinfo[addr/@country="Canada"] order by $custinfo/name return $custinfo

is getting parsed incorrectly to the following statement:

XQUERY declare default element namespace "http://posample.org"; for $custinfo in db2-fn?('CUSTOMER.INFO') /customerinfo[addr/@country="Canada"] order by $custinfo/name return $custinfo



Reproduce code:
---------------
<?php
$pcom = new PDO("ibm:SAMPLE", "", "");

$query = "XQUERY declare default element namespace \"http://posample.org\"; for \$custinfo in db2-fn:xmlcolumn('CUSTOMER.INFO') /customerinfo[addr/@country=\"Canada\"] order by \$custinfo/name return \$custinfo";


$stmt = $pcom->prepare($query);

try {
  $stmt->execute();
} catch(exception $e) {
  echo "Issue\n";
}
?>


Expected result:
----------------
Row output from the execute that is populated in the db2sampl database.

Actual result:
--------------
Fatal error: Call to a member function execute() on a non-object in /home/pd/kfbombar/nacon/work/php/PDO_IBM-1.1.0/now.php on line 10


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-10-24 23:34 UTC] kalle@php.net
-Package: PDO +Package: PDO_IBM
 [2021-05-03 11:55 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-05-03 11:55 UTC] cmb@php.net
Is this still an issue with the latest PDO_IBM (1.4.1)?
 [2021-05-16 04:22 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Sep 24 19:03:38 2021 UTC