Thanks a lot for your help, but prepare never raises exception. See my examples. No problem in preparing phase, and after dataset is prepared, Dataset.StatementType is returned correctly.
It is only ExecSQL which raises SIGSEGV.
Now I tried to experiment more.
Interestingly, it seems that it has nothing to do with Dataset, but this also gives us SIGSEGV:
var
Stm: IStatement;
Trn: ITransaction;
S: String;
...
S := 'savepoint abc';
Trn := Database.Attachment.StartTransaction(
[isc_tpb_write, isc_tpb_nowait, isc_tpb_rec_version, isc_tpb_read_committed]
, TACommit);
Stm := Database.Attachment.Prepare(Trn, S); // this is ok
Stm.Execute; // SIGSEGV
But, if instead of Stm.Execute, I use Database.Attachement.ExecImmediate(Trn, S), then everything is fine!
I'm surprised that Execute on low level leads to SIGSEGV, whereas Dataset.Database.Attachment.ExecImmediate works just fine.