Opened 6 years ago

Closed 22 months ago

#5687 closed defect (wontfix)

OGROCITableLayer::SetFeature DESTROY previous record

Reported by: giorgiomugnaini Owned by: warmerdam
Priority: normal Milestone: closed_because_of_github_migration
Component: OGR_SF Version: 1.10.0
Severity: critical Keywords: ogrocidatasource, oci, OGROCITableLayer, SetFeature
Cc: Even Rouault, ilucena

Description

Current implementation of OGROCITableLayer::SetFeature? destroy existing records instead of performing an update. Such behavior is not acceptable in presence of triggers or foreign keys.

Change History (3)

comment:1 Changed 6 years ago by giorgiomugnaini

	/* -------------------------------------------------------------------- */
	/*      Prepare the delete command, and execute.  We don't check the    */
	/*      error result of the execute, since attempting to Set a          */
	/*      non-existing feature may be OK.                                 */
	/* -------------------------------------------------------------------- */
	    OGROCIStringBuf     oCmdText;
	    OGROCIStatement     oCmdStatement( poDS->GetSession() );
	
	    oCmdText.Appendf( strlen(poFeatureDefn->GetName())+strlen(pszFIDName)+100,
	                      "DELETE FROM %s WHERE \"%s\" = %d",
	                      poFeatureDefn->GetName(), 
	                      pszFIDName, 
	                      poFeature->GetFID() );
	
	    oCmdStatement.Execute( oCmdText.GetString() );
	
	    return CreateFeature( poFeature );

comment:2 Changed 6 years ago by Even Rouault

I agree this is non optimal behaviour. If needed, I could be contracted to improve this ( contact at spatialys.com )

comment:3 Changed 22 months ago by Even Rouault

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub?. If you believe this ticket is still valid, you may file it to https://github.com/OSGeo/gdal/issues if it is not already reported there.

Note: See TracTickets for help on using tickets.