|
|
|
|
|
by mianos
486 days ago
|
|
Oracle can not group DDL changes in a transaction, but if an alter table results in an integrity violation the whole thing is rolled back, unlike mysql, that stops where the integrity violation occurs. Maybe Oracle is not as good as Postgres but it's workable. That's if you want to be shafted on licenses anyway. |
|
In modern MySQL, DDL is atomic and crash-safe on a per-statement basis. It's just not "transactional", in the sense that you can't combine multiple DDL statements (nor mix DDL and DML) into a single transaction.
See https://dev.mysql.com/doc/refman/8.0/en/atomic-ddl.html for reference.
Modern versions of MariaDB also have atomic DDL, although their underlying implementation is quite different.
And even in older versions of MySQL and MariaDB, an ALTER TABLE which causes an integrity violation was still rolled back. Think about it: the only possible non-instantaneous integrity violations are when adding a new unique key, new foreign key, or new check constraint. Check constraints didn't exist in old versions of MySQL or MariaDB, so that just leaves unique keys and foreign keys. And there's no notion of a "partially populated" index or a "half applied" foreign key constraint in MySQL, so your assertion of the ALTER just "stopping" mid-stream without rollback is just plain wrong.