Uploaded image for project: 'Doctrine 2 - ORM'
  1. Doctrine 2 - ORM
  2. DDC-1360

Reserved words escaping fails when using multiple reserved words

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.2-BETA2, 2.2
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None
    • Environment:
      Linux, PostgreSQL

      Description

      Everything works fine when I use the @Table annotation like this: @Table(name="`user`"). But when the user table is in the user schema and I try to use the annotion in this way: @Table(name="`user`.`user`") — everything falls apart.

      A quick look into the code showed that it checks if the table name starts with `, and if it does, it sets the quoted parameter to true and removes the ` characters on the both sides. So, if I quote the both words like @Table(name="`user`.`user`"), the table name becomes "user`.`user" and it, of course, fails. If I quote it just like @Table(name="`user.user`"), the table name becomes "user.user", which fails too.

      If Doctrine allows to escape the reserved words, it should take into account this kind of usage as well.

        Activity

        elnur Elnur Abdurrakhimov created issue -
        beberlei Benjamin Eberlei made changes -
        Field Original Value New Value
        Assignee Benjamin Eberlei [ beberlei ] Guilherme Blanco [ guilhermeblanco ]
        beberlei Benjamin Eberlei made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.2-DEV [ 10157 ]
        Resolution Fixed [ 1 ]
        elnur Elnur Abdurrakhimov made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        beberlei Benjamin Eberlei made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        elnur Elnur Abdurrakhimov made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        beberlei Benjamin Eberlei made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        beberlei Benjamin Eberlei made changes -
        Fix Version/s 2.2-BETA2 [ 10188 ]
        beberlei Benjamin Eberlei made changes -
        Workflow jira [ 12994 ] jira-feedback [ 15016 ]
        beberlei Benjamin Eberlei made changes -
        Workflow jira-feedback [ 15016 ] jira-feedback2 [ 16880 ]
        beberlei Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 16880 ] jira-feedback3 [ 19133 ]

          People

          • Assignee:
            guilhermeblanco Guilherme Blanco
            Reporter:
            elnur Elnur Abdurrakhimov
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: