Subject Database corruption issue
Author partsi

We would like to know that is it possible for a Firebird database to get corrupted when one transaction issues DROP TABLE and there are other connections/transactions running concurrently in the database?

The reason why we would like to know this is to make sure whether this can be really the case or not. If it's possible, it requires us to change our application code to avoid issuing DROP TABLE while there are other connections active. We began to suspect this possibility when we got an answer from IB Surgeon Support concerning a corrupted database that we sent to them. Below is how they answered to our questions:

>Do you mean that it is unsafe to execute normal SQL operations such as SELECT, INSERT, and UPDATE, if another thread is executing DROP TABLE, even if both of these are in transactions?

IB Surgeon Support: Yes, it's unsafe, because there is interaction out of transaction level.

>What precautions should we take before executing DROP TABLE?

IB Surgeon Support: Ideally, users should be switched off. Try to use temporary tables or avoid dropping tables while working - create them as needed and drop after backup as part of maintenance.

Best regards,

Timo Partanen