#7039 closed defect (fixed)
OGRMSSQLSpatialTableLayer::DeleteFeature fails with schema prefix
Reported by: | jerryfaust | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 2.2.2 |
Component: | OGR_SF | Version: | 2.2.1 |
Severity: | normal | Keywords: | mssql |
Cc: | tamas |
Description
The SQL DELETE statement is placing square brackets around the table name, which if containing a schema prefix, is improperly formatted.
DELETE FROM [schema.table] should instead be DELETE FROM [schema].[table]
I replaced the original statement (at line 1153):
oStatement.Appendf("DELETE FROM [%s] WHERE [%s] = " CPL_FRMT_GIB,
poFeatureDefn->GetName(), pszFIDColumn, nFID);
with
oStatement.Appendf("DELETE FROM [%s].[%s] WHERE [%s] = " CPL_FRMT_GIB,
pszSchemaName, pszTableName, pszFIDColumn, nFID);
Change History (5)
comment:1 by , 7 years ago
Component: | default → OGR_SF |
---|---|
Version: | unspecified → 2.2.1 |
comment:2 by , 7 years ago
Cc: | added |
---|
comment:3 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:5 by , 7 years ago
Keywords: | mssql added |
---|---|
Milestone: | → 2.2.2 |
Tamas, I've taken the liberty to apply the patch suggested by the reporter, which looks consistant with other part of the code. I didn't test myself more than compiling.
In 40100: