Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-103

Quoting is not supported in pdo_odbc driver

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major 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

        Activity

        Hide
        Benjamin Eberlei added a comment -

        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.

        Show
        Benjamin Eberlei added a comment - 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.
        Hide
        Benjamin Eberlei added a comment -

        Closed, odbc is not a supported driver.

        Show
        Benjamin Eberlei added a comment - Closed, odbc is not a supported driver.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            John Arevalo
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: