Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-744

[GH-477] [DBAL-552] Fix parsing backtick quoted statement fragments in SQLParserUtils

    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

      Description

      This issue is created automatically through a Github pull request on behalf of deeky666:

      Url: https://github.com/doctrine/dbal/pull/477

      Message:

      MySQL uses backtick for identifier quotation. The `SQLParserUtils` treats statements with quoted identifiers that contain a colon as named parameter which is wrong.

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

      *Throws exception*
      ```
      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"
      ```

      This PR adds the backtick character to the recognized quote characters when retrieving unquoted statement fragments.

        Activity

        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

          People

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

            Dates

            • Created:
              Updated:
              Resolved: