Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Can't Fix
-
Affects Version/s: 2.0.3
-
Fix Version/s: None
-
Component/s: Drivers
-
Labels:None
-
Environment:System Windows NT 5.1 build 2600 (Windows XP Professional Service Pack 3) i586
Compiler MSVC6 (Visual C++ 6.0)
Apache Version Apache/2.2.17 (Win32) PHP/5.3.5
Description
trying to execute this dql:
SELECT p FROM my\namespace\entities\PQR p WHERE p.razon = 'TEL'
it built this native sql (iseries)
SELECT t0_.SGNUMÑ AS SGNUMÑ0, t0_.SGCAUS AS SGCAUS1, t0_.SGREAS AS SGREAS2 FROM SGMASTL7 t0_ WHERE t0_.SGCAUS =
because pdo is created with odbc[1], quote method[2] is not supported, and Doctrine/DBAL/Connection.php#quote()[3] method returns an empty value for <'TEL'> expression, so Database throws a Syntax error. It should be support for drivers which doesn't have implemented quote() method.
[1] with odbc: $pdo = new PDO("odbc:MY_ODBC_NAME", "USER", "PASSWORD");
[2] http://php.net/manual/en/pdo.quote.php
[3] https://github.com/doctrine/dbal/blob/2.0.3/lib/Doctrine/DBAL/Connection.php#L520
As a first trick you can use the wrapperClass parameter to the DriverManager factory and create your "MyConnection extends \Doctrine\DBAL\Connection" to solve this issue.