Bug 1662289 - php-pdo : PDO debugDumpParams truncate query
Summary: php-pdo : PDO debugDumpParams truncate query
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: php
Version: 7.0
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Remi Collet
QA Contact: RHEL Stacks Subsystem QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-27 10:40 UTC by Adrien D
Modified: 2021-01-14 09:27 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-06-17 11:03:58 UTC
Target Upstream Version:


Attachments (Terms of Use)
Patch to solve the problem (829 bytes, patch)
2018-12-27 13:31 UTC, Adrien D
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
PHP Bug Tracker 69356 0 None None None 2018-12-27 10:40:21 UTC

Description Adrien D 2018-12-27 10:40:21 UTC
Hello,

Description of problem:
With php-pdo on RHEL v7.6 the debugDumpParams function of PDOStatement truncate the SQL query to 500 characters.

Version-Release number of selected component (if applicable):
php-pdo-5.4.16-46.el7.x86_64

How reproducible:
Install php and php-pdo packages and select a query with more 500 characters.
My SQL query :
 $stmt = $pdo->prepare("SELECT d.id, d.numDemande, s.reference, CAST(d.saisieDate AS CHAR) as saisieDate, CAST(d.saisieHeure AS CHAR) as saisieHeure,  d.nom, d.prenom, CONCAT(a.rue1, ' ', a.rue2, ' ', a.codePostal, ' ', a.ville) AS adresse, d.dateNaissance, u.codePreleveur as prelevePar, CAST(d.demandeDate AS CHAR) as demandeDate  from silDemande d LEFT JOIN silDemandePrelevement p ON p.idDemande=d.id LEFT JOIN silPreleveur u ON p.prelevePar=u.id LEFT JOIN site s ON d.idSite=s.id LEFT JOIN silPatientAdresse a ON d.idAdresse=a.id WHERE d.demandeDate = date(adddate(now(), interval ? day)) AND u.codePreleveur='DOMI' AND d.saisieHeure > ? AND d.saisieDate=date(now()) ORDER BY d.saisieHeure ASC;");


Steps to Reproduce:
1.
2.
3.

Actual results:
SQL: [675] SELECT d.id, d.numDemande, s.reference, CAST(d.saisieDate AS CHAR) as saisieDate, CAST(d.saisieHeure AS CHAR) as saisieHeure,  d.nom, d.prenom, CONCAT(a.rue1, ' ', a.rue2, ' ', a.codePostal, ' ', a.ville) AS adresse, d.dateNaissance, u.codePreleveur as prelevePar, CAST(d.demandeDate AS CHAR) as demandeDate  from silDemande d LEFT JOIN silDemandePrelevement p ON p.idDemande=d.id LEFT JOIN silPreleveur u ON p.prelevePar=u.id LEFT JOIN site s ON d.idSite=s.id LEFT JOIN silPatientAdresse a ON d.idAd


Expected results:
SQL: [675] SELECT d.id, d.numDemande, s.reference, CAST(d.saisieDate AS CHAR) as saisieDate, CAST(d.saisieHeure AS CHAR) as saisieHeure,  d.nom, d.prenom, CONCAT(a.rue1, ' ', a.rue2, ' ', a.codePostal, ' ', a.ville) AS adresse, d.dateNaissance, u.codePreleveur as prelevePar, CAST(d.demandeDate AS CHAR) as demandeDate  from silDemande d LEFT JOIN silDemandePrelevement p ON p.idDemande=d.id LEFT JOIN silPreleveur u ON p.prelevePar=u.id LEFT JOIN site s ON d.idSite=s.id LEFT JOIN silPatientAdresse a ON d.idAdresse=a.id WHERE d.demandeDate = date(adddate(now(), interval 1 day)) AND u.codePreleveur='DOMI' AND d.saisieHeure > '13:00:00' AND d.saisieDate=date(now()) ORDER BY d.saisieHeure ASC;


Additional info:
The bug was fixed on PHP upstream : https://bugs.php.net/bug.php?id=69356

Comment 2 Adrien D 2018-12-27 13:31:58 UTC
Created attachment 1517058 [details]
Patch to solve the problem

I backported and adapted the patch from PHP 5.5.x to PHP 5.4.
I tested to rebuild SRPM php and it works on my distro.

Comment 4 Joe Orton 2020-06-17 11:03:58 UTC
This issue is resolved in RHEL8.


Note You need to log in before you can comment on or make changes to this bug.