Derby
  1. Derby
  2. DERBY-5168

Wrong syntax in identifier chain returned by SynonymAliasInfo.toString()

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 10.7.1.1
    • Fix Version/s: 10.8.1.2
    • Component/s: SQL
    • Labels:
      None

      Description

      SynonymAliasInfo.toString() doesn't quote identifiers correctly. Example:

      ij> create table """"(x int);
      0 rows inserted/updated/deleted
      ij> create synonym s1 for """";
      0 rows inserted/updated/deleted
      ij> select aliasinfo from sys.sysaliases where alias = 'S1';
      ALIASINFO
      ---------------
      "APP"."""

      1 row selected

      The returned value should say:

      "APP".""""

      That is, there should be one more double quote character.

      1. derby-5168-1a.diff
        3 kB
        Knut Anders Hatlen

        Activity

        Hide
        Knut Anders Hatlen added a comment -

        Committed revision 1087641.

        Show
        Knut Anders Hatlen added a comment - Committed revision 1087641.
        Hide
        Knut Anders Hatlen added a comment -

        All the regression tests ran cleanly with the patch.

        Show
        Knut Anders Hatlen added a comment - All the regression tests ran cleanly with the patch.
        Hide
        Knut Anders Hatlen added a comment -

        Attaching a patch which fixes the toString() method by using a helper method in IdUtil to do the quoting. It also adds a test case for the bug to SynonymTest. The test fails with the following message without the fix:

        junit.framework.AssertionFailedError: Column value mismatch @ column 'ALIASINFO', row 1:
        Expected: >"""".""""<
        Found: >"""."""<

        Show
        Knut Anders Hatlen added a comment - Attaching a patch which fixes the toString() method by using a helper method in IdUtil to do the quoting. It also adds a test case for the bug to SynonymTest. The test fails with the following message without the fix: junit.framework.AssertionFailedError: Column value mismatch @ column 'ALIASINFO', row 1: Expected: >"""".""""< Found: >"""."""<

          People

          • Assignee:
            Knut Anders Hatlen
            Reporter:
            Knut Anders Hatlen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development