EF Core version: master
Database Provider: Firebird
BatchExecutor creates a savepoint named __EFSavePoint
Firebird cannot create a savepoint with an underscore name - returns a DSQL error.
Dynamic SQL Error
SQL error code = -104
Token unknown - line 1, column 11
__EFSavePoint
Could you allow replace this hardcoded name?
Thanks.
@cincuranet can you please confirm this is an actual limitation of Firebird? If so, we may need to add a hook for providers to specify/customize the savepoint name.
Note: this can be worked around by disabling savepoint support for Firebird (i.e. override RelationalTransaction.SupportsSavepoints to return false)
The ___EFSavePoint_ should be quoted (because of the underscores at the beginning). As long as we're talking about SAVEPOINT statement.
The ___EFSavePoint_ should be quoted (because of the underscores at the beginning). As long as we're talking about
SAVEPOINTstatement.
Connection (to FB/IB) with first (1) dialect does not support quoted names.
To enable quoting, you can inherit from RelationalTransaction and override GetCreateSavepointSql/GetRollbackToSavepointSql/GetReleaseSavepointSql - hopefully that's sufficient.
As I understand, savepoint name uses common rules for database object (like table, column names).
So, I think, RelationalTransaction must use SqlGenerationHelper (and it method DelimitIdentifier) for create correct SQL - SAVEPOINT "SavePointName".
As minimum.
From other side, as I noted earlier, connection (to Firebird) with first dialect does not support quoted names.
Dialect 1 is deprecated in Firebird.
Regardless of Firebird, it's true that savepoint names are standard identifiers and we should go through SqlGenerationHelper (just tested on SQL Server, Sqlite, PG, MySQL).