Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-96

Make approach towards identifier quoting consistent

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 2.5
    • Component/s: Platforms, Schema Managers
    • Labels:
      None

      Description

      • Make the use of `` a general approach for explicit quoting of identifiers
      • introduce AbstractPlatform::getRegularSQLIdentifierCase($identifier)
      • Introduce AbstractPlatform::isRegularIdentifier($identifier)
      • Fix Schema Assets not to lower-case, but to check for explicit quoting before.
      • Filter values of identifiers passed to all platform functions when they are used in information schema queries according to `` explicit quoting rules.

      Problem: Schema is independent of a vendor, this means we have to pick a behavior, i propose SQL-92

      This means:

      • strtoupper() ALL tables, column, index, foreign key names that are not quoted by ``
      • For any Quoted identifiers by `` the case is kept.
      • We can introduce a validator to detect a schema that cannot be implemented with a given vendor platform.

      In conjunction with the SQL reserved keywords tickets we can then improve the DatabaseDriver considerably to detect identifier casings

        Issue Links

          Activity

          Benjamin Eberlei created issue -
          Benjamin Eberlei made changes -
          Field Original Value New Value
          Link This issue relates to DBAL-45 [ DBAL-45 ]
          Benjamin Eberlei made changes -
          Link This issue is duplicated by DBAL-120 [ DBAL-120 ]
          Benjamin Eberlei made changes -
          Link This issue is referenced by DBAL-40 [ DBAL-40 ]
          Benjamin Eberlei made changes -
          Fix Version/s 2.1.1 [ 10156 ]
          Fix Version/s 2.1 [ 10068 ]
          Benjamin Eberlei made changes -
          Fix Version/s 2.1.2 [ 10160 ]
          Fix Version/s 2.1.1 [ 10156 ]
          Benjamin Eberlei made changes -
          Fix Version/s 2.1.3 [ 10162 ]
          Fix Version/s 2.1.2 [ 10160 ]
          Benjamin Eberlei made changes -
          Fix Version/s 2.2 [ 10142 ]
          Fix Version/s 2.1.3 [ 10162 ]
          Guilherme Blanco made changes -
          Fix Version/s 2.3 [ 10184 ]
          Fix Version/s 2.2 [ 10142 ]
          Benjamin Eberlei made changes -
          Workflow jira [ 12431 ] jira-feedback2 [ 17569 ]
          Benjamin Eberlei made changes -
          Workflow jira-feedback2 [ 17569 ] jira-feedback3 [ 19923 ]
          Benjamin Eberlei made changes -
          Fix Version/s 2.4 [ 10320 ]
          Fix Version/s 2.3 [ 10184 ]
          Benjamin Eberlei made changes -
          Fix Version/s 2.5 [ 10523 ]
          Fix Version/s 2.4 [ 10320 ]
          Hide
          Steve Müller added a comment -

          Benjamin Eberlei this is an interesting approach and I like it. But I have some complaints about it.
          1. I doubt users will be happy about forced default casing rules (ALL upper or ALL lower). Therefore we should think about adding a simple configuration option in DBAL allowing to override the default casing behaviour to the user's preference.
          2. Using a consistent default casing means we ALWAYS have to quote identifiers as otherwise the underlying database could silently change the case again (don't know if this is an issue).
          3. Introducing this approach in 2.x branch is a BC break as it breaks users' mixed-case identifier mappings.

          For 2.x we should maybe at least make use of Identifier class throughout the platforms where necessary.

          Show
          Steve Müller added a comment - Benjamin Eberlei this is an interesting approach and I like it. But I have some complaints about it. 1. I doubt users will be happy about forced default casing rules (ALL upper or ALL lower). Therefore we should think about adding a simple configuration option in DBAL allowing to override the default casing behaviour to the user's preference. 2. Using a consistent default casing means we ALWAYS have to quote identifiers as otherwise the underlying database could silently change the case again (don't know if this is an issue). 3. Introducing this approach in 2.x branch is a BC break as it breaks users' mixed-case identifier mappings. For 2.x we should maybe at least make use of Identifier class throughout the platforms where necessary.
          Steve Müller made changes -
          Link This issue relates to DBAL-477 [ DBAL-477 ]

          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-96, 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:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: