Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-552

Colon (":") in field name treats like query parameter

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5, 2.4.2
    • Component/s: None
    • Security Level: All
    • Labels:
      None
    • Environment:
      MySQL

      Description

      The colon sign (":") is permitted for columns' name but Doctrine treats them like parameters placeholder:

      SELECT `d.ns:col_name` FROM my_table d WHERE `d.date` >= :param1
      

      causes DBALException:

      An exception occurred while executing 'SELECT `d.ns:col_name` FROM my_table d WHERE `d.date` >= :param1' with params ["2013-06-24 14:22:18"]: Value for :col_name not found in params array. Params array key should be "col_name"
      

        Issue Links

          Activity

          Daniel Bojdo created issue -
          Daniel Bojdo made changes -
          Field Original Value New Value
          Description The colon sign (":") is permitted for columns' name but Doctrine treats them like parameters placeholder:

          SELECT `d.ns:col_name` FROM my_table d WHERE `d.date` >= :param1

          causes DBALException:
          An exception occurred while executing 'SELECT `d.ns:col_name` FROM my_table d WHERE `d.date` >= :param1' with params ["2013-06-24 14:22:18"]: Value for :col_name not found in params array. Params array key should be "col_name"
          The colon sign (":") is permitted for columns' name but Doctrine treats them like parameters placeholder:
          {noformat}
          SELECT `d.ns:col_name` FROM my_table d WHERE `d.date` >= :param1
          {noformat}
          causes DBALException:
          {noformat}
          An exception occurred while executing 'SELECT `d.ns:col_name` FROM my_table d WHERE `d.date` >= :param1' with params ["2013-06-24 14:22:18"]: Value for :col_name not found in params array. Params array key should be "col_name"
          {noformat}
          Hide
          Benjamin Eberlei added a comment -

          does this work with plain PDO?

          Show
          Benjamin Eberlei added a comment - does this work with plain PDO?
          Hide
          Daniel Bojdo added a comment - - edited

          Yes, it works perfectly fine with PDO. It also works properly with Doctrine\DBAL\Connection.
          I suppose there's a bug somewhere in QueryBuilder.

          Show
          Daniel Bojdo added a comment - - edited Yes, it works perfectly fine with PDO. It also works properly with Doctrine\DBAL\Connection. I suppose there's a bug somewhere in QueryBuilder.
          Steve Müller made changes -
          Link This issue is referenced by DBAL-624 [ DBAL-624 ]
          Steve Müller made changes -
          Assignee Benjamin Eberlei [ beberlei ] Steve Müller [ deeky666 ]
          Steve Müller made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          Steve Müller added a comment -
          Show
          Steve Müller added a comment - Patch supplied in PR: https://github.com/doctrine/dbal/pull/477
          Hide
          Doctrine Bot added a comment -

          A related Github Pull-Request [GH-477] was closed:
          https://github.com/doctrine/dbal/pull/477

          Show
          Doctrine Bot added a comment - A related Github Pull-Request [GH-477] was closed: https://github.com/doctrine/dbal/pull/477
          Benjamin Eberlei made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Fix Version/s 2.3.5 [ 10520 ]
          Fix Version/s 2.5 [ 10523 ]
          Fix Version/s 2.4.2 [ 10620 ]
          Resolution Fixed [ 1 ]
          Guilherme Blanco made changes -
          Fix Version/s 2.3.5 [ 10520 ]

          This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

          • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DBAL-552, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

            People

            • Assignee:
              Steve Müller
              Reporter:
              Daniel Bojdo
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: