Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-555

Table name is not quoted despite being a reserved word and being quoted in the annotation

    Details

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

      Description

      When a reserved word is used as a table name the migration does half the job as far as the quoting is concerned.

      The generated statement for the creation of the table doesn't work.
      It generated:

       
      CREATE TABLE Order .... # without quoting.
      

      But when the table name is a reference in a foreign key it's ok.

       
      ALTER TABLE Orders_Domains ADD CONSTRAINT FK_7FD78CA28D9F6D38 FOREIGN KEY (order_id) REFERENCES `Order` (id)
      
       
      /**
       * @ORM\Table(name="`Order`")
       * @ORM\Entity
       */
      class Order
      {
      }
      

      I suppose that at some point the table name is unquoted but I didn't find out where.

        Activity

        Hide
        Steve Müller added a comment -

        Can you please tell which platform/driver you are using? Also the DBAL version would help tracking this down. But there has been done a lot of work concerning identifier quotation in the last months already so maybe this is already solved by 2.4?
        Can you please reinvestigate? Thanks.

        Show
        Steve Müller added a comment - Can you please tell which platform/driver you are using? Also the DBAL version would help tracking this down. But there has been done a lot of work concerning identifier quotation in the last months already so maybe this is already solved by 2.4? Can you please reinvestigate? Thanks.
        Hide
        mikeSimonson added a comment -

        Hi,

        I was using doctrine-migration with the dbal 2.3.4.
        How can I test for that before doctrine migration upgrade to the dbal 2.4

        Thanks

        Show
        mikeSimonson added a comment - Hi, I was using doctrine-migration with the dbal 2.3.4. How can I test for that before doctrine migration upgrade to the dbal 2.4 Thanks

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            mikeSimonson
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: