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

ORDER BY causes column to be returned

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.1.3.1, 10.2.2.0, 10.3.3.0, 10.4.1.3
    • 10.3.3.1, 10.4.2.1, 10.5.1.1
    • SQL
    • None
    • Mac OS 10.4, JDK 1,6
    • Normal

    Description

      The ORDER BY is causing the ordered column to be retrieved even though it is not part of the SELECT clause. Here is a script to create a table, insert a row, and perform the select:

      CREATE TABLE "REVIEWS"."GEOFF_REVIEWS_REVIEW"
      (
      PK INTEGER PRIMARY KEY not null,
      numstars BIGINT,
      body VARCHAR(32672),
      title VARCHAR(32672),
      authoremail VARCHAR(32672)
      );

      INSERT INTO "REVIEWS"."GEOFF_REVIEWS_REVIEW" (PK,numstars,body,title,authoremail) VALUES (0 /not nullable/,0,'s','s','s');

      SELECT "review"."numstars"
      FROM
      "GEOFF_REVIEWS_REVIEW" AS "review"
      WHERE
      "review"."PK" = 1
      ORDER BY
      "review".PK

      Attachments

        1. d3997.stat
          0.2 kB
          Knut Anders Hatlen
        2. d3997.diff
          2 kB
          Knut Anders Hatlen

        Issue Links

          Activity

            People

              knutanders Knut Anders Hatlen
              geoff_hendrey geoff hendrey
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: