Derby
  1. Derby
  2. DERBY-2866

Improve error message when comparing user table and system table columns if collation doesn't match

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 10.3.1.4
    • Fix Version/s: None
    • Component/s: SQL
    • Labels:
      None

      Description

      If I create a database with TERRITORY_BASED collation and try to do a comparison between a user table column and a system table column, I get the following message. If I create it with UCS_BASIC collation there is no problem with the query. It makes sense to me that I can't compare these columns but I think it would be worthwhile to make a more informative error message since in fact normally comparisons between VARCHAR and VARCHAR are supported, just not comparisons between TERRITORY_BASED and UCS_BASIC.

      Kathey

      ij> connect 'jdbc:derby:enusdb;create=true;territory=en_US;collation=TERRITORY_BASED';
      ij(CONNECTION1)> create table t (vc varchar(30));
      0 rows inserted/updated/deleted
      ij(CONNECTION1)> insert into t values('t');
      1 row inserted/updated/deleted
      ij(CONNECTION1)> select tableName, vc from sys.systables, t where vc = tableName;
      ERROR 42818: Comparisons between 'VARCHAR' and 'VARCHAR' are not supported.

      Bryan suggests ...

      Can we make it say something like:

      ERROR 42818: Comparisons between 'VARCHAR(en_US)' and 'VARCHAR(UCS_BASIC)' are not supported.

      That is, sort of pack the collation information into the datatype
      name somehow?

        Issue Links

          Activity

          Hide
          Mamta A. Satoor added a comment -

          This issue is duplicate of DERBY-2668.

          Show
          Mamta A. Satoor added a comment - This issue is duplicate of DERBY-2668 .
          Hide
          Mike Matrigali added a comment -

          I think these 2 issues are duplicates.

          Show
          Mike Matrigali added a comment - I think these 2 issues are duplicates.
          Hide
          Kathey Marsden added a comment -

          found while buddy testing collation

          Show
          Kathey Marsden added a comment - found while buddy testing collation

            People

            • Assignee:
              Unassigned
              Reporter:
              Kathey Marsden
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development