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
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 !
Your email address:
MUST BE VALID
Solve the problem:
3 + 38 = ?
Subscribe to this entry?

 
 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 14 09:01:27 2024 UTC