Uploaded image for project: 'Doctrine 1'
  1. Doctrine 1
  2. DC-1027

CLONE -Foreign key creation fails with MySQL 5.1.54


    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Invalid
    • Affects Version/s: 1.2.0
    • Fix Version/s: None
    • Component/s: Import/Export
    • Labels:
    • Environment:
      gentoo, MySQL 5.0.44-log, Doctrine 1.2, symfony 1.4.4


      Hi there,

      When executing symfony doctrine:build --all --and-load on a machine using Mysql 5.0.44 I get the following error:

      SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'dimension(id)' at line 1. Failing Query: "ALTER TABLE kpi_dimension ADD CONSTRAINT kpi_dimension_dimension_id_dimension_id FOREIGN KEY (dimension_id) REFERENCES dimension(id)".

      The problem can be fixed by adding a space between the table name and the column name that is referenced. So instead of
      REFERENCES dimension(id)
      it should be
      REFERENCES dimension (id)

      Since it works fine on MySQL 5.1.37, I normally would file this under Mysql bug. But as the syntax for a foreign key constraint in MySQL mentions this space it should be ok to simply add the space to the script creating the sql for the foreign key. I have not tried any other DBMS though.

      The patch for the file Export.php is attached.

      Best regards



        frecon Frej Connolly created issue -
        frecon Frej Connolly made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Invalid [ 6 ]

        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={expand=changesets[0:20].revisions[0:29],reviews, query=DC-1027}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)


          • Assignee:
            jwage Jonathan H. Wage
            frecon Frej Connolly
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: