Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-147

ERROR 42X79 not consistant ? - same column name specified twice

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 10.2.2.1, 10.3.1.4
    • SQL
    • None

    Description

      This happens from JDBC or ij. Here the output form ij>

      ij version 10.0
      CONNECTION0* - jdbc:derby:phsDB

      • = current connection
        ij> select a1.XXX_foreign, a1.native, a1.kind, a1.XXX_foreign FROM slg_name_lookup a1 ORDER BY a1.XXX_foreign;
        ERROR 42X79: Column name 'XXX_FOREIGN' appears more than once in the result of the query expression.

      But when removing the ORDER BY and keeping the 2 same column names it works

      ij> select a1.XXX_foreign, a1.native, a1.kind, a1.XXX_foreign FROM slg_name_lookup a1;
      XXX_FOREIGN |NATIVE |KIND |XXX_FOREIGN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      0 rows selected
      ij>

      So - it seams to be OK to specify the same column twice - as long as you do not add the ORDER BY clause.

      I woul dof course like that the system allows this - but at leats it should be consistant and either allow both or none of the two queries above.

      Attachments

        1. derby-147.diff
          22 kB
          Bernd Ruehlicke
        2. derby-147-10.0.2.1.diff
          22 kB
          Bernd Ruehlicke
        3. patch_with_tests.diff
          14 kB
          Bryan Pendleton

        Issue Links

          Activity

            People

              bryanpendleton Bryan Pendleton
              bruehlicke Bernd Ruehlicke
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: