GeoTools
  1. GeoTools
  2. GEOT-646

JDBCTextFeatureWriter encodes the AttributeType instead of its value

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.1.0, 2.2.M0
    • Component/s: main
    • Labels:
      None

      Description

      JDBCTextFeatureWriter::makeUpdateSql(Feature, Feature) creates a wrong update statement, since it uses the toString() of the AttributeType as value instead of the value of that attribute on the feature:

      if (attributes[i].isGeometry())

      { String geomName = attributes[i].getName(); int srid = ftInfo.getSRID(geomName); attrValue = getGeometryInsertText((Geometry) currAtt, srid); }

      else

      { attrValue = addQuotes(attributes[i]); //this is the wrong line }

      this ends up in a statement like: UPDATE <table> SET <attr> = 'DefaultAttributeType [name=id , type=class java.lang.String , nillable=true, min=1, max=1]....

        Issue Links

          Activity

          Hide
          Gabriel Roldan added a comment -
          fixed at revision #14982 for 2.1.x and #14983 for trunk.
          Show
          Gabriel Roldan added a comment - fixed at revision #14982 for 2.1.x and #14983 for trunk.

            People

            • Assignee:
              Gabriel Roldan
              Reporter:
              Gabriel Roldan
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: