|  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: 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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
31 - 6 = ?
Subscribe to this entry?

 [2007-02-28 10:00 UTC]
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 ""; 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 ""; for $custinfo in db2-fn?('CUSTOMER.INFO') /customerinfo[addr/@country="Canada"] order by $custinfo/name return $custinfo

Reproduce code:
$pcom = new PDO("ibm:SAMPLE", "", "");

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

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

try {
} 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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-10-24 23:34 UTC]
-Package: PDO +Package: PDO_IBM
 [2021-05-03 11:55 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-05-03 11:55 UTC]
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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 04:01:28 2024 UTC