Uploaded image for project: 'GeoTools'
  1. GEOT-5176

Oracle queries fails if columns have whitespaces in name

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 13.1
    • Fix Version/s: 16-RC1
    • Component/s: jdbc-oracle plugin
    • Labels:
      None
    • Environment:

      GeoServer 2.7.1.1
      Oracle Express 11g 11.2.0.2

      Description

      I have an oracle table with some column with whitespaces in it (eg. "COORD X")
      GeoServer can create a layer from it, but when it comes to displaying it, GeoTools generates an invalid query:

      SELECT * FROM (SELECT COD_ENT,NRINCID,ANNOINC,DESCRIZIONE PRIMA VIA,NR_CIV1,DESCRIZIONE SECONDA VIA,NR_CIV2,DINAMIC,COORD X,COORD Y,GEOMETRY as GEOMETRY,ID_STRASSE,ID_CIV FROM SCHEMA.TABLE_TMP WHERE ID_STRASSE IS NULL ) WHERE ROWNUM <= 100

      The correct query should be:

      SELECT * FROM (SELECT COD_ENT,NRINCID,ANNOINC,"DESCRIZIONE PRIMA VIA",NR_CIV1,"DESCRIZIONE SECONDA VIA",NR_CIV2,DINAMIC,"COORD X","COORD Y",GEOMETRY as GEOMETRY,ID_STRASSE,ID_CIV FROM SCHEMA.TABLE_TMP WHERE ID_STRASSE IS NULL ) WHERE ROWNUM <= 100

        Attachments

          Activity

            People

            • Assignee:
              ianturton Ian Turton
              Reporter:
              Gnafu Gnafu
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: