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: 2017-10-24 23:34 UTC
From: kfbombar@php.net Assigned:
Status: Open 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
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Dec 12 18:01:24 2019 UTC