Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-34

Policy for case-sensitivity of identifiers should be configurable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      Currently Optiq uses the same case-sensitivity policy as Oracle. If you do not quote an identifier, it is converted to upper-case. If you want to use an already defined object, the match is case-sensitive.

      For example:

      CREATE TABLE emp ...; // creates a table called "EMP"
      SELECT * FROM EMP; // succeeds
      SELECT * FROM "EMP"; // succeeds
      SELECT * FROM "emp"; // fails
      SELECT * FROM emp; // succeeds

      Other databases have different policies than Oracle. As in https://github.com/julianhyde/optiq/issues/33, people would like Optiq to behave like their favorite database, so policy should be configurable.

      The following JDBC methods (in [java.sql.DatabaseMetaData|http://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.html)) define policy:

      boolean supportsMixedCaseIdentifiers() throws SQLException;
      boolean storesUpperCaseIdentifiers() throws SQLException;
      boolean storesLowerCaseIdentifiers() throws SQLException;
      boolean storesMixedCaseIdentifiers() throws SQLException;
      boolean supportsMixedCaseQuotedIdentifiers() throws SQLException;
      boolean storesUpperCaseQuotedIdentifiers() throws SQLException;
      boolean storesLowerCaseQuotedIdentifiers() throws SQLException;
      boolean storesMixedCaseQuotedIdentifiers() throws SQLException;
      String getIdentifierQuoteString() throws SQLException;
      String getExtraNameCharacters() throws SQLException;

      Not all combinations of those settings make sense, obviously. :]

      ---------------- Imported from GitHub ----------------
      Url: https://github.com/julianhyde/optiq/issues/34
      Created by: julianhyde
      Labels: enhancement,
      Created at: Tue Apr 02 23:20:32 CEST 2013
      State: closed

        Activity

        Hide
        github-import GitHub Import added a comment -

        [Date: Sun Jan 19 05:51:17 CET 2014, Author: julianhyde]

        @visi I was thinking of creating named "policies" for case-sensitivity. The current policy (unquoted identifiers become upper case, quoted identifiers retain case, matching is case sensitive, and use double-quote to quote identifiers) would be called "oracle". For you we could create a policy called "java" (unquoted identifiers retain case, matching is case-sensitive, back-tick as quote character if you really really insist on creating an identifier with punctuation in it).

        Show
        github-import GitHub Import added a comment - [Date: Sun Jan 19 05:51:17 CET 2014, Author: julianhyde ] @visi I was thinking of creating named "policies" for case-sensitivity. The current policy (unquoted identifiers become upper case, quoted identifiers retain case, matching is case sensitive, and use double-quote to quote identifiers) would be called "oracle". For you we could create a policy called "java" (unquoted identifiers retain case, matching is case-sensitive, back-tick as quote character if you really really insist on creating an identifier with punctuation in it).

          People

          • Assignee:
            Unassigned
            Reporter:
            github-import GitHub Import
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development