Details

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

      Description

      https://github.com/doctrine/dbal/pull/66

      Schema processing for SQLite is broken in a number of common situations. These patches fix handling of the following:

      String column defaults: For columns with a default value that is a string, SQLite returns them wrapped in single quotes. Doctrine does not strip these, so it would treat a value "foobar" as "'foobar'" (with single quotes as part of the value).
      Auto-increment: SQLite handling of auto-increment is unusual. In particular, it supports it only on an integer column which is the sole primary key for a table. In addition, it will automatically increment values of an integer primary key column regardless of whether it has been defined as autoincrement BUT, unlike autoincrement, these values are not guaranteed to be unique.
      Most problematically, there is no way (without parsing the "create" statements stored in sqlite_master) to determine whether a column is marked as auto-incrementing. Doctrine was treating SQLite integer primary keys as auto-incrementing, but this is not correct and does not work for composite primary keys.
      Composite primary keys: As a side-effect of Doctrine treating integer primary keys in SQLite as auto-incrementing and of how SQLite requires autoincrement and primary keys to be declared, it would generate invalid create statements for composite keys in SQLite.
      Special indexes: SQLite sometimes automatically generates indexes, which Doctrine treated the same as any other. Because they are internal, however, their names are reserved, so they could not be used to recreate the same index and, since they are automatic, they aren't actually a part of the defined schema.

      I've added to the tests to catch these situations in the future as well.

        Activity

        Benjamin Eberlei created issue -
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 13280 ] jira-feedback2 [ 17768 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 17768 ] jira-feedback3 [ 20123 ]

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

          People

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

            Dates

            • Created:
              Updated:
              Resolved: