2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
// Database engines that don't support transactions can leave partial
// inserts in place when an error occurs. This is the case for MySQL
// when running on a MyISAM table.
$this->pass("The whole transaction has not been rolled-back when a duplicate key insert occurs, this is expected because the database doesn't support transactions");
}
else{
$this->fail('The whole transaction is rolled back when a duplicate key insert occurs.');
}
}
else{
$this->pass('The whole transaction is rolled back when a duplicate key insert occurs.');
}
// Ensure the values for records 2 and 3 were not inserted.
$record=db_select('test')
->fields('test',['name','age'])
->condition('age',[17,30],'IN')
->execute()->fetchObject();
$this->assertFalse($record,'The rest of the insert aborted as expected.');